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.
This commit is contained in:
Thomas Pöchtrager 2013-11-12 18:14:54 +01:00
parent 9c5a089a7f
commit dc8c4719c3

View File

@ -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