changeset 1451:5f9fbf75ad34 draft

Old compilers complain about linker options passed with -c, so split out $LDOPTIMIZE.
author Rob Landley <rob@landley.net>
date Sat, 30 Aug 2014 17:44:07 -0500
parents 0089cd84afea
children 8f9721561211
files configure scripts/make.sh
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat Aug 30 16:34:46 2014 -0500
+++ b/configure	Sat Aug 30 17:44:07 2014 -0500
@@ -8,7 +8,8 @@
 # Required for our expected ABI. we're 8-bit clean thus "char" must be unsigned.
 CFLAGS="$CFLAGS -funsigned-char"
 
-[ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -Wl,--gc-sections -fno-asynchronous-unwind-tables"
+[ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables"
+[ -z "$LDOPTIMIZE" ] && LDOPTIMIZE="-Wl,--gc-sections"
 [ -z "$CC" ] && CC=cc
 [ -z "$STRIP" ] && STRIP=strip
 
--- a/scripts/make.sh	Sat Aug 30 16:34:46 2014 -0500
+++ b/scripts/make.sh	Sat Aug 30 17:44:07 2014 -0500
@@ -180,7 +180,7 @@
 
 BUILD="${CROSS_COMPILE}${CC} $CFLAGS -I . $OPTIMIZE"
 FILES="$(ls lib/*.c) main.c $TOYFILES"
-LINK="-o toybox_unstripped -Wl,--as-needed $(cat generated/optlibs.dat)"
+LINK="$LDOPTIMIZE -o toybox_unstripped -Wl,--as-needed $(cat generated/optlibs.dat)"
 
 # This is a parallel version of: do_loudly $BUILD $FILES $LINK || exit 1