From 27436d24cd2b1ea4de3cb40bdc532ee5286c6e4b Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 12 Jul 2022 18:31:52 -0500 Subject: [PATCH] binutils: build some binaries statically --- core/binutils/build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/binutils/build b/core/binutils/build index ae00919d..1e2f2fb3 100755 --- a/core/binutils/build +++ b/core/binutils/build @@ -30,4 +30,12 @@ make configure-host make tooldir=/usr make tooldir=/usr install +# These programs are safe to build statically. +cd binutils +make clean-binPROGRAMS +make LDFLAGS="$LDFLAGS -all-static" +for f in *; do + [ -e "$1/usr/bin/$f" ] && mv -f "$f" "$1/usr/bin/$f" +done + ln -sf ld.bfd "$1/usr/bin/ld"