-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
100 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
mv llvm-* llvm | ||
mkdir {clang,libc++,compiler-rt}-build | ||
|
||
# Build clang | ||
cd clang-build | ||
cmake \ | ||
../llvm/llvm \ | ||
-G Ninja \ | ||
-DLLVM_ENABLE_PROJECTS="lld;clang" \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DLLVM_PARALLEL_COMPILE_JOBS=$JOBS \ | ||
-DLLVM_PARALLEL_LINK_JOBS=1 \ | ||
-DLLVM_TARGETS_TO_BUILD=X86 \ | ||
-DCMAKE_INSTALL_PREFIX="$SYSROOT" | ||
ninja -j$JOBS | ||
ninja -j$JOBS install | ||
cd .. | ||
|
||
# Build libstdc++ | ||
cd ../libc++-build | ||
cmake | ||
../llvm | ||
-G Ninja \ | ||
-S runtimes \ | ||
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ | ||
-DLIBCXX_USE_COMPILER_RT=OFF \ | ||
-DCMAKE_C_COMPILER="$SYSROOT/bin/clang" \ | ||
-DCMAKE_CXX_COMPILER="$SYSROOT/bin/clang++" \ | ||
-DCMAKE_ASM_COMPILER_TARGET="$TARGET" \ | ||
-DCMAKE_C_COMPILER_TARGET="$TARGET" \ | ||
-DCMAKE_CXX_COMPILER_TARGET="$TARGET" \ | ||
-DCMAKE_CXX_FLAGS="-nostdlib++" \ | ||
-DCMAKE_INSTALL_PREFIX=$SYSROOT | ||
ninja -j$JOBS cxx cxxabi unwind | ||
ninja install-cxx install-cxxabi install-unwind | ||
cd .. | ||
|
||
# Build compiler-rt | ||
cd compiler-rt-build | ||
cmake \ | ||
../llvm/compiler-rt \ | ||
-G Ninja \ | ||
-DCMAKE_C_COMPILER="$SYSROOT/bin/clang" \ | ||
-DCMAKE_CXX_COMPILER="$SYSROOT/bin/clang++" \ | ||
-DLLVM_CONFIG_PATH="$SYSROOT/bin/llvm-config" \ | ||
-DCMAKE_ASM_COMPILER_TARGET="$TARGET" \ | ||
-DCMAKE_C_COMPILER_TARGET="$TARGET" \ | ||
-DCMAKE_CXX_COMPILER_TARGET="$TARGET" \ | ||
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \ | ||
-DCOMPILER_RT_BAREMETAL_BUILD=ON \ | ||
-DCOMPILER_RT_BUILD_BUILTINS=ON \ | ||
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | ||
-DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
-DCOMPILER_RT_BUILD_PROFILE=OFF \ | ||
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
-DCOMPILER_RT_BUILD_XRAY=OFF \ | ||
-DCOMPILER_RT_BUILD_ORC=ON \ | ||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
-DCOMPILER_RT_BUILTINS_ENABLE_PIC=OFF \ | ||
-DCMAKE_INSTALL_PREFIX=$SYSROOT/lib/clang/13.0.1/ | ||
ninja -j$JOBS | ||
ninja -j$JOBS install | ||
cd .. | ||
|
||
# Patch | ||
ln -fsv ../../lib/clang/13.0.1/lib/linux/clang_rt.crtbegin-i386.o $SYSROOT/usr/lib/crtbegin.o | ||
ln -fsv crtbegin.o $SYSROOT/usr/lib/crtbeginS.o | ||
ln -fsv crtbegin.o $SYSROOT/usr/lib/crtbeginT.o | ||
ln -fsv ../../lib/clang/13.0.1/lib/linux/clang_rt.crtend-i386.o $SYSROOT/usr/lib/crtend.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"sources": [ | ||
{ | ||
"location": "/", | ||
"url": "https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-18.1.4.tar.gz" | ||
} | ||
], | ||
"package": { | ||
"name": "clang", | ||
"version": "18.1.4", | ||
|
||
"description": "The Clang project provides a language front-end and tooling infrastructure for languages in the C language family (C, C++, Objective C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project.", | ||
|
||
"build_deps": [], | ||
"run_deps": [] | ||
} | ||
} |