From 23cd64ec357d4ba66476878dbe6cc63f71dac0a9 Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Thu, 29 Feb 2024 23:39:18 +0100 Subject: [PATCH] reduce dynamic library dependencies for macos release --- .github/workflows/nightly.yml | 8 ++++++-- build_odin.sh | 3 +-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0a344ebf1..709f968a7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -83,7 +83,9 @@ jobs: TMP_PATH=$(xcrun --show-sdk-path)/user/include echo "CPATH=$TMP_PATH" >> $GITHUB_ENV - name: build odin - run: make nightly + # These -L makes the linker prioritize system libraries over LLVM libraries, this is mainly to + # not link with libunwind bundled with LLVM but link with libunwind on the system. + run: CXXFLAGS="-L/usr/lib/system -L/usr/lib" make nightly - name: Bundle run: | mkdir dist @@ -117,7 +119,9 @@ jobs: TMP_PATH=$(xcrun --show-sdk-path)/user/include echo "CPATH=$TMP_PATH" >> $GITHUB_ENV - name: build odin - run: make nightly + # These -L makes the linker prioritize system libraries over LLVM libraries, this is mainly to + # not link with libunwind bundled with LLVM but link with libunwind on the system. + run: CXXFLAGS="-L/usr/lib/system -L/usr/lib" make nightly - name: Bundle run: | mkdir dist diff --git a/build_odin.sh b/build_odin.sh index 589aeb550..fab6c5fd1 100755 --- a/build_odin.sh +++ b/build_odin.sh @@ -63,8 +63,7 @@ Darwin) fi CXXFLAGS="$CXXFLAGS $($LLVM_CONFIG --cxxflags --ldflags)" - LDFLAGS="$LDFLAGS -liconv -ldl -framework System" - LDFLAGS="$LDFLAGS -lLLVM-C" + LDFLAGS="$LDFLAGS -liconv -ldl -framework System -lLLVM" ;; FreeBSD) CXXFLAGS="$CXXFLAGS $($LLVM_CONFIG --cxxflags --ldflags)"