Notes on OS X

Richard W.M. Jones rjones at
Sun Feb 8 16:07:21 UTC 2009

Since I was bored this morning, I took a look at the feasibility of
cross-compiling to OS X as well.  Compiling Gtk programs from a single
source tree for the three major platforms (Linux, Windows, Mac OS X)
with just a handful of commands is ... compelling, isn't it?

Here are some notes.


This guy has built a cross-compiler for Darwin which seems like a
decent starting point:

I looked at the gcc 4.0, headers and odcc tools packages from the
above link.

His GCC package is a straightforward recompile of Apple's modified GCC
from here:

It is built as a cross-compiler for two targets (i386-apple-darwin8
and powerpc-apple-darwin8), with four compiler front-ends built for
each target (C, C++, Objective C and Objective C++).

Header files are supplied by another Apple package.  (I can't find a
direct link to these on Apple's site).  They are distributed under
APSL 2.0 license which is OK for Fedora but not GPL compatible.


odcctools is a project to extend Darwin cctools build system.
Includes assembler and static linker, and various tools to examine
Mach-O and fat binaries.

The darwin-cross project cross-compiles these using ordinary autoconf

Why doesn't he package binutils?

What about a dynamic linker?  Apple's is called "dyld" and the dynamic
libraries have the extension ".dylib".  dyld is released under the


libc?  glibc?  As on Windows, we have headers and so we don't need an
actual libc.

Apple supply various other libraries here, but we'd have to find out
what changes they had made and what the implications are:

Gtk+ for Mac OS X

Gtk+ for Mac OS X is a commercially-sponsored project to produce a
native port of Gtk+ to OS X.  This means it uses Quartz and doesn't
require X11 at runtime (but it doesn't use native widgets).  Another
good thing about this project is they are pushing their changes back
upstream into Gtk.

Here are (non-cross) build instructions:

There is also a separate "integration library" which provides some
extra APIs for making applications more native to OS X, and to support
special features like OS X preferences, menu bars, etc.

They also support pkg-config as a build framework:

Unfortunately they've gone and used their own build tool (so close and
yet so far!)


There is no way of running or emulating Mac OS X binaries on Fedora
(as with Wine / Windows).  Even virtualizing OS X itself is a
potential minefield.



Richard Jones, Emerging Technologies, Red Hat
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.

More information about the mingw mailing list