build compiler-rt
This commit is contained in:
parent
5936c684b9
commit
7f82d7ce97
|
@ -18,7 +18,7 @@ LLVM is built using a podman container (see Containerfile). The steps for replic
|
||||||
```
|
```
|
||||||
mkdir llvm_build
|
mkdir llvm_build
|
||||||
podman build -t llvm-build -f Containerfile.llvm
|
podman build -t llvm-build -f Containerfile.llvm
|
||||||
podman run --rm --cpus 16 -m 12G --mount type=bind,source=$PWD/llvm_build,destination=/build/llvm-build localhost/llvm-build
|
podman run --rm --cpus 24 -m 32G --mount type=bind,source=$PWD/llvm_build,destination=/build/llvm-build localhost/llvm-build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
# This script builds the llvm components used by the LCPU addon.
|
# This script builds the llvm components used by the LCPU addon.
|
||||||
# This is run in a debian container to try and keep everything ABI stable.
|
# This is run in a debian container to try and keep everything ABI stable.
|
||||||
|
|
||||||
|
# Act like make, sort of, and fail the whole script if some part fails
|
||||||
|
set -e
|
||||||
|
|
||||||
JOBS=$(nproc)
|
JOBS=$(nproc)
|
||||||
|
|
||||||
# Configure LLVM. THis is a mouthful, but it's only a mouthful because we specialize things we don't
|
# Configure LLVM. THis is a mouthful, but it's only a mouthful because we specialize things we don't
|
||||||
|
@ -15,15 +18,23 @@ cmake -Wno-dev -GNinja -S /build/llvm/llvm -B /build/llvm-build/build \
|
||||||
-DLLVM_TARGETS_TO_BUILD="RISCV" \
|
-DLLVM_TARGETS_TO_BUILD="RISCV" \
|
||||||
-DLLVM_DEFAULT_TARGET_TRIPLE="riscv32-none-gnu"
|
-DLLVM_DEFAULT_TARGET_TRIPLE="riscv32-none-gnu"
|
||||||
|
|
||||||
ninja -C /build/llvm-bin/build -j $JOBS
|
ninja -C /build/llvm-build/build -j $JOBS
|
||||||
|
ninja -C /build/llvm-build install
|
||||||
|
|
||||||
# TODO: Build compiler-rt with our toolchain.
|
# Build compiler-rt with our toolchain.
|
||||||
# This currently does not work as a single build (why would it), we instead
|
cmake -Wno-dev -GNinja -S /build/llvm/compiler-rt -B /build/llvm-build/build-compiler-rt \
|
||||||
# need to stage things (the first building clang + lld), and this being the last stage currently
|
-DCMAKE_C_COMPILER="/build/llvm-build/install/bin/clang" \
|
||||||
#cmake -Wno-dev -GNinja -S llvm_src/compiler-rt \
|
-DCMAKE_CXX_COMPILER="/build/llvm-build/install/bin/clang++" \
|
||||||
# -DCOMPILER_RT_BUILD_SANITIZERS=OFF \
|
-DCMAKE_C_FLAGS="-target riscv32-none-gnu" \
|
||||||
# -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
|
-DCMAKE_CXX_FLAGS="-target riscv32-none-gnu" \
|
||||||
# -DCOMPILER_RT_BUILD_PROFILE=OFF \
|
-DCMAKE_INSTALL_PREFIX="/build/llvm-build/install/lib/clang/${LLVM_VERSION}" \
|
||||||
# -DCOMPILER_RT_BUILD_MEMPROF=OFF \
|
-DLLVM_CONFIG_PATH="/build/llvm-build/install/bin/llvm-config" \
|
||||||
# -DCOMPILER_RT_BUILD_ORC=OFF \
|
-DCOMPILER_RT_BAREMETAL_BUILD=ON \
|
||||||
# -DCOMPILER_RT_BAREMETAL_BUILD=ON
|
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \
|
||||||
|
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
|
||||||
|
-DCOMPILER_RT_BUILD_PROFILE=OFF \
|
||||||
|
-DCOMPILER_RT_BUILD_MEMPROF=OFF \
|
||||||
|
-DCOMPILER_RT_BUILD_ORC=OFF
|
||||||
|
|
||||||
|
ninja -C /build/llvm-build/build-compiler-rt -j $JOBS
|
||||||
|
ninja -C /build/llvm-build/build-compiler-rt install
|
||||||
|
|
Loading…
Reference in New Issue