From fb246028d929fbe1acc96e5509805b11979d3284 Mon Sep 17 00:00:00 2001 From: Frances Wingerter Date: Wed, 2 Oct 2024 23:15:24 -0400 Subject: [PATCH] add script to build compiler-rt --- cross-build-compiler-rt.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 cross-build-compiler-rt.sh diff --git a/cross-build-compiler-rt.sh b/cross-build-compiler-rt.sh new file mode 100755 index 000000000000..b37c0b741985 --- /dev/null +++ b/cross-build-compiler-rt.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# see https://llvm.org/docs/HowToCrossCompileBuiltinsOnArm.html +mkdir -p build-compiler-rt +cd build-compiler-rt +cross_flags="--gcc-toolchain=/usr --sysroot=/usr/aarch64-linux-gnu -march=armv8.5-a+memtag -ffixed-x18" +export LDFLAGS="-L/usr/aarch64-linux-gnu/lib" +cmake -GNinja -DLLVM_TARGETS_TO_BUILD="AArch64" \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DLLVM_DEFAULT_TARGET_TRIPLE="aarch64-linux-gnu" -DCMAKE_C_FLAGS="$cross_flags --target=aarch64-linux-gnu" -DCMAKE_CXX_FLAGS="$cross_flags --target=aarch64-linux-gnu" -DCMAKE_C_COMPILER="$(pwd)/../build/bin/clang" -DCMAKE_CXX_COMPILER="$(pwd)/../build/bin/clang" -DCMAKE_BUILD_WITH_INSTALL_RPATH=true -DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_MEMPROF=OFF -DCOMPILER_RT_BUILD_ORC=OFF -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE="aarch64-linux-gnu" ../compiler-rt +ninja