Hi all, macOS 11 (now in beta) no longer contains shared library files like libc.dylib, libcurses.dylib etc. Instead it ships a pregenerated linker cache. This means we can no longer check for built in libraries by going through the library directories as we do in mk/buildlink3/find-libs.mk. Apple's documentation suggests using dlopen(), which works as usual and has all the old paths mapped. I've implemented a proof of concept solution by augmenting the file-based check in find-libs.mk with a call to a new tool 'dltest' which attempts to dlopen() its arguments. The tool can be found at https://github.com/sjmulder/dltest. A find-libs.mk patch is attached. Obviously this is incomplete - dltest would need to be part of pkgsrc somehow and it should probably only be invoked on macOS 11 and up. Perhaps there's a better way to test with dlopen() without a helper tool. Alternatively, we could have a static per-release list of built in libraries per macOS version or extract a list from the library cache but those approaches seem fragile to me. Thoughts? Sijmen
Attachment:
find-libs.mk.patch
Description: Binary data