summaryrefslogtreecommitdiff
path: root/repo/llvm/llvm.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-31 11:05:19 +0100
committerdavidovski <david@davidovski.xyz>2022-05-31 11:05:19 +0100
commit48ca75555522716f0f686dcae3dd6cf3d8ad714d (patch)
tree00c0f58550ba4661e87376f2f02c8001c69bae44 /repo/llvm/llvm.xibuild
parent871b2b573f01c1b3176a0f65458b3d281b41c437 (diff)
removed idea of repos
Diffstat (limited to 'repo/llvm/llvm.xibuild')
-rw-r--r--repo/llvm/llvm.xibuild88
1 files changed, 88 insertions, 0 deletions
diff --git a/repo/llvm/llvm.xibuild b/repo/llvm/llvm.xibuild
new file mode 100644
index 0000000..9d42a9c
--- /dev/null
+++ b/repo/llvm/llvm.xibuild
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+MAKEDEPS="make ninja cmake libedit libffi libxml2 ncurses python-sphinx binutils lua python-six"
+DEPS="perl zlib libffi libedit ncurses"
+
+PKG_VER=13.0.1
+SOURCE="https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/llvm-project-$PKG_VER.src.tar.xz"
+DESC="Low Level Virtual Machine"
+
+ADDITIONAL="
+clang-001-fix-unwind-chain-inclusion.patch
+clang-002-add-musl-triples.patch
+libcxx-musl.patch
+libcxx-ssp-nonshared.patch
+libcxxabi-dl.patch
+llvm-001-musl.patch
+llvm-004-override-opt.patch"
+
+prepare () {
+ enabled_projects="clang;clang-tools-extra;libcxx;libcxxabi;libunwind;openmp;lld"
+
+ apply_patches
+ cd llvm
+ #sed -i 's|__ptrace_request|int|g' \
+ #../lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+
+ # disable lldb docs, since they fail to generate
+ #sed -i '/add_subdirectory(docs)/d' \
+ #../lldb/CMakeLists.txt
+
+
+ sed -i 's,check_library_exists(gcc_s .*,set(LIBCXXABI_HAS_GCC_S_LIB ON),' \
+ ../libcxxabi/cmake/config-ix.cmake
+ sed -i 's,check_library_exists(gcc .*,set(LIBCXXABI_HAS_GCC_LIB ON),' \
+ ../libcxxabi/cmake/config-ix.cmake
+
+
+ sed -i 's,# Set common link flags.,list(APPEND SANITIZER_COMMON_LINK_LIBS execinfo),' \
+ ../compiler-rt/CMakeLists.txt
+
+ export CFLAGS="$CFLAGS -g1"
+ export CXXFLAGS="$CXXFLAGS -g1"
+}
+
+build () {
+ mkdir build
+ cd build
+ cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DENABLE_LINKER_BUILD_ID=YES \
+ -DLLDB_USE_SYSTEM_SIX=YES \
+ -DLIBCXX_CXX_ABI=libcxxabi \
+ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=YES \
+ -DLIBCXXABI_USE_LLVM_UNWINDER=YES \
+ -DLIBCXXABI_ENABLE_STATIC_UNWINDER=YES \
+ -DLIBOMP_ENABLE_SHARED=YES \
+ -DLIBOMP_INSTALL_ALIASES=NO \
+ -DLLVM_INCLUDE_DOCS=YES \
+ -DLLVM_INSTALL_UTILS=YES \
+ -DLLVM_BUILD_LLVM_DYLIB=YES \
+ -DLLVM_LINK_LLVM_DYLIB=YES \
+ -DLLVM_ENABLE_RTTI=YES \
+ -DLLVM_ENABLE_FFI=YES \
+ -DLLVM_BINUTILS_INCDIR=/usr/include \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLLVM_BUILD_DOCS=OFF \
+ -DLIBCXX_HAS_MUSL_LIBC=YES \
+ -DLLVM_BUILD_EXAMPLES=OFF \
+ -DLLVM_BUILD_TESTS=ON \
+ -DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-linux-musl" \
+ -DLLVM_ENABLE_ASSERTIONS=OFF \
+ -DLLVM_ENABLE_PIC=ON \
+ -DLLVM_ENABLE_SPHINX=OFF \
+ -DLLVM_ENABLE_TERMINFO=ON \
+ -DLLVM_ENABLE_ZLIB=ON \
+ -DLLVM_HOST_TRIPLE="x86_64-linux-musl" \
+ -DLLVM_INCLUDE_EXAMPLES=OFF \
+ -DLLVM_APPEND_VC_REV=OFF \
+ -DLLVM_ENABLE_PROJECTS="$enabled_projects" \
+ -Wno-dev -G Ninja .. &&
+
+ ninja llvm-tblgen &&
+ ninja
+}
+
+package () {
+ DESTDIR=$PKG_DEST ninja install
+}