logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://anongit.hacktivis.me/git/bootstrap-initrd.git/
commit: 80002346f375a777a2e26fafccdfb1b534fe547e
parent 4108f14a923ce916d83bd8735878b9f4fc84c1cd
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  6 May 2025 22:11:33 +0200

make-root.sh: only allow alloca(3) when supported by tcc

Diffstat:

Mmake-root.sh14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/make-root.sh b/make-root.sh @@ -183,13 +183,17 @@ done # Allows to shave off ~9.1M from the binary seed rm usr/lib/libc.a -# tcc-0.9.27_git20250106-r0 doesn't supports alloca(3) on riscv yet +# tcc-0.9.27_git20250106-r0 only supports alloca(3) on __i386__, __x86_64__, __arm__ (32-bit) # removing the musl-provided header allows to compile git # (still breaks GNU make though) -if [ "${ALPINE_ARCH}" = riscv64 ]; then - rm usr/include/alloca.h - sed -i '/alloca\.h/d' usr/include/stdlib.h -fi +case "${ALPINE_ARCH}" in + x86|x86_64|armhf) + ;; + *) + rm usr/include/alloca.h + sed -i '/alloca\.h/d' usr/include/stdlib.h + ;; +esac if [ "${ALPINE_ARCH}" = aarch64 ]; then # Compiling oksh-7.6