[uClibc] Re: crt unacceptable "fix" removal

Peter S. Mazinger ps.m at gmx.net
Fri Oct 15 21:01:50 UTC 2004


On Fri, 15 Oct 2004, Manuel Novoa III wrote:

> Peter,
> 
> On Fri, Oct 15, 2004 at 10:12:59PM +0200, Peter S. Mazinger wrote:
> > On Fri, 15 Oct 2004, Manuel Novoa III wrote:
> > > On Fri, Oct 15, 2004 at 09:28:31PM +0200, Peter S. Mazinger wrote:
> > > > 
> > > > I have thought a lot how I can change the gcc defaults, but it's no way 
> > > > out, nostdinc does nothing for linker stage, nostdlib (or nostartfiles) 
> > > > has to be used and the rest has to be provided manually. Well, I didn't 
> > > > found any other solution to it (someone w/ another idea?)
> > > 
> > > Which is why I'm saying don't even try.  Even if you get it working
> > > now (as you probably did), it just makes for unnecessary maintenance
> > > headaches because you're having to duplicate what gcc is (currently)
> > > doing.
> > > 
> > > Once again... the sane thing is to build the utils _after_ you build
> > > the targeted toolchain.
> > 
> > How should I handle than native env? The "toolchain" is already targeted.
> 
> What is the problem?  The utilities are just applications that happen
> to have their source in the uClibc tree.  Build them as you would build
> any other application.  If you want them to use the newly built libs
> and crt files, then do an install of the devel environment and build
> the utils afterwards.
> 
> > I'll try it again.
> > If I disable CTOR_DTOR in uClibc what do I really need to build
> > libs and executables (dynamic and static) (we assume they do not need 
> > [de]constructor support from libc)
> 
> The things that would typically need constructor/destructor support in
> uClibc are handled specially by __uClibc_main so that initialization
> and shutdown of the lib does not rely on CTOR_DTOR.
> 
> > libs (shared/archive):
> > do I need crtbegin/end.o from gcc and/or crti/n.o from uClibc?
> 
> libpthread.so does since it relies on a constructor.  Other shared
> libs in uClibc don't.
> 
> > executables (dyn/static)
> > do I need crt[01].o
> > do I need crtbegin/end.o and/or crti/n.o
> 
> Look at the gcc specs file.

I know that file pretty well I think, thanks.
I have done a test w/ ldconfig and if CTOR_DTOR is disabled it needs only 
crt?.o from uClibc, nothing else (case not covered by the gcc-specs). If 
I build it "normally" w/ gcc (it adds start and endfiles) the resulting 
file is 5k bigger.

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list