• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: libgcc_s.dylib dependency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libgcc_s.dylib dependency


  • Subject: Re: libgcc_s.dylib dependency
  • From: "E. Wing" <email@hidden>
  • Date: Mon, 26 Sep 2005 11:37:39 -0700

> > In the build log, check to see how Xcode is launching GCC to link the
> > binary. If it's using G++ and not GCC to link the binary, or if the "-
> > shared-libgcc" option is being used, then the binary will be linked
> > against libgcc_s.

So as I said, when I built things from the command line, I made sure
to use gcc (and not g++) and didn't specify '-shared-libgcc' and I am
still getting linked to libgcc_s.

But I looked through the gcc man pages again and found a corresponding
option: "-static-libgcc". So I tried using it, but so far, the switch
seems to have no effect. I checked the file system, and there do seem
to be files that look like they would be a static gcc: libgcc.a and
libgcc_static.a.

So focusing on my library build instruction, I tried:
gcc -static-libgcc -dynamiclib -o libfoo.dylib foolib.o

But otool -L still shows a link to libgcc_s.

Then I tried using -v to see what was going on. This is the underlying
command I got:

 /usr/bin/libtool -dynamic -arch_only ppc -noall_load
-weak_reference_mismatches non-weak -o libfoo.dylib
-L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1
-L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1
-L/usr/lib/gcc/powerpc-apple-darwin8/4.0.1/../../.. foolib.o -lgcc_s
-lgcc -lSystemStubs -lmx -lSystem

It seems with or without the '-static-libgcc', the linker line always
shows "-lgcc_s -lgcc".

I tried invoking this line myself without the -lgcc_s and, voila, the
libgcc_s dependency disappeared.

So now I know this is possible, but I would like to know how I can get
this behavior from gcc (and ultimately Xcode) without having to invoke
libtool directly myself. Am I using the -static-libgcc flag
incorrectly? Or is there another flag I need in conjunction, or is
this an Apple/gcc bug that needs to be filed/fixed?

Thanks,
Eric
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >libgcc_s.dylib dependency (From: "E. Wing" <email@hidden>)
 >Re: libgcc_s.dylib dependency (From: Nick Zitzmann <email@hidden>)
 >Re: libgcc_s.dylib dependency (From: "E. Wing" <email@hidden>)

  • Prev by Date: Error creating new project (2.1)
  • Next by Date: Re: Erronious warning in Jam-based targets?
  • Previous by thread: Re: libgcc_s.dylib dependency
  • Next by thread: Is there an XCode Apple Event for New Project...?
  • Index(es):
    • Date
    • Thread