Small patch to "clear" to add flush

JoSH Lehan krellan at gmail.com
Fri Dec 28 00:26:16 UTC 2007


On Dec 26, 2007 7:48 PM, Denys Vlasenko <vda.linux at googlemail.com> wrote:
> Too bad #warning directives cannot print big blinking
> ***SHOUTING LETTERS***.
>
> #warning Static linking against glibc produces buggy executables
> #warning (glibc does not cope well with ld --gc-sections).
> #warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
> #warning Note that glibc is unsuitable for static linking anyway.
> #warning If you still want to do it, remove -Wl,--gc-sections
> #warning from scripts/trylink and remove this warning.
> #error Aborting compilation.
> #endif

Actually, in applets/applets.c in a recent download of 1.8.2 it says:

#warning Static linking against glibc produces buggy executables
#warning (glibc does not cope well with ld --gc-sections).
#warning See sources.redhat.com/bugzilla/show_bug.cgi?id=3400
#warning Note that glibc is unsuitable for static linking anyway.
#warning If you still want to do it, remove -Wl,--gc-sections
#warning from top-level Makefile and remove this warning.

> IT SAYS "REMOVE -Wl,--gc-sections FROM scripts/trylink" STUPID!

Maybe I'm "STUPID" as you say, but it doesn't mention scripts/trylink
there at all!

> try $CC $LDFLAGS \
>         -o $EXE \
>         -Wl,--sort-common \
>         $SORT_SECTION \
> ===>    -Wl,--gc-sections \        <======================= HERE!
>         -Wl,--start-group $O_FILES $A_FILES -Wl,--end-group \
>         $l_list \
>
> How can I make it MORE OBVIOUS to you?

In the scripts/trylink script, a block similar to this appears in 6
different places.
I wasn't sure which to change, so I changed them all.

I'm going to take a gamble here and attempt submitting another patch.
Here it is, attached.  This attempts to make the warning message "MORE
OBVIOUS to you" and tell the user what to do.

Size comparison for static, all other options at default, under glibc on x86:
With gc_sections set to true (default):
1466048 (1662556 unstripped)
With gc_sections set to false:
1503268 (1707304 unstripped)

Josh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc-sections-option.patch
Type: text/x-patch
Size: 2624 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20071227/ea34c36b/attachment-0002.bin 


More information about the busybox mailing list