weird "cut" in busybox 1.2.2 ?

Steven Shiau steven at nchc.org.tw
Fri Oct 27 11:54:25 UTC 2006


Thanks for explaining the reason so quickly.
Therefore not only cut, but also a lot of programs will fail to output
some results if statically link is chosen.

Steven.

Denis Vlasenko wrote:
> On Friday 27 October 2006 11:05, Steven Shiau wrote:
>> Hi,
>> Just tested the busybox 1.2.2, but I found it's weird for cut, Here it's
>> the problem I encountered:
>> 1.  The busybox is 1.2.2, statically link, compiled with gcc (GCC) 3.2.2
>> 20030222 (Red Hat Linux 3.2.2-5)
> 
> applets.c now has a trap for this:
> 
> #if ENABLE_STATIC && defined(__GLIBC__)
> #warning Static linking against glibc produces buggy executables
> #warning (glibc doesn't cope well with ld --gc-sections).
> #warning See http://sources.redhat.com/bugzilla/show_bug.cgi?id=3400
> #warning Note that glibc is utterly unsuitable for static linking anyway.
> #endif
> 
> It can be worked around at the cost of increasing
> busybox size. You can condidtionally exclude "-Wl,--gc-sections"
> in Makefile:
> 
> uiet_cmd_busybox__ ?= LINK    $@
> ifdef CONFIG_STATIC
>       cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) \
>       -static \
>       -o $@ \
>       -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
>       -Wl,--start-group $(busybox-all) -Wl,--end-group
> else
>       cmd_busybox__ ?= $(srctree)/scripts/trylink $(CC) -o $@ \
>       -Wl,--warn-common -Wl,--sort-common -Wl,--gc-sections \
>       -Wl,--start-group $(busybox-all) -Wl,--end-group
> endif
> 
> It's trivial to check for CONFIG_STATIC:
> 	$(if $(CONFIG_STATIC),aaa,bbb)
> but how to check for glibc?
> (Answer should be in diff -u form...)
> --
> vda


-- 
Steven Shiau <steven _at_ nchc org tw> <steven _at_ stevenshiau org>
National Center for High-performance Computing, Taiwan.
http://www.nchc.org.tw
Public Key Server PGP Key ID: 1024D/9762755A



More information about the busybox mailing list