Followed: http://wiki.osdev.org/How_to_develop_on_Mac_OS_X brew uninstall binutils lynx ftp://ftp.gnu.org/gnu/binutils/ lynx ftp://ftp.gnu.org/gnu/gcc/ tar zxvf binutils-2.28.tar.gz tar zxvf gcc-6.3.0.tar.gz cd gcc-6.3.0 contrib/download_prerequisites brew install gcc export CC=/usr/local/bin/gcc-6 export CXX=/usr/local/bin/g++-6 export CPP=/usr/local/bin/cpp-6 export LD=/usr/local/bin/gcc-6 export PREFIX="$HOME/opt/cross" export TARGET=i486-elf export PATH="$PREFIX/bin:$PATH" mkdir src mv binutils-2.28* src mv gcc-6.3.0* src cd src/ mkdir build-binutils cd build-binutils ../binutils-2.28/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror make make install which -- $TARGET-as || echo $TARGET-as is not in the PATH mkdir build-gcc cd build-gcc ../gcc-6.3.0/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers make all-gcc make all-target-libgcc make install-gcc make install-target-libgcc make CC=~/opt/cross/bin/i486-elf-gcc LD=~/opt/cross/bin/i486-elf-ld