Post marked as solved
Post marked as solved with 10 replies, 4,104 views
I see Big Sur has put all the system provided libraries, including libc, into a built in dynamic linker cache. For some reason this cache is not visible to ld. This means using ld with -lc does not work as it used to.
There is a work around where you can use -L to add a path to the copy of the libraries that come with XCode, but does that mean anyone who wants to use the compiled program will need to have XCode installed?
Even if XCode is not required, I was wondering; what is the official Apple approved method for a C program to link against a library in the new dynamic linker cache?
It seems to me that ld with -lc should do this automatically. But if the official answer is to use dlopen, then how does a command line C application call dlopen unless it can link against the system library to gain access to dlopen?
What am I not understanding about the new way of doing things?