User:Lionel/OSX

From OSDev.wiki
Revision as of 06:05, 4 January 2014 by Lionel (talk | contribs)
Jump to navigation Jump to search
This page is a work in progress.
This page may thus be incomplete. Its content may be changed in the near future.

Developing on Mac OSX is a pretty hard thing. Apple's toolchain is broken and will not create ELF executables, only MACH-O. This is problematic, so here I will list my experiences on trying to fix it or port stuff to OSX.

What this is NOT

This is NOT a roadmap on how to develop on OSX, but a list of experiences I had, and hint's and notes that might help you with OS Development. Feel free to contribute.

Porting

Clang

Clang is pretty easy to port. And I mean a full clang, not just the apple version. The apple version of clang appears to be able to only output Mach-O binaries, and ignores any options to create ELF output, or cross compile. However, building a full version of clang is pretty easy. You require Subversion and cmake. Apple make and binutils work well enough to produce a working binary. Just follow the tutorial on compiling clang.

libiconv

Building an updated version of libiconv was easy. Here's my process:

function grab () {
    echo "Pulling $1..."
    if [ ! -f "$3" ]; then
        wget "$2/$3"
    else
        echo "Already have $1"
    fi
} #Credit Kevin Lange (klange) for grab function
##TODO:COMPLETE