changeset 865:15522b490e53

Build busybox static by default (but not for host-tools.sh, since static glibc is buggy, and let .config to switch it off).
author Rob Landley <rob@landley.net>
date Mon, 26 Oct 2009 20:29:16 -0500
parents 5660a438421b
children 0f7be5f83f3f
files config sources/sections/busybox.sh
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/config	Mon Oct 26 06:16:45 2009 -0500
+++ b/config	Mon Oct 26 20:29:16 2009 -0500
@@ -27,8 +27,13 @@
 
 # export RECORD_COMMANDS=1
 
-# If this is set, packages are statically linked.
+# By default, only busybox is built statically (doing so provides a 20%
+# performance boost to autoconf under qemu).
 
+# To make busybox dynamic, set this to "none".  Set it to any other
+# value to link all packages statically.
+
+# export BUILD_STATIC=none
 # export BUILD_STATIC=1
 
 # If this is set, build.sh will build a compiler statically linked
--- a/sources/sections/busybox.sh	Mon Oct 26 06:16:45 2009 -0500
+++ b/sources/sections/busybox.sh	Mon Oct 26 20:29:16 2009 -0500
@@ -2,12 +2,17 @@
 
 [ ! -z "$ARCH" ] && DO_CROSS=CROSS_COMPILE=${ARCH}-
 
+# Build busybox statically by default, but don't statically link against
+# glibc because glibc is buggy and can't combine --static with --gc-sections.
+
+[ "$BUILD_STATIC" != "none" ] && [ ! -z "$ARCH" ] && BUSYBOX_STATIC="--static"
+
 # Build busybox
 
 setupfor busybox
 make allyesconfig KCONFIG_ALLCONFIG="${SOURCES}/trimconfig-busybox" &&
 cp .config "$WORK"/config-busybox
-LDFLAGS="$LDFLAGS $STATIC_FLAGS" make -j $CPUS $VERBOSITY $DO_CROSS &&
+LDFLAGS="$LDFLAGS $BUSYBOX_STATIC" make -j $CPUS $VERBOSITY $DO_CROSS &&
 make busybox.links &&
 cp busybox "${STAGE_DIR}"