diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-06-11 16:27:36 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-06-28 16:23:54 +0200 |
commit | 21dc79e4104050129c9d67225072fd9e31c6990a (patch) | |
tree | 28ac4b1af3360fec4da9852c1acc89a9433b1a2a | |
parent | 7eccfe13f10cda25d0d3ae18134dade100ab1d9d (diff) | |
download | bootstrappable-toolchain-21dc79e4104050129c9d67225072fd9e31c6990a.tar.gz |
stage-0/binutils: use interpreter
... instead of relying on hard-coded /bin/sh in the #!-line.
Also add our interpreter in scripts that are called directly
during the build.
-rw-r--r-- | src/bootstrap/stage-0-binutils.TARGETS | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bootstrap/stage-0-binutils.TARGETS b/src/bootstrap/stage-0-binutils.TARGETS index ea09156..cf282bd 100644 --- a/src/bootstrap/stage-0-binutils.TARGETS +++ b/src/bootstrap/stage-0-binutils.TARGETS @@ -21,7 +21,13 @@ , "export MAKE=${LOCALBASE}/bin/make" , "export PATH=${LOCALBASE}/bin:$PATH" , "unset LDFLAGS" - , "./configure --prefix=/ --disable-nls --enable-shared=no --enable-plugins=no --enable-gprofng=no --disable-werror --enable-deterministic-archives --without-zstd >configure.log 2>&1 || (cat configure.log && exit 1)" + , "export SHELL=${LOCALBASE}/bin/sh" + , "export CONFIG_SHELL=${LOCALBASE}/bin/sh" + , "mv install-sh install-sh.orig" + , "echo '#!'\"${SHELL}\" > install-sh" + , "cat install-sh.orig >> install-sh" + , "chmod 755 install-sh" + , "sh ./configure --prefix=/ --disable-nls --enable-shared=no --enable-plugins=no --enable-gprofng=no --disable-werror --enable-deterministic-archives --without-zstd >configure.log 2>&1 || (cat configure.log && exit 1)" , "${MAKE} MAKEINFO=true all-binutils >build.log 2>&1 || true" , "cd binutils" , "AR_SRCS='ar.c arparse.c arlex.c arsup.c not-ranlib.c rename.c binemul.c emul_vanilla.c bucomm.c version.c filemode.c'" @@ -45,6 +51,12 @@ , "export AR=${LOCALBASE}/bin/ar" , "export MAKE=${LOCALBASE}/bin/make" , "export PATH=${LOCALBASE}/bin:$PATH" + , "export SHELL=${LOCALBASE}/bin/sh" + , "export CONFIG_SHELL=${LOCALBASE}/bin/sh" + , "mv install-sh install-sh.orig" + , "echo '#!'\"${SHELL}\" > install-sh" + , "cat install-sh.orig >> install-sh" + , "chmod 755 install-sh" , "unset LDFLAGS" , "if [ -f /lib/ld-musl-$(uname -m).so.1 ]; then" , " ln -s /lib/ld-musl-$(uname -m).so.1 ${TMPDIR}/ldd" @@ -52,7 +64,7 @@ , "fi" , "mkdir build" , "cd build" - , "../configure --prefix=/ --disable-nls --enable-gprofng=no --disable-werror --enable-deterministic-archives >configure.log 2>&1 || (cat configure.log && exit 1)" + , "sh ../configure --prefix=/ --disable-nls --enable-gprofng=no --disable-werror --enable-deterministic-archives >configure.log 2>&1 || (cat configure.log && exit 1)" , "${MAKE} -j1 MAKEINFO=true >build.log 2>&1 || (cat configure.log build.log && exit 1)" , "${MAKE} -j1 MAKEINFO=true DESTDIR=${DESTDIR} install-strip >>build.log 2>&1 || (cat configure.log build.log && exit 1)" , "for f in $(find ${DESTDIR} -type f -name '*.la'); do sed -i 's|'$(pwd)'|/build|g' $f; done" |