Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Trying to cross compile for PowerPC on an Intel Mac...

I am wondering if there is an elegant solution for cross-compiling for PowerPC from an Intel Mac platform. This is a strange request, but I want to build with GCC 3.x.x in C for classic MacOS and PPC GNU OS'es for an old PowerMac, which is soooo slow that I can't stand to compile on it, so i would like to use my Intel Mac to do it. I have tried to set up a PowerPC emulator to run some kind of OS that would let me do it, but the options (Qemu, PearPC and SheepShaver) are horribly unstable or won't run MacOS at all. The best solution so far is the OSX Intel + Qemu PPC emulator + Linux PPC + GCC 3.x.x = slightly faster than my old PPC machine.

So is there any ability in Xcode to access Rosetta for cross compiling or some other sort of thing? Or perhaps something under X11?

Mac Mini (Intel) 1.66 GHz, 2 GB RAM, Mac OS X (10.4.11)

Posted on Nov 16, 2007 2:01 PM

Reply
Question marked as Best reply

Posted on Nov 17, 2007 4:34 AM

Wow, you're complicating your life for nothing...
You don't need any emulator to compile for another kind of processor, GCC does it since the beginning, you just need to set up the good options.
What Xcode does is cross-compiling for Mac OS X PPC and Mac OS X Intel, it helps you to choose between those two, but for application that uses Apple frameworks.
For command line tools or non-Cocoa/Carbon applications, you just have to put the right flags in GCC, I think you can even do that in Xcode without using Apple's feature.

Look at GCC manual, you'll see architecture options and all the processors supported, which means, all the processor GCC can compile for whichever architecture it's running on.
3 replies
Question marked as Best reply

Nov 17, 2007 4:34 AM in response to Aletheianalex

Wow, you're complicating your life for nothing...
You don't need any emulator to compile for another kind of processor, GCC does it since the beginning, you just need to set up the good options.
What Xcode does is cross-compiling for Mac OS X PPC and Mac OS X Intel, it helps you to choose between those two, but for application that uses Apple frameworks.
For command line tools or non-Cocoa/Carbon applications, you just have to put the right flags in GCC, I think you can even do that in Xcode without using Apple's feature.

Look at GCC manual, you'll see architecture options and all the processors supported, which means, all the processor GCC can compile for whichever architecture it's running on.

Nov 17, 2007 1:14 PM in response to PsychoH13

Thank you. This all started because all my GCC cross builds from Intel to 60x powerpc have failed. I tried re-building GCC from scratch with the newer 4.2.1 version, but after compiling for a few hours, the build failed because with an error and crash related to the ext2fs extension that I had installed (as a side note... is Apple planning to ever support ext2 filesystems?). So i will try building again after removing ext3fs and see what I can get to happen. I also found another open source compiler with Qemu as a backend, so I'll give that a try if GCC fails again.

Trying to cross compile for PowerPC on an Intel Mac...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.