Skip to content

Commit

Permalink
ci: use rpath-link and rpath so partition-alloc can find our libc++
Browse files Browse the repository at this point in the history
rpath-link is needed for the link step, rpath is needed for runtime

this may conflict with what CMake wants to do with rpaths, but seems to work for now
  • Loading branch information
fw-immunant committed Oct 31, 2024
1 parent 4912340 commit 406e1f4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,12 @@ jobs:
Clang_DIR=`realpath $LLVM_DIR/../clang`
mkdir build
pushd build
cross_link_flags="-B$(pwd)/../llvm-project/build-rtlibs/compiler-rt/lib/linux \
-L`pwd`/../llvm-project/build-rtlibs/lib \
rtlibs_dir="$(pwd)/../llvm-project/build-rtlibs"
cross_link_flags="-B${rtlibs_dir}/compiler-rt/lib/linux -L${rtlibs_dir}/lib \
--rtlib=compiler-rt --unwindlib=libunwind"
# TODO: rpath needs addition but this would override it:
# "-Wl,-rpath,$(pwd)/../llvm-project/build-rtlibs/lib"
cross_flags="-isystem /usr/aarch64-linux-gnu/include --gcc-toolchain=/usr \
-march=armv8.5-a+memtag -ffixed-x18 --rtlib=compiler-rt --stdlib=libc++ \
-I$(pwd)/../llvm-project/build-rtlibs/include/c++/v1"
-I${rtlibs_dir}/include/c++/v1"
export LDFLAGS="-L/usr/aarch64-linux-gnu/lib"
cmake .. \
-DCMAKE_CROSSCOMPILING_EMULATOR=${{ github.workspace }}/qemu/build/qemu-aarch64 \
Expand All @@ -190,8 +188,8 @@ jobs:
-DCMAKE_OBJCOPY=/usr/bin/llvm-objcopy-15 \
-DCMAKE_C_FLAGS="$cross_flags" \
-DCMAKE_CXX_FLAGS="$cross_flags" \
-DCMAKE_EXE_LINKER_FLAGS="$cross_link_flags -lm" \
-DCMAKE_SHARED_LINKER_FLAGS="$cross_link_flags" \
-DCMAKE_EXE_LINKER_FLAGS="$cross_link_flags -lm -Wl,-rpath-link,${rtlibs_dir}/lib" \
-DCMAKE_SHARED_LINKER_FLAGS="$cross_link_flags -Wl,-rpath,${rtlibs_dir}/lib" \
-DClang_DIR=$Clang_DIR \
-DCLANG_EXE=`which clang-15` \
-DLLVM_DIR=$LLVM_DIR \
Expand Down

0 comments on commit 406e1f4

Please sign in to comment.