Skip to content

Commit

Permalink
fix: loading libc++ on macOS Sonoma
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed Jul 26, 2023
1 parent 96c59cc commit 978a5b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion script/prepare-llvm-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ $CP llvm/lib/clang/*/include/{std*,__std*,limits}.h stage1/include/clang
# libSystem stub, includes libc
cp $SDK/usr/lib/libSystem.tbd stage1/lib/libc
# use for linking, use system libs for running
gcp llvm/lib/lib{c++,c++abi,unwind}.dylib stage1/lib/libc
for lib in lib{c++,c++abi,unwind}.dylib; do
gcp llvm/lib/$lib stage1/lib/libc
# make sure we search for the library in /usr/lib instead of the rpath, which should not contain `/usr/lib`
# and apparently since Sonoma does not do so implicitly either
install_name_tool -id /usr/lib/$lib stage1/lib/libc/$lib
done
echo -n " -DLLVM=ON -DLLVM_CONFIG=$PWD/llvm-host/bin/llvm-config" # manually point to `llvm-config` location
echo -n " -DLEAN_STANDALONE=ON"
# do not change C++ compiler; libc++ etc. being system libraries means there's no danger of conflicts,
Expand Down

0 comments on commit 978a5b2

Please sign in to comment.