OSDN Git Service

Old compilers complain about linker options passed with -c, so split out $LDOPTIMIZE.
authorRob Landley <rob@landley.net>
Sat, 30 Aug 2014 22:44:07 +0000 (17:44 -0500)
committerRob Landley <rob@landley.net>
Sat, 30 Aug 2014 22:44:07 +0000 (17:44 -0500)
configure
scripts/make.sh

index 6047baf..fc58de6 100644 (file)
--- a/configure
+++ b/configure
@@ -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
 
index 66fdad3..42143f8 100755 (executable)
@@ -180,7 +180,7 @@ do_loudly()
 
 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