Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-03

Cross compiling: "from linux to Darwin or Mac OS X"

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jonas Maebe
to Patrick Chevalley
Patrick Chevalley wrote
I try and give up.

It's indeed quite unfortunate that Apple's tool chain is not easily portable to other platforms. And since they regularly modify internal stuff (new sections/features/flags in object files, changes to the headers of binaries, ...), it's probably quite hard for external people to design and maintain their own (as is done for, e.g. Windows).

Jonas

Torsten Bonde Christiansen
to Patrick Chevalley: I try and give up. What I use now is a Mac virtual machine running on my Linux x64. It's…

I do already own a legit Mac mini so I have not problem compiling my code for Mac OS X. But the mini is not my primary machine and is actually only meant for testing puposes, so I wanted to create a setup on my primary PC (64-bit linux) that, using a script, can compiles and cross compiles for all of our supported OS and CPU targets.

Regards,
Torsten Bonde Christiansen.

Patrick Chevalley wrote 6 lines
I try and give up. What I use now is a Mac virtual machine running on my Linux x64. It's too bad you have to turn to the dark side of the Internet for instruction on how to do that.
Brad Campbell
to Torsten Bonde Christiansen
Torsten Bonde Christiansen wrote 5 lines
I do already own a legit Mac mini so I have not problem compiling my code for Mac OS X. But the mini is not my primary machine and is actually only meant for testing puposes, so I wanted to create a setup on my primary PC (64-bit linux) that, using a script, can compiles and cross compiles for all of our supported OS and CPU targets.

I cross compile from Linux to i386-Win32 / i386-Darwin / PowerPC-Darwin.

I've uploaded the tools I used to build the mac tool chain here : http://www.fnarfbargle.com/cross-tools

The trick was to use the binaries from odcctools-20060413.tar.bz2, but to link i386-Darwin I needed ld from odcctools-9.2-ld.tgz

I've had this working for over a year now, so the steps I used to build it are a little hazy, but from memory I built and installed the 2006 version of ocdtools, then I built the 9.2 version and manually copied just ld across.

I build against a copy of the 10.4 SDK (I installed Tiger on an old PPC box, then installed X-Code and copied the SDK across to my Linux build machine.

crossbuild.txt is the script I currently use to update my toolchains, so it contains the commands I use to build all versions of the compiler. In the comments at the top are the commands I used to build ocdtools.

Hope this helps.

Regards,
Brad

Dolphins are so intelligent that within a few weeks they can train Americans to stand at the edge of the pool and throw them fish.