summaryrefslogtreecommitdiff
path: root/skip/wasi-compiler-rt.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-03 19:59:53 +0100
committerdavidovski <david@davidovski.xyz>2022-05-03 19:59:53 +0100
commit751b7f3d84515715d07d92a5aed78062bd39adff (patch)
tree9bfdc04a539250f35452cbd0986ca361dd91509f /skip/wasi-compiler-rt.xibuild
parent50740393013cb5fde05318d917ac4b68c58fdfa9 (diff)
added extra files
Diffstat (limited to 'skip/wasi-compiler-rt.xibuild')
-rw-r--r--skip/wasi-compiler-rt.xibuild45
1 files changed, 45 insertions, 0 deletions
diff --git a/skip/wasi-compiler-rt.xibuild b/skip/wasi-compiler-rt.xibuild
new file mode 100644
index 0000000..c3959dd
--- /dev/null
+++ b/skip/wasi-compiler-rt.xibuild
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+NAME="wasi-compiler-rt"
+DESC="WASI LLVM compiler runtime"
+
+MAKEDEPS="cmake "
+DEPS="musl "
+
+PKG_VER=13.0.1
+wasi_sdk_ver=14
+
+SOURCE="https://github.com/WebAssembly/wasi-sdk/archive/refs/tags/wasi-sdk-$wasi_sdk_ver.tar.gz"
+ADDITIONAL="https://github.com/llvm/llvm-project/releases/download/llvmorg-$PKG_VER/compiler-rt-$PKG_VER.src.tar.xz"
+
+prepare () {
+ tar xf compiler-rt-$PKG_VER.src.tar.xz
+ mkdir -p wasi-compiler-rt
+ mv compiler-rt-$PKG_VER.src wasi-compiler-rt/compiler-rt
+ mv wasi-sdk.cmake wasi-compiler-rt
+ mv cmake wasi-compiler-rt
+
+}
+
+build () {
+ cd wasi-compiler-rt
+ mkdir build
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=MinSizeRel \
+ -DCMAKE_MODULE_PATH=$BUILD_ROOT/wasi-compiler-rt/cmake \
+ -DCMAKE_TOOLCHAIN_FILE=$BUILD_ROOT/wasi-compiler-rt/wasi-sdk.cmake \
+ -DCMAKE_C_COMPILER_WORKS=ON \
+ -DCOMPILER_RT_BAREMETAL_BUILD=ON \
+ -DCOMPILER_RT_INCLUDE_TESTS=OFF \
+ -DCOMPILER_RT_HAS_FPIC_FLAG=OFF \
+ -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \
+ -DCOMPILER_RT_OS_DIR=wasi \
+ -DWASI_SDK_PREFIX=/usr \
+ -DCMAKE_INSTALL_PREFIX=/usr/lib/clang/$PKG_VER/ \
+ compiler-rt/lib/builtins
+ cmake --build build
+}
+
+package () {
+ DESTDIR="$PKG_DEST" cmake --install build
+}