Re: Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard?
Re: Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard?
- Subject: Re: Using gcc-4.2 on 10.6 Snow Leopard to target 10.5 Leopard?
- From: Alastair Houghton <email@hidden>
- Date: Mon, 5 Oct 2009 10:37:05 +0100
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...
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 :-)
--
http://alastairs-place.net
_______________________________________________
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