mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 03:46:06 +00:00

Linking libraries in ld64 with -weak-lx / -weak_library causes all references to symbols in those libraries to be made weak, allowing the librarie to be missing at runtime. This patch extends EPCDynamicLibrarySearchGenerator with support for emulating this behavior: If an instance is constructed with an Allow predicate but no dylib handle then all symbols matching the predicate are immediately resolved to null. The llvm-jitlink tool is updated with -weak-lx / -weak_library options for testing. Unlike their ld64 counterparts these options take a TBD file as input, and always resolve all exports in the TBD file to null.