llvm-gcc fails to build on REL5.1 Linux and Intel x86_64

While attempting to compile llvm-gcc on Intel x86_64 2-way 4-core machine, i got the following errors:
configure line i used is:
…/llvm-gcc4.2-2.5.source/configure --enable-llvm=pwd/…/…/llvm-2.5 --program-prefix=llvm- --enable-languages=c,c++ --host=x86_64-redhat-linux --build=x86_64-redhat-linux --disable-multilib --disable-shared

Errors:
lvm-gcc4.2-2.5.source/gcc/. -I…/…/llvm-gcc4.2-2.5.source/gcc/…/include -I…/…/llvm-gcc4.2-2.5.source/gcc/…/libcpp/include -I…/…/llvm-gcc4.2-2.5.source/gcc/…/libdecnumber -I…/libdecnumber -I/home/huyabin/llvm/llvm-gcc/obj/…/…/llvm-2.5/include -I/home/huyabin/llvm/llvm-2.5/include -fexceptions -c …/…/llvm-gcc4.2-2.5.source/gcc/unwind-dw2.c -o libgcc/./unwind-dw2.o
cc1: /home/huyabin/llvm/llvm-2.5/include/llvm/Transforms/Utils/InlineCost.h:44: llvm::InlineCost::InlineCost(int, int): Assertion Cost == C && "Cost exceeds InlineCost precision"' failed. ../../llvm-gcc4.2-2.5.source/gcc/unwind-dw2.c:1527: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <[URL:http://developer.apple.com/bugreporter](http://developer.apple.com/bugreporter)> for instructions. make[4]: *** [libgcc/./unwind-dw2.o] Error 1 make[4]: Leaving directory /home/huyabin/llvm/llvm-gcc/obj/gcc’
make[3]: *** [stmp-multilib] Error 2
make[3]: Leaving directory /home/huyabin/llvm/llvm-gcc/obj/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory /home/huyabin/llvm/llvm-gcc/obj’
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/huyabin/llvm/llvm-gcc/obj’
make: *** [all] Error 2

My gcc version is
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: …/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)

my cpu is
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Xeon(R) CPU E5310 @ 1.60GHz
stepping : 7
cpu MHz : 1595.956
cache size : 4096 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu tsc msr pae mce cx8 apic mtrr mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx tm2 cx16 xtpr lahf_lm
bogomips : 3991.95
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

can somebody helps? Thanks a lot!
i can’t update my gcc right now, for someone else is also running other tests on the same machine.

Yabin

Hello

Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)

gcc 4.1.2 is usually known to be broken. Please try newer (or older)
version. 4.2.x should work fine.

Hi,

While attempting to compile llvm-gcc on Intel x86_64 2-way 4-core machine,
i got the following errors:

this is the second report of this, see http://llvm.org/bugs/show_bug.cgi?id=3710

gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)

gcc 4.1 has endless problems compiling LLVM, see
http://llvm.org/docs/GettingStarted.html#brokengcc

Here's an extract:

GCC 4.1.1: GCC fails to build LLVM with template concept check errors compiling some files. At the time of this writing, GCC mainline (4.2) did not share the problem.
GCC 4.1.1 on X86-64/amd64: GCC miscompiles portions of LLVM when compiling llvm itself into 64-bit code. LLVM will appear to mostly work but will be buggy, e.g. failing portions of its testsuite.
GCC 4.1.2 on OpenSUSE: Seg faults during libstdc++ build and on x86_64 platforms compiling md5.c gets a mangled constant.
GCC 4.1.2 (20061115 (prerelease) (Debian 4.1.1-21)) on Debian: Appears to miscompile parts of LLVM 2.4. One symptom is ValueSymbolTable complaining about symbols remaining in the table on destruction.
GCC 4.1.2 20071124 (Red Hat 4.1.2-42): Suffers from the same symptoms as the previous one. It appears to work with ENABLE_OPTIMIZED=0 (the default).

Try building with gcc-4.2 or newer.

Ciao,

Duncan.

Thanks a lot!

2009/3/4 Duncan Sands <baldrick@free.fr>