[uClibc] Proposal adding -z defs by default

Erik Andersen andersen at codepoet.org
Wed Nov 3 16:25:40 UTC 2004


On Wed Nov 03, 2004 at 09:38:43AM +0100, Joakim Tjernlund wrote:
> > > Yes, unless I am mistaken, ld complain that main is undefined in __uClibc_main.c. Making it weak
> > > will shut up ld and resolve to NULL iff no main function is found elsewere. That would also mean that
> > > if you try ty build an exec and forget to define main, you will probably NOT get a compliant from ld
> > > about missing main function.
> > 
> > Then I wouldn't add that ;-(, it would introduce probably more trouble.
> > 
> > Would you accept a patch that ignores libc, but adds -z defs to LDFLAGS to 
> > all other libs?
> > 
> > Peter
> 
> This is a system wide change and I don't know if there are other side effects, you
> better ask Erik.

I have no problem with using 'ld -z defs' on libm and whatnot
other than libc.  Would be nice for libc (we used to have a
script that performed a similar function) but sadly it does
indeed whine about missing main, and we can't add even a weak
main to libc or badness will ensue.  Might be possible to link
libuClibc twice, with a script wrapping up ld and filtering
stdout for 'main' and only emitting an error for additional
output....

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list