[cfarm-users] dylib on macOS 11

Christian Jullien eligis at orange.fr
Mon Mar 22 09:26:57 CET 2021


Thanks, very helpful, I'll take a look

-----Original Message-----
From: cfarm-users [mailto:cfarm-users-bounces at lists.tetaneutral.net] On Behalf Of Bruno Haible via cfarm-users
Sent: Monday, March 22, 2021 09:18
To: jullien at eligis.com
Cc: Bruno Haible; cfarm-users at lists.tetaneutral.net
Subject: Re: [cfarm-users] dylib on macOS 11

Christian,

> To port TinyCC on Silicon we facing a major issue: libc.dylib (link to
> libSystem.dylib) no longer exists on the filesystem, it is cached and
> hidden somewhere in the system.

Yes. [1][2]

> You can still dlopen libSystem.dylib and then dlsym any symbols you like
> but you can't fopen libSystem.dylib and then fread the archive as tcc does.

dlopen is what you do at runtime.

At link time, I would open the .tbd file that you find in the lib/ directory
of the SDK. For example,
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libc.tbd
It contains, in particular, the sections 'exports: symbols:' (which gives you
the list of symbols) and 'install-name:' (which gives you the dlopen'able
file name that you can stuff into the executable).

Bruno

[1] https://developer.apple.com/forums/thread/655588
[2] https://developer.apple.com/documentation/macos-release-notes/macos-big-sur-11_0_1-release-notes

_______________________________________________
cfarm-users mailing list
cfarm-users at lists.tetaneutral.net
https://lists.tetaneutral.net/listinfo/cfarm-users



More information about the cfarm-users mailing list