Path and compile musl libc into kernel
This commit is contained in:
26
toolchain/build-musl.sh
Executable file
26
toolchain/build-musl.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
|
||||
[ -d /opt/src/patch-musl ] && rsync -a /opt/src/patch-musl/ /opt/external/musl/
|
||||
|
||||
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"
|
||||
|
||||
make
|
||||
make install-headers
|
||||
make install
|
||||
Reference in New Issue
Block a user