Mac OS X cross toolchain for Linux, FreeBSD, OpenBSD and Android (Termux)
Go to file
Thomas Pöchtrager dc8c4719c3 enforce building gcc with clang - otherwise building gcc will fail (probably a configuration bug in gcc)
building gcc with gcc (targeting OS X on linux) causes the following errors:

error 1:

g++   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -static-libstdc++ -static-libgcc  -o xg++ \
          gcc.o ggc-none.o g++spec.o driver-i386.o darwin-driver.o libcommon-target.a \
           libcommon.a ../libcpp/libcpp.a   ../libbacktrace/.libs/libbacktrace.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a
/usr/bin/ld: unrecognised emulation mode: acosx_version_min
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om i386pep i386pe

error 2:

g++ -c  -DIN_GCC_FRONTEND -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace    cc1-checksum.c -o cc1-checksum.o
cc1plus: error: unrecognized command line option '-mmacosx-version-min=10.4'

after fixing the -mmacosx-version-min issue in the gcc/specs file, I get the following weird error (gmp is indeed installed):

g++ -c  -DIN_GCC_FRONTEND -g  -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace    cc1-checksum.c -o cc1-checksum.o
In file included from cc1-checksum.c:2:0:
../../gcc/system.h:641:17: fatal error: gmp.h: No such file or directory
 #include <gmp.h>

all these errors do not appear when clang is used for building gcc.
2014-03-26 20:29:50 +01:00
oclang support building a gcc as well 2014-03-26 20:29:50 +01:00
ogcc support building a gcc as well 2014-03-26 20:29:50 +01:00
patches support building a gcc as well 2014-03-26 20:29:50 +01:00
tarballs initial commit 2014-03-26 20:28:13 +01:00
AUTHORS initial commit 2014-03-26 20:28:13 +01:00
build_gcc.sh enforce building gcc with clang - otherwise building gcc will fail (probably a configuration bug in gcc) 2014-03-26 20:29:50 +01:00
build.sh fix cctools path in osxcross-conf 2014-03-26 20:29:50 +01:00
CHANGELOG support building a gcc as well 2014-03-26 20:29:50 +01:00
cleanup.sh initial commit 2014-03-26 20:28:13 +01:00
LICENSE initial commit 2014-03-26 20:28:13 +01:00
package.sh support building a gcc as well 2014-03-26 20:29:50 +01:00
README support building a gcc as well 2014-03-26 20:29:50 +01:00
README.gcc support building a gcc as well 2014-03-26 20:29:50 +01:00
TODO initial commit 2014-03-26 20:28:13 +01:00

- OSXCross: OS X cross toolchain for linux -

OSXCross is a tool which helps you to cross compile source code easily with clang on linux for OS X.

After the installation you will have "o32-clang", "o32-clang++", "o64-clang" and "o64-clang++" available as compiler.

You can optionally build an update-to-date gcc as well, please see README.gcc.

Make sure you have the following installed on your linux-system:

 Clang 3.2+, llvm-devel, automake, autogen, libtool,
 libxml2-devel, libuuid-devel, openssl-devel and the bash shell

Then edit TARGET and so on in build.sh, so it fits your requirements.

Then run

./build.sh

to build the OS X cross toolchain (it will guide you through the installation).


SDK Download:

 * Links:

 * Installation:
  -> Download the SDK to the tarballs/ directory and do not forget to adjust
  -> the SDK_VERSION in build.sh!


LICENSE:
 bash scripts: GPLv2
 cctools: APSL 2.0
 xar: New BSD


CREDITS:
 cjacker for the CCTOOLS linux port, checkout his ios-toolchain-based-on-clang-for-linux project:
 https://code.google.com/p/ios-toolchain-based-on-clang-for-linux