From 023df8e596aab8ad054a4fb8921c0a4890a78ac1 Mon Sep 17 00:00:00 2001 From: Egor Ananyin Date: Thu, 10 Jun 2021 20:38:00 +0300 Subject: Ports: Add LLVM port --- Ports/llvm/package.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 Ports/llvm/package.sh (limited to 'Ports/llvm/package.sh') diff --git a/Ports/llvm/package.sh b/Ports/llvm/package.sh new file mode 100755 index 0000000000..e9c1db9873 --- /dev/null +++ b/Ports/llvm/package.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port=llvm +useconfigure=true +version=12.0.0 +workdir=llvm-project-llvmorg-${version} +configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt" +files="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${version}.zip llvm.zip f77723b70a5d4ab14899feda87d6cf601612165899abb2f6c7b670e517f45e2d" +auth_type=sha256 + +pre_patch() { + host_env + mkdir -p llvm-host + cmake ${workdir}/llvm \ + -B llvm-host \ + -DLLVM_ENABLE_PROJECTS=clang + make -C llvm-host -j $(nproc) llvm-tblgen clang-tblgen + target_env +} + +configure() { + mkdir -p llvm-build + cmake ${workdir}/llvm \ + -B llvm-build $configopts \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DLLVM_TARGETS_TO_BUILD=X86 \ + -DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \ + -DLLVM_TABLEGEN=$(pwd)/llvm-host/bin/llvm-tblgen \ + -DCMAKE_CROSSCOMPILING=True \ + -DLLVM_DEFAULT_TARGET_TRIPLE=i386-none-gnueabi \ + -DLLVM_TARGET_ARCH=X86 \ + -DLLVM_INCLUDE_BENCHMARKS=OFF \ + -DLLVM_INCLUDE_TESTS=OFF \ + -DCLANG_TABLEGEN=$(pwd)/llvm-host/bin/clang-tblgen +} + +build() { + make -C llvm-build -j $(nproc) --no-print-directory +} + +install() { + make -C llvm-build -j $(nproc) --no-print-directory install +} -- cgit v1.2.3