Refactor ports builds

This commit is contained in:
2022-03-04 19:32:31 +01:00
parent 12c7adeb0e
commit 04f8b61a9d
5 changed files with 2 additions and 4 deletions

28
toolchain/ports/musl/build.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/sh -e
TARGET=x86_64-elf
SYSROOT=/opt/sysroot
# Pull or update musl libc
mkdir -p /opt/external && cd /opt/external
[ -d musl ] || git clone --depth=1 git://git.musl-libc.org/musl
cd musl
git reset --hard
git pull
# Apply patches
[ -d /opt/src/patch-musl ] && rsync -a /opt/src/patch-musl/ /opt/external/musl/
# Build and install
mkdir -p /opt/external/build-musl && cd /opt/external/build-musl
rm -r *
../musl/configure \
--target=${TARGET} \
--prefix=${SYSROOT}/usr \
--disable-shared \
--enable-debug \
CFLAGS="-O0 -mcmodel=large -mno-red-zone"
make
make install-headers
make install