Removing dependency to libgcc_s.so

David Daney ddaney at avtrex.com
Wed Jul 26 01:04:49 UTC 2006


Rob Landley wrote:
> On Monday 24 July 2006 2:42 pm, David Daney wrote:
> 
>>>I'm confused now. Is 64bit division now part of libgcc_s.so or is gcc
>>>supposed to statically link in the stuff from libgcc.a even though the
>>>application is dynamically linked?
>>>
>>
>>This is how it works.  The 64 bit division support is statically linked 
>>from libgcc.a
> 
> 
> On 32 bit systems.
> 
> And last I checked (which was a very long time ago) they had a truly _crappy_ 
> implementation of it in said library, so you pretty much wanted to avoid it 
> anyway.
> 
> However on 64 bit systems, 64 bit integer division should be a sane thing to 
> do.
> 
> 
>>I'm quite confident that -static-libgcc will be the best solution short 
>>of fixing the linker.
> 
> 
> I just added it and the linker barfed, with the gcc 4.0 in Ubuntu 6.06.  Quite 
> possible I did it wrong...

Something like this should do it:

gcc -o hello-world -static-libgcc hello-world.c

As far as I know, the  -static-libgcc is only needed on mips[el]-linux

Most other platforms (ie i386-linux) should not need the -static-libgcc 
as the linker is only broken on mips.

David Daney



More information about the busybox mailing list