RE: Building a library using as universal for 10.3.9 ppc from an Intel build box
RE: Building a library using as universal for 10.3.9 ppc from an Intel build box
- Subject: RE: Building a library using as universal for 10.3.9 ppc from an Intel build box
- From: "Brant Sears" <email@hidden>
- Date: Thu, 20 Jul 2006 15:12:10 -0400
- Thread-topic: Building a library using as universal for 10.3.9 ppc from an Intel build box
Title: RE: Building a library using as universal for 10.3.9 ppc from an Intel build box
To answer this: Specifying an SDK is pretty much meaningless for compiling this particular library because it does not use any Mac specific calls. It is C++ code that uses only BSD APIs.
The library is also used on Linux. It is not built with XCode, it is built with make and configure (i.e. the gnu autotools). So, XCode specific flags (like some of the ones suggested at various points in this thread such as GCC_VERSION_xxx, MACOSX_DEPLOYMENT_TARGET_xxx, etc) can't be used.
I do have to build with GCC 3.3 because of the C++ dependency.
The library that we are talking about is used by a Cocoa app that is built with XCode. I don't seem to have any problems building the application either on PPC or Intel provided that the libraries are in the correct form.
The problems is compiling the libraries from an Intel Mac which is only a problem so far as we just hired another developer and bought him a mac that is Intel based. In the future, we probably won't be buying any more development machines that are not Intel, so it seems like the right thing to do to make sure the build script can be run from either type of Mac.
The build script that I'm using compiles and works just fine on a PowerPC based machine running 10.4.7. The original part of the script to build the ppc/GCC 3.3 version of the library was:
# build ppc
sudo gcc_select 3.3
make clean
~/src/libvmx/configure --disable-shared
make -C ~/src/libvmx/
sudo make -C ~/src/libvmx/ install
cp -f /usr/local/lib/libvmx.a ~/temp/ppc3/
which on a PPC mac builds OK. On the Intel Mac, obviously the ppc architecture isn't the default, so I tried changing the configure line to:
env CFLAGS="-arch ppc" CXXFLAGS="-arch ppc" ~/src/libvmx/configure --disable-shared
which caused it to build a universal binary containing both ppc and i386 instead of just ppc. (Which is OK, I guess.) So, then I tried changing the cp line to:
lipo -thin ppc /usr/local/lib/libvmxnet.a -output ~/temp/ppc3/libvmx.a
So that it will create a thin library containing only a PPC/GCC 3.3 version which can be "married" to the i384/GCC4 version in the final step:
lipo -replace ppc ~/temp/ppc3/libvmx.a -output ~/temp/final/libvmx.a ~/temp/u4/libvmx.a
This creates a universal version of the library which I would expect to work. For whatever reason when I try to use it, my app doesn't link (it has some references to missing symbols that appear to be C++ std library symbols). Whereas, if I use the library created in a similar manner on the PPC, it links.
So, I'm continuing to try various experiments to try to pinpoint the problem... (Example: build the thin ppc library on the G5, then try the final lipo merge from the intel box and test the result, etc.)
-----Original Message-----
From: Nick Zitzmann [mailto:email@hidden]
Sent: Thu 7/20/2006 1:07 PM
To: Brant Sears
Cc: email@hidden
Subject: Re: Building a library using as universal for 10.3.9 ppc from an Intel build box
On Jul 20, 2006, at 7:36 AM, Brant Sears wrote:
> Because I want to run with earlier versions of 10.3 which require
> GCC 3.3.
You didn't answer my question:
> Why not just set the
> target to use the 10.3.9 SDK on PPC and 10.4u SDK on Intel?
Also, GCC 3.3 is only required for earlier versions of 10.3 if your
application uses C++ or ObjC++ code. If you only use C or ObjC, then
you can use GCC 4.0.
Nick Zitzmann
<http://seiryu.home.comcast.net/>
S/MIME signature available upon request
_______________________________________________
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