Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicitly build against system-libcxxabi #177

Open
wants to merge 4 commits into
base: rc
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ if [[ "$target_platform" == osx-* ]]; then
export CXXFLAGS="$CXXFLAGS -isysroot $CONDA_BUILD_SYSROOT"
export LDFLAGS="$LDFLAGS -isysroot $CONDA_BUILD_SYSROOT -framework CoreFoundation"

export CMAKE_EXTRA_ARGS="-DCMAKE_OSX_SYSROOT=$CONDA_BUILD_SYSROOT -DLIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS=ON"
export CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_OSX_SYSROOT=$CONDA_BUILD_SYSROOT"
export CMAKE_ARGS="$CMAKE_ARGS -DLIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS=ON"
# we want to build against the system libcxxabi, not ship our own
export CMAKE_ARGS="$CMAKE_ARGS -DLIBCXX_CXX_ABI=system-libcxxabi"
fi

export CFLAGS="$CFLAGS -I$LLVM_PREFIX/include -I$BUILD_PREFIX/include"
Expand All @@ -19,7 +22,7 @@ mkdir build
cmake -G Ninja \
-B build \
-S runtimes \
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
-DLLVM_ENABLE_RUNTIMES="libcxx;libunwind" \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DLIBCXX_ENABLE_TIME_ZONE_DATABASE=ON \
Expand All @@ -29,16 +32,10 @@ cmake -G Ninja \
-DLIBCXX_HARDENING_MODE="${hardening}" \
-DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
$CMAKE_ARGS \
$CMAKE_EXTRA_ARGS
$CMAKE_ARGS

# Build
ninja -C build cxx cxxabi unwind
ninja -C build cxx unwind

# Install
ninja -C build install-cxx install-cxxabi install-unwind

if [[ "$target_platform" == osx-* ]]; then
# on osx we point libc++ to the system libc++abi
$INSTALL_NAME_TOOL -change "@rpath/libc++abi.1.dylib" "/usr/lib/libc++abi.dylib" $PREFIX/lib/libc++.1.0.dylib
fi
ninja -C build install-cxx install-unwind
Loading