aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-11-30 13:47:05 -0800
committerRob Landley <rob@landley.net>2018-11-30 16:40:14 -0600
commit360a2bfd5de1bc7fbdb69347f2b105fc231e63ef (patch)
tree0ba590f33591e5f45f9b14136debbe911ab7ad40 /scripts
parent890909a6d0ec2fa7f55afd22aa142b4b3d5f156a (diff)
downloadtoybox-360a2bfd5de1bc7fbdb69347f2b105fc231e63ef.tar.gz
macOS: Apple's ancient linker doesn't have --as-needed or --gc-sections.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/make.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/make.sh b/scripts/make.sh
index 306a7cda..640dcbed 100755
--- a/scripts/make.sh
+++ b/scripts/make.sh
@@ -115,7 +115,7 @@ then
for i in util crypt m resolv selinux smack attr rt crypto z log
do
echo "int main(int argc, char *argv[]) {return 0;}" | \
- ${CROSS_COMPILE}${CC} $CFLAGS $LDFLAGS -xc - -o generated/libprobe -Wl,--as-needed -l$i > /dev/null 2>/dev/null &&
+ ${CROSS_COMPILE}${CC} $CFLAGS $LDFLAGS -xc - -o generated/libprobe $LDASNEEDED -l$i > /dev/null 2>/dev/null &&
echo -l$i >> generated/optlibs.dat
echo -n .
done
@@ -125,7 +125,7 @@ fi
# LINK needs optlibs.dat, above
-LINK="$(echo $LDOPTIMIZE $LDFLAGS -o "$UNSTRIPPED" -Wl,--as-needed $(cat generated/optlibs.dat))"
+LINK="$(echo $LDOPTIMIZE $LDFLAGS -o "$UNSTRIPPED" $LDASNEEDED $(cat generated/optlibs.dat))"
genbuildsh > generated/build.sh && chmod +x generated/build.sh || exit 1
#TODO: "make $SED && make" doesn't regenerate config.h because diff .config