logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://anongit.hacktivis.me/git/bootstrap-initrd.git/
commit: 8e6e5c591efcbc25dc781d7ca92ec641d7c90061
parent f9a490dc74ad1d9a9d21a77f11fcf6c0b29329a0
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  6 May 2025 21:47:08 +0200

make-root: Workaround wchar_t incompatible tcc vs. musl typedef

Diffstat:

Mmake-root.sh12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/make-root.sh b/make-root.sh @@ -191,6 +191,18 @@ if [ "${ALPINE_ARCH}" = riscv64 ]; then sed -i '/alloca\.h/d' usr/include/stdlib.h fi +if [ "${ALPINE_ARCH}" = aarch64 ]; then + # Compiling oksh-7.6 + # In file included from alloc.c:12: + # In file included from sh.h:16: + # /usr/lib/tcc/include/stddef.h:6: error: incompatible redefinition of 'wchar_t' + # + # Make it match musl's /usr/include/bits/alltypes.h + #sed -i 's;#define __WCHAR_TYPE__ int;#define __WCHAR_TYPE__ unsigned;' usr/lib/tcc/include/tccdefs.h + # Make musl match tcc (yuck) + sed -i 's;typedef unsigned wchar_t;typedef int wchar_t;' usr/include/bits/alltypes.h +fi + cd "${out_base}/src" ln -s oksh "${out_base}/bin/sh"