iglunix/old/toolchain-aarch64/build.sh

65 lines
1.8 KiB
Bash
Raw Normal View History

2021-05-23 03:47:40 +00:00
pkgname=toolchain-aarch64
pkgver=12.0.0
fetch() {
curl -L "https://github.com/llvm/llvm-project/releases/download/llvmorg-$pkgver/llvm-project-$pkgver.src.tar.xz" -o llvm-$pkgver.tar.gz
curl "https://musl.libc.org/releases/musl-1.2.2.tar.gz" -o musl-1.2.2.tar.gz
tar -xf llvm-$pkgver.tar.gz
tar -xf musl-1.2.2.tar.gz
mv llvm-project-$pkgver.src llvm-$pkgver
mkdir llvm-$pkgver/build-compiler-rt
mkdir sysroot
}
build() {
2021-05-23 03:56:57 +00:00
export pkgdir=$(pwd)/sysroot
2021-05-23 03:47:40 +00:00
cd llvm-$pkgver
cd build-compiler-rt
cmake -G Ninja ../compiler-rt \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/aarch64-linux-musl \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_C_COMPILER_TARGET=aarch64-linux-musl \
-DCMAKE_ASM_COMPILER=clang \
-DCMAKE_ASM_COMPILER_TARGET=aarch64-linux-musl \
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \
-DCOMPILER_RT_BUILD_BUILTINS=ON \
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=OFF \
-DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=aarch64-linux-musl \
-DCOMPILER_RT_INCLUDE_TESTS=OFF \
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \
-DCOMPILER_RT_BUILD_XRAY=OFF \
-DCOMPILER_RT_BUILD_MEMPROF=OFF \
-DCOMPILER_RT_BUILD_PROFILE=OFF \
-DCOMPILER_RT_INCLUDE_TESTS=OFF \
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
-DCMAKE_C_FLAGS='-nostdlib' \
-DCMAKE_ASM_FLAGS='-nostdlib' \
-DCAN_TARGET_aarch64=YES \
-DLIBCXX_HAS_MUSL_LIBC=ON \
-DLLVM_CONFIG_PATH=/usr/bin/llvm-config
2021-05-23 03:56:57 +00:00
DESTDIR=$pkgdir samu install
2021-05-23 03:47:40 +00:00
cd ../..
cd musl-1.2.2
2021-05-23 03:56:57 +00:00
CFLAGS="--sysroot=$pkgdir/usr/aarch64-linux-musl/ --target=aarch64-unknown-linux-musl" AR=ar LIBCC=$pkgdir/usr/aarch64-linux-musl/lib/linux/libclang_rt.builtins-aarch64.a ./configure \
2021-05-23 03:47:40 +00:00
--prefix=/usr/aarch64-linux-musl \
--target=aarch64-unknown-linux-musl \
--enable-wrappers=no
gmake
2021-05-23 03:56:57 +00:00
gmake install DESTDIR=$pkgdir
2021-05-23 03:47:40 +00:00
}
package() {
2021-05-23 03:56:57 +00:00
mv sysroot/* $pkgdir
2021-05-23 03:47:40 +00:00
}
license() {
cd $pkgname-$pkgver
cat LICENSE
# cat COPYING
}