From 406e1f440681d69d2710421c830fa9b7a2f2f2f5 Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Thu, 24 Oct 2024 22:03:32 -0400 Subject: [PATCH] ci: use rpath-link and rpath so partition-alloc can find our libc++ 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 --- .github/workflows/ci.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b420797d5..a857cf76d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 \ @@ -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 \