PDA

View Full Version : xcode - i didnt want universal binaries


AsLan^
2005-12-26, 20:03
Here's something odd...

I didnt install the cross architecture stuff for xcode, and I can't make a release build...


Building target “CardTable” of project “CardTable” — (1 error, 2 warnings)
cd /Users/fredrick/CardTable
/usr/bin/gcc-4.0 -o /Users/fredrick/CardTable/build/CardTable.build/Release/CardTable.build/Objects-normal/i386/CardTable -L/Users/fredrick/CardTable/build/Release -F/Users/fredrick/CardTable/build/Release -filelist /Users/fredrick/CardTable/build/CardTable.build/Release/CardTable.build/Objects-normal/i386/CardTable.LinkFileList -framework Cocoa -arch i386 -mmacosx-version-min=10.3 -isysroot /Developer/SDKs/MacOSX10.3.9.sdk
/usr/bin/ld: warning /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/Cocoa.framework/Cocoa cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
/usr/bin/ld: warning fat file: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib does not contain an architecture that matches the specified -arch flag: i386 (file ignored)
/usr/bin/ld: Undefined symbols:
___keymgr_dwarf2_register_sections
__cthread_init_routine
_atexit
_errno
_exit
_mach_init_routine
_NSApplicationMain
.objc_class_name_NSObject
_objc_msgSend
_objc_msgSendSuper
_printf
.objc_class_name_NSAutoreleasePool
.objc_class_name_NSDate
.objc_class_name_NSImage
.objc_class_name_NSThread
.objc_class_name_NSView
___CFConstantStringClassReference
collect2: ld returned 1 exit status
/usr/bin/ld: warning /Developer/SDKs/MacOSX10.3.9.sdk/System/Library/Frameworks/Cocoa.framework/Cocoa cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
/usr/bin/ld: warning fat file: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib does not contain an architecture that matches the specified -arch flag: i386 (file ignored)
/usr/bin/ld: Undefined symbols:


I only have ppc selected for my target build and debug works fine, its only when I try to build a release build that I get this error...

Anyway, I'm re-downloading xcode now to try and install the cross arch stuff, I just thought it was interesting is all.

AsLan^
2005-12-26, 21:39
Hmm... well after I installed the stuff for universal binaries, I can make a release build for 10.4 (Universal).

But what I can't do and what's sort of important to me is make a build for 10.3.9

I get a very similar error saying "arch doesnt match cpu flag etc. "

Has anyone else had similar problems ?

This is xcode 2.2 by the way.

EDIT: Removed "cross platform", my bad.

pmazer
2005-12-26, 22:08
I don't understand why you need to create a cross-platform build for 10.3.9. All Intel Macs should be running 10.4 or higher. I'm not even sure if 10.3.9 will run on x86.

chucker
2005-12-26, 22:11
But what I can't do and what's sort of important to me is make a cross platform build for 10.3.9

You can't do that.

Enki
2005-12-26, 22:14
Yep, PPC only for pre-10.4

AsLan^
2005-12-26, 22:47
Sorry guys perhaps its a little misleading...

I didnt want to make universal binaries, but it wouldn't compile for 10.4 (with only ppc arch selected) until after i installed the universal binaries.

It still doesn't work when I try and compile for 10.3.9 (selecting the 10.3.9 sdk and selecting ppc arch without intel) it still give me the same error that I was getting before.

Looking back at my first post I can see I posted the wrong error message, but I assure you I got something very similar to that when trying to compile for 10.4 without the universal sdk installed.

AsLan^
2005-12-26, 22:49
In a nutshell... I cant compile for 10.3.9 and thats what I wanted to do :)

faramirtook
2005-12-26, 23:07
In a nutshell... I cant compile for 10.3.9 and thats what I wanted to do :)


Could you put 2 binaries in the MacOS folder and have a script pick which one is the right one?

AsLan^
2005-12-26, 23:09
Could you put 2 binaries in the MacOS folder and have a script pick which one is the right one?

I'm not sure what you mean ? I cant generate a binary for 10.3.9 at all, the build fails with that error message.

faramirtook
2005-12-26, 23:12
Oh. never mind me then. :o

AsLan^
2005-12-26, 23:40
Alright, it sort of works now...

I had check "Continue buliding after errors" in preferences.

After that I was able to compile for Panther (with aforementioned errors) and then run it on Panther too :)

scratt
2005-12-26, 23:58
Alright, it sort of works now...

I had check "Continue buliding after errors" in preferences.

After that I was able to compile for Panther (with aforementioned errors) and then run it on Panther too :)

*scribble furiously in tatty note book on desk* 'Another setting to watch out for in Xcode'
:D

AsLan^
2005-12-27, 00:02
*scribble furiously in tatty note book on desk* 'Another setting to watch out for in Xcode'
:DI was hoping it was something like that, and that someone else could point it out to me !

Mr Beardsley
2005-12-27, 23:34
A couple of questions:

Did you install the 10.3 sdk when you installed the developer tools?
Under the "Get Info" for your project did you select the 10.3 SDK for your project?

AsLan^
2005-12-28, 02:59
A couple of questions:

Did you install the 10.3 sdk when you installed the developer tools?
Under the "Get Info" for your project did you select the 10.3 SDK for your project?

Yes I most certainly did, it's important to me because I want to run my apps on my Panther running ibook too. When I originally installed xcode, I installed the 10.3.9 SDK but not the ~250mb Universal Binaries SDK (hard disk drive was precious to me that day). And as for selecting the correct SDK, before going back and re-install the universal binaries part of xcode, it couldn't build a "release" build for 10.4 or 10.3.9, you can see I incorrectly posted the error message generated when I tried with 10.3.9 but that was the same error I was getting with 10.4 as well. Only on the "release" build mind you, they could both build in debug just fine, and I made sure to check the settings of both build types as well.

Funnily enough, xcode has started playing up again when trying to cross compile the same project again. This time the binary generated wouldnt run at all, saying something like "OSX cannot open this application because it may be damaged or corrupted." I know it can work because there is a binary version of the app which I can run on my ibooks desktop right now !

I think it's a genuine bug, perhaps Apple didn't think anyone wouldn't install the Universal Binaries option and that somehow broke it. It looks like that -i386 flag is hardwired into a gcc setting somewhere.

AsLan^
2005-12-30, 00:11
For anyone that's interested or may be encountering the same problem.

After working once it continued to play up, so I re-installed xcode... but that didn't work either.

Then I discovered you can leave the SDK set to 10.4 and just set the Deployment Target (in the Build tab of Project Info) to 10.3.

This compiles cleanly without errors, and creates a binary that will run on 10.3 (providing you havnt used any 10.4 features of course).

I double checked it this time too (with two different projects) before posting ;)