Add compiler-rt as split package and other minor changes

This commit is contained in:
2025-10-30 11:35:30 +02:00
parent 5a0dc10161
commit 3f533ec60a
3 changed files with 118 additions and 10 deletions
+33 -9
View File
@@ -2,19 +2,28 @@
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The prepare function is executed in the root of the temp directory
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
cd "$BPM_SOURCE"/tools
patch -Np1 -i "$BPM_WORKDIR"/enable-fstack-protector-strong-by-default.patch
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
export CC=gcc CXX=g++
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_ENABLE_FFI=ON \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DCLANG_DEFAULT_PIE_ON_LINUX=ON \
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
-DLLVM_ENABLE_FFI=ON \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DCLANG_DEFAULT_PIE_ON_LINUX=ON \
-DCLANG_CONFIG_FILE_SYSTEM_DIR=/etc/clang \
-Wno-dev -G Ninja
cmake --build build
}
@@ -40,6 +49,16 @@ package_llvm() {
cd "$BPM_OUTPUT"
# Move compiler-rt files into split packag
_pick compiler-rt usr/lib/clang/${BPM_PKG_VERSION%%.*}/bin/hwasan_symbolize
_pick compiler-rt usr/lib/clang/${BPM_PKG_VERSION%%.*}/include/fuzzer
_pick compiler-rt usr/lib/clang/${BPM_PKG_VERSION%%.*}/include/orc
_pick compiler-rt usr/lib/clang/${BPM_PKG_VERSION%%.*}/include/profile
_pick compiler-rt usr/lib/clang/${BPM_PKG_VERSION%%.*}/include/sanitizer
_pick compiler-rt usr/lib/clang/${BPM_PKG_VERSION%%.*}/include/xray
_pick compiler-rt usr/lib/clang/${BPM_PKG_VERSION%%.*}/lib
_pick compiler-rt usr/lib/clang/${BPM_PKG_VERSION%%.*}/share
# Move clang files into split package
_pick clang usr/bin/{amdgpu-arch,analyze-build,c-index-test,diagtool,git-clang-format,hmaptool,intercept-build,nvptx-arch,scan-build,scan-build-py,scan-view}
_pick clang usr/bin/clang*
@@ -67,6 +86,11 @@ package_llvm-libs() {
install -Dm644 "$BPM_SOURCE"/LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/llvm-libs/LICENSE.TXT
}
package_compiler-rt() {
# Install package license
install -Dm644 "$BPM_SOURCE"/LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/compiler-rt/LICENSE.TXT
}
package_clang() {
# Install package license
install -Dm644 "$BPM_SOURCE"/LICENSE.TXT "$BPM_OUTPUT"/usr/share/licenses/clang/LICENSE.TXT