Re: Compiling for all OS X versions
Re: Compiling for all OS X versions
- Subject: Re: Compiling for all OS X versions
- From: Greg Parker <email@hidden>
- Date: Wed, 28 Jan 2009 12:36:44 -0800
On Jan 28, 2009, at 1:23 AM, email@hidden wrote:
I am trying to compile C sources on a MacBook with Mac OS X 10.5.6
and "XCode 3.0 Developer Tools for Mac OS X v10.5 Leopard" from the
original MacBook installation media as well as "Mac OS X v10.3.9
Support" from the same source installed.
2.
To compile PPC binaries for Mac OS X 10.3.9 from the makefiles on
the 10.5.6 MacBook I use:
CC=gcc-3.3
CFLAGS=-arch ppc
LDFLAGS=-arch ppc -macosx_version_min=10.3.9
I expect the result should run on PPC G3, G4, G5 Macs with 10.3.9
and later installed, but:
Starting this binary on a G3 Mac with 10.4.11 installed results in:
dyld: lazy symbol binding failed: Symbol not found: _getopt$UNIX2003
Referenced from: /tmp/testapp
Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _getopt$UNIX2003
Referenced from: /tmp/testapp
Expected in: /usr/lib/libSystem.B.dylib
Starting this binary on a G4 Mac with 10.3.9 installed results in:
dyld: /tmp/testapp Undefined symbols:
/tmp/testapp undefined reference to ___stderrp expected to be
defined in /usr/lib/libSystem.B.dylib
Trace/BPT trap
You need to set `-mmacosx-version-min=10.3.9` for both compiling and
linking. Specifically, _getopt$UNIX2003 is an artifact of the recent
UNIX compliance changes, and ___stderrp is probably a change in the
crt0/libc startup system which changes often. -mmacosx-version-min
tells the compiler which crt0/libc system to use and whether to expect
UNIX compliance, among other things.
This set of flags might work. (Note spelling, which differs from what
you typed above.)
CC=gcc-3.3
CFLAGS=-arch ppc -mmacosx-version-min=10.3.9
LDFLAGS=-arch ppc -mmacosx-version-min=10.3.9
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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