On Mon, Oct 26, 2009 at 11:33 PM, Rob Landley <[email protected]> wrote:
> It looks like this old bug has resurfaced yet again:
>
> http://lists.busybox.net/pipermail/busybox/2006-December/025611.html
> http://bugs.gentoo.org/show_bug.cgi?id=234547
>
> On xubuntu 9.04, building busybox more or less defconfig, the following sed
> invocation (which turns a .config file into a config.h file) works fine, and
> converts the attached .config into the attached config.h.
>
> # This long and roundabout sed invocation is to make old versions happy.
> # New ones have '\n' so can replace one line with two without all the branches
> # and tedious mucking about with hold space.
>
> sed -n \
> -e 's/^# CONFIG_\(.*\) is not set.*/\1/' \
> -e 't notset' \
> -e 's/^CONFIG_\(.*\)=y.*/\1/' \
> -e 't isset' \
> -e 's/^CONFIG_\([^=]*\)=\(.*\)/#define CFG_\1 \2/p' \
> -e 'd' \
> -e ':notset' \
> -e 'h' \
> -e 's/.*/#define CFG_& 0/p' \
> -e 'g' \
> -e 's/.*/#define USE_&(...)/p' \
> -e 'd' \
> -e ':isset' \
> -e 'h' \
> -e 's/.*/#define CFG_& 1/p' \
> -e 'g' \
> -e 's/.*/#define USE_&(...) __VA_ARGS__/p' \
> .config > generated/config.h
>
> But when busybox is built with LDFLAGS="--static", busybox sed produces no
> output (and thus an empty config.h.)
>
> I thought busybox had some workaround code for this? Calling fflush(stdout)
> via
> atexit() or something similar?
It's likely a known problem with glibc+static linking.
Try building static by CONFIG_STATIC=y instead of just adding
a switch via LDFLAGS, scripts/trylink has code to detect that:
# Static linking against glibc produces buggy executables
# (glibc does not cope well with ld --gc-sections).
# See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
# Note that glibc is unsuitable for static linking anyway.
# We are removing -Wl,--gc-sections from link command line.
GC_SECTIONS=`(
. ./.config
if test x"$CONFIG_STATIC" = x"y"; then
check_libc_is_glibc "" "-Wl,--gc-sections"
else
echo "-Wl,--gc-sections"
fi
)`
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox