From dc8c4719c3990d142769f9b55057bfaa77b6d2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20P=C3=B6chtrager?= Date: Tue, 12 Nov 2013 18:14:54 +0100 Subject: [PATCH] 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 all these errors do not appear when clang is used for building gcc. --- build_gcc.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build_gcc.sh b/build_gcc.sh index 1710931..cd668f3 100755 --- a/build_gcc.sh +++ b/build_gcc.sh @@ -3,6 +3,9 @@ export LC_ALL="C" export LIBRARY_PATH="" +export CC=clang +export CXX=clang++ + which osxcross-conf || { echo "you need to complete ./build.sh first, before you can start building gcc" exit 1 @@ -13,7 +16,7 @@ eval `osxcross-conf` set -e # How many concurrent jobs should be used for compiling? -JOBS=`grep -c ^processor /proc/cpuinfo` +JOBS=4 #`grep -c ^processor /proc/cpuinfo` # GCC version to build GCC_VERSION=4.8.2