diff options
author | Elliott Hughes <enh@google.com> | 2018-11-30 13:47:05 -0800 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-11-30 16:40:14 -0600 |
commit | 360a2bfd5de1bc7fbdb69347f2b105fc231e63ef (patch) | |
tree | 0ba590f33591e5f45f9b14136debbe911ab7ad40 /configure | |
parent | 890909a6d0ec2fa7f55afd22aa142b4b3d5f156a (diff) | |
download | toybox-360a2bfd5de1bc7fbdb69347f2b105fc231e63ef.tar.gz |
macOS: Apple's ancient linker doesn't have --as-needed or --gc-sections.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -22,7 +22,11 @@ CFLAGS="$CFLAGS -funsigned-char" [ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-strict-aliasing" # We accept LDFLAGS, but by default don't have anything in it -[ -z "$LDOPTIMIZE" ] && LDOPTIMIZE="-Wl,--gc-sections" +if [ "$(uname)" != "Darwin" ] +then + [ -z "$LDOPTIMIZE" ] && LDOPTIMIZE="-Wl,--gc-sections" + LDASNEEDED="-Wl,--as-needed" +fi # The makefile provides defaults for these, so this only gets used if # you call scripts/make.sh and friends directly. |