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 \