diff --git a/make/busybox.mk b/make/busybox.mk index 61c8d66..4a9a9b3 100644 --- a/make/busybox.mk +++ b/make/busybox.mk @@ -4,12 +4,17 @@ dest/bin/busybox: build/busybox/busybox build/busybox/busybox: build/busybox/.config dest/usr/lib/libc.a $(MAKE) -C build/busybox -build/busybox/.config: +build/busybox/musl-gcc.specs: + mkdir -p build/busybox + ./musl-gcc-specs.sh $(ABS_REPO)/dest/usr/include $(ABS_REPO)/dest/usr/lib /lib/ld-musl-x86_64.so.1 > build/busybox/musl-gcc.specs + +build/busybox/.config: build/busybox/musl-gcc.specs mkdir -p build/busybox $(MAKE) -C build/busybox -f $(ABS_REPO)/vendor/busybox/Makefile KBUILD_SRC=$(ABS_REPO)/vendor/busybox defconfig cp build/busybox/.config build/busybox/.config.bak + sed -i 's!^#* *CONFIG_EXTRA_CFLAGS[ =].*$$!CONFIG_EXTRA_CFLAGS="-specs $(ABS_REPO)/build/busybox/musl-gcc.specs"!' build/busybox/.config sed -i 's!^#* *CONFIG_PREFIX[ =].*$$!CONFIG_PREFIX="$(ABS_REPO)/dest"!' build/busybox/.config - sed -i 's!^#* *CONFIG_STATIC[ =].*$$!CONFIG_STATIC=y!' build/busybox/.config + #sed -i 's!^#* *CONFIG_STATIC[ =].*$$!CONFIG_STATIC=y!' build/busybox/.config sed -i 's!^#* *CONFIG_SYSROOT[ =].*$$!CONFIG_SYSROOT="$(ABS_REPO)/dest"!' build/busybox/.config sed -i 's!^#* *CONFIG_WERROR[ =].*$$!CONFIG_WERROR=n!' build/busybox/.config # It's for Linux diff --git a/musl-gcc-specs.sh b/musl-gcc-specs.sh new file mode 100755 index 0000000..5b2c12f --- /dev/null +++ b/musl-gcc-specs.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +set -eu + +incdir="$1" +libdir="$2" +ldso="$3" + +cat <