• 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: Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard? [Solved]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard? [Solved]


  • Subject: Re: Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard? [Solved]
  • From: Mario Emmenlauer <email@hidden>
  • Date: Mon, 05 Oct 2009 13:11:14 +0200


Alastair Houghton wrote:
On 4 Oct 2009, at 11:40, Mario Emmenlauer wrote:

I am aware of setting
   export MACOSX_DEPLOYMENT_TARGET="10.5"
   CFLAGS+="-mmacosx-version-min=10.5"
   CFLAGS+="-isysroot /Developer/SDKs/MacOSX10.5.sdk"

but will that help against gcc linking its own (newer) libraries?

The -isysroot setting will cause GCC to link against libraries within the SDK folder. If the correct library is in that folder, GCC will link with it. If it isn't, you'll get a linker error.


In the specific case of libgcc, I think you'll find that on OS X it's divided into two pieces; one part is a static library (/usr/lib/gcc/<gcc-version>/<architecture>/libgcc.a) and the other part is a dylib (/usr/lib/libgcc_s.nn.n.dylib). Notice that the library that depends on the GCC version is the static one...

Aaaah *sighs of understanding* This makes total sense. Thanks Alastair (and Iain, whom you beat by two minutes :-) )

Two things I learned to love about Mac: Universal binaries,
and compiling against an SDK.

Cheers,

   Mario


It's also worth pointing out that there's nothing stopping Apple, therefore, from shipping the static library with the developer tools even if it didn't form part of the original operating system for a given SDK.

Anyway, as far as I'm aware, this all works just fine, as indeed is implied by the Xcode release notes, which specifically state:

"Note that neither gcc-4.2 nor llvm-gcc-4.2 will compile code against the 10.4u or
earlier SDK, or deploy for Mac OS X 10.4 or earlier.


Note that because most C++ applications built for 10.3.9 and later use the dynamic
C++ standard library from the operating system, and Leopard only ships with the
gcc 4.0 version of the C++ standard library, the gcc 4.2 and llvm-gcc4.2 compilers
also use the gcc 4.0 C++ standard library, not the gcc 4.2 version."


The C++ point is an interesting one...

Kind regards,

Alastair.

p.s. In spite of the fact that you aren't using Xcode, xcode-users is probably the place to ask this kind of question. Maybe xcode-users should be renamed to devtools-users :-)


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard? (From: Mario Emmenlauer <email@hidden>)
 >Re: Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard? (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Record stream
  • Next by Date: Re: Record stream
  • Previous by thread: Re: Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard?
  • Next by thread: Record stream
  • Index(es):
    • Date
    • Thread