[cfarm-users] dylib on macOS 11
Bruno Haible
bruno at clisp.org
Mon Mar 22 09:18:14 CET 2021
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
More information about the cfarm-users
mailing list