mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 07:31:28 +00:00
e46de4e54f
On Apple platforms, we always support the -nostdlib++ flag. Hence, it is not necessary to manually link against system libraries. In fact, doing so causes us to link against libSystem explicitly, which messes up with the order of libraries we should use. Indeed: Before patch, using the system unwinder (LIBCXXABI_USE_LLVM_UNWINDER = OFF) =========================================================================== $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib} lib/libc++.1.dylib: @rpath/libc++.1.dylib /usr/lib/libSystem.B.dylib @rpath/libc++abi.1.dylib lib/libc++abi.1.dylib: @rpath/libc++abi.1.dylib /usr/lib/libSystem.B.dylib lib/libunwind.1.dylib: @rpath/libunwind.1.dylib /usr/lib/libSystem.B.dylib After patch, using the system unwinder (LIBCXXABI_USE_LLVM_UNWINDER = OFF) =========================================================================== $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib} lib/libc++.1.dylib: @rpath/libc++.1.dylib @rpath/libc++abi.1.dylib /usr/lib/libSystem.B.dylib lib/libc++abi.1.dylib: @rpath/libc++abi.1.dylib /usr/lib/libSystem.B.dylib lib/libunwind.1.dylib: @rpath/libunwind.1.dylib /usr/lib/libSystem.B.dylib Before patch, with the LLVM unwinder (LIBCXXABI_USE_LLVM_UNWINDER = ON) ======================================================================= $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib} lib/libc++.1.dylib: @rpath/libc++.1.dylib /usr/lib/libSystem.B.dylib @rpath/libc++abi.1.dylib @rpath/libunwind.1.dylib lib/libc++abi.1.dylib: @rpath/libc++abi.1.dylib /usr/lib/libSystem.B.dylib @rpath/libunwind.1.dylib lib/libunwind.1.dylib: @rpath/libunwind.1.dylib /usr/lib/libSystem.B.dylib After patch, with the LLVM unwinder (LIBCXXABI_USE_LLVM_UNWINDER = ON) ====================================================================== $ otool -L lib/{libc++.1.dylib,libc++abi.1.dylib,libunwind.1.dylib} lib/libc++.1.dylib: @rpath/libc++.1.dylib @rpath/libc++abi.1.dylib @rpath/libunwind.1.dylib /usr/lib/libSystem.B.dylib lib/libc++abi.1.dylib: @rpath/libc++abi.1.dylib @rpath/libunwind.1.dylib /usr/lib/libSystem.B.dylib lib/libunwind.1.dylib: @rpath/libunwind.1.dylib /usr/lib/libSystem.B.dylib As we can see, libSystem appears before the just-built libraries before the patch, which causes the libunwind.dylib bundled in libSystem.dylib to be used instead of the just-built libunwind.dylib. We didn't notice the issue until recently when I tried to update the macOS CI builders to macOS 13.5, where it is necessary to use the right libunwind library (the exact reason still needs to be investigated). |
||
---|---|---|
.. | ||
Modules | ||
config-ix.cmake |