[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Linking system dylibs on macOS 11+

From: Christian Jullien
Subject: Re: [Tinycc-devel] Linking system dylibs on macOS 11+
Date: Sun, 4 Jul 2021 08:45:56 +0200

Many thanks for you attempt.

- the patch uses DOS format and it took me some time to understand why it

- even after dos2unix, I get
~/tinycc $ git rev-parse --short=7 HEAD
~/tinycc $ git apply ../dyld_shared_cache.patch
error: patch failed: tcc.h:274
error: tcc.h: patch does not apply
error: patch failed: tccmacho.c:934
error: tccmacho.c: patch does not apply
jullien@sims4:~/tinycc $ git version

- I manually patched the 3 files and was able to build a tcc executable but
~/tinycc $ ./tcc -B. foo.c && ./a.out
FIXME: handle reloc type 9 at 1052 [0x14f606d62] to 1050
Bus error: 10

Do you know you can request a free access to macOS Big Sur M1 on

-----Original Message-----
From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange.fr@nongnu.org]
On Behalf Of Sushant Pandurangi
Sent: Sunday, July 04, 2021 00:59
To: tinycc-devel@nongnu.org
Subject: [Tinycc-devel] Linking system dylibs on macOS 11+

Hello all,

I made some small additions to tccmacho.c to get it to work with system
libraries on Big Sur that are in the shared linker cache. Only x86-64 for
now; I don't have any M1 mac to test.

I haven't contributed to tcc before. Do I push straight to mob or would
anyone like to take a look first?

Some points to know:
-- SDK paths are hardcoded as
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" and
"/Applications/Xcode.app/Developer/SDKs/MacOSX.sdk" in that order.  
-- I pulled in <sys/stat.h> because I need to get the size of the tbd file.
Hopefully it won't break the build for any other OSs.
-- Works only for building executables, not (yet) with `tcc -run`.

A patch on top of commit e3a0eb50899 (mob as of today) is attached if you
would like a preview.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]