Bug 49228

Summary: gcc fails to compile on darwin (with lto)
Product: gcc Reporter: vincenzo Innocente <vincenzo.innocente>
Component: bootstrapAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 4.7.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:

Description vincenzo Innocente 2011-05-30 08:39:02 UTC
compiling gcc on darwin stops at
/Users/innocent/RealStuff/gcc-4.7-20110528/host-x86_64-apple-darwin10.7.0/prev-gcc/xgcc -B/Users/innocent/RealStuff/gcc-4.7-20110528/host-x86_64-apple-darwin10.7.0/prev-gcc/ -B/usr/local/x86_64-apple-darwin10.7.0/bin/ -B/usr/local/x86_64-apple-darwin10.7.0/bin/ -B/usr/local/x86_64-apple-darwin10.7.0/lib/ -isystem /usr/local/x86_64-apple-darwin10.7.0/include -isystem /usr/local/x86_64-apple-darwin10.7.0/sys-include    -c  -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -g -O2 -mdynamic-no-pic -flto=jobserver -frandom-seed=1 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes  -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -Ic-family -I../.././gcc -I../.././gcc/c-family -I../.././gcc/../include -I./../intl -I../.././gcc/../libcpp/include  -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/dpd -I../libdecnumber    ../.././gcc/c-family/c-common.c -o c-family/c-common.o
/var/folders/Ur/UrR7agy72RWuJU+BYnMxQU+++TQ/-Tmp-//ccISnqXM.s:287338:FATAL:too many sections (maximum 255)


/Users/innocent/RealStuff/gcc-4.7-20110528/host-x86_64-apple-darwin10.7.0/prev-gcc/xgcc -v
Using built-in specs.
COLLECT_GCC=/Users/innocent/RealStuff/gcc-4.7-20110528/host-x86_64-apple-darwin10.7.0/prev-gcc/xgcc
Target: x86_64-apple-darwin10.7.0
Configured with: ./configure --enable-languages=c,c++,fortran --enable-lto --with-build-config=bootstrap-lto CFLAGS='-O2 -ftree-vectorize -fPIC' CXXFLAGS='-O2 -fPIC -ftree-vectorize -fvisibility-inlines-hidden'
Thread model: posix
gcc version 4.7.0 20110528 (experimental) (GCC) 

it is the first time I try lto on MAC 
removing -flto compile
Comment 1 Dominique d'Humieres 2011-05-30 09:11:59 UTC
This is a duplicate of pr48086. If you want to use lto on darwin, you have to revert to Xcode 3.2.5 or try the patch in http://gcc.gnu.org/ml/gcc-testresults/2011-03/msg01695.html (see pr48108).

*** This bug has been marked as a duplicate of bug 48086 ***
Comment 2 Dominique d'Humieres 2011-05-30 09:28:50 UTC
If you want to keep most of Xcode 3.2.6, but live dangerously with lto, you can also do what I have done: i.e., replace

Apple Inc version cctools-795~45, GNU assembler version 1.38

of 3.2.6 with

Apple Inc version cctools-782~33, GNU assembler version 1.38

 from 3.2.5. The relevant beasts are in /usr/libexec/gcc/darwin/x86_64 and /usr/libexec/gcc/darwin/i386/. Use at your own risk!-)