problem building gcc4 front end on fedora core 5

I'm getting a build error when trying to build gcc4 from sources. This is
for the recent 1.9 release.

How I built llvm-1.9:

Hi Ram,

I'm getting a build error when trying to build gcc4 from sources. This is
for the recent 1.9 release.

How I built llvm-1.9:
-----------------------------
tar zxf llvm-1.9.tar.gz
cd llvm-1.9/
./configure --prefix=/custom/llvm-1.9
make ENABLE_OPTIMIZED=1 OPTIMIZE_OPTION='-O2' tools-only
make install

Looks good.

How I built gcc4:
-----------------------------
export PATH=/custom/llvm-1.9/bin:.../llvm-1.9/Release/bin:$PATH

Note that you're putting both the built and the installed executables in
the path here. Probably isn't a problem, but not many of us do that.

tar zxf llvm-gcc4-1.9.source.tar.gz
mkdir llvm-gcc4-1.9.build
cd llvm-gcc4-1.9.build

../llvm-gcc4-1.9.source/configure --prefix=/custom/llvm-1.9-gcc4
--enable-languages=c,c++ --enable-checking --with-llvm=...../llvm-1.9
--disable-threads --program-prefix=llvm-

Try --disable-shared. Sometimes linking the wrong libgcc.so or libstdc
++.so can produce the error you got below.

make

-------------------

This results in the following error:

/bulk/src/LLVM/llvm-gcc-build/gcc/xgcc
-B/bulk/src/LLVM/llvm-gcc-build/gcc/
-B/custom/llvm-1.9-gcc4/i686-pc-linux-gnu/bin/
-B/custom/llvm-1.9-gcc4/i686-pc-linux-gnu/lib/ -isystem
/custom/llvm-1.9-gcc4/i686-pc-linux-gnu/include -isystem
/custom/llvm-1.9-gcc4/i686-pc-linux-gnu/sys-include -O2 -DIN_GCC
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -isystem ./include -fPIC -g -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -I. -I. -I../../llvm-gcc4-1.9.source/gcc
-I../../llvm-gcc4-1.9.source/gcc/.
-I../../llvm-gcc4-1.9.source/gcc/../include
-I../../llvm-gcc4-1.9.source/gcc/../libcpp/include -DL_mulvdi3
-fvisibility=hidden -DHIDE_EXPORTS -c
../../llvm-gcc4-1.9.source/gcc/libgcc2.c -o libgcc/./_mulvdi3.o
../../llvm-gcc4-1.9.source/gcc/libgcc2.c:403: internal compiler error:
in prune_unused_types_update_strings, at dwarf2out.c:14372

Not sure what the problem is but this is failing very early. mulvdi3.o
is one of the first things built in the libgcc library. The xgcc
compiler is really llvm-gcc4. We won't be able to do much on this
without a backtrace. To get one, please do the following:

1. Run the xgcc command above with the -v option.
2. Capture the cc1 command options that xgcc spawns.
3. gdb the cc1 and run it with the options captured in step 2
4. When it fails, type "where" and capture the output
5. Open a bug report at http://llvm.org/bugs/ and attach this message
and the backtrace.

Reid.

There was a patch that went thru for this recently from Rafael Espindola. The fix is on the mirror.

Index: gcc/dwarf2out.c

Thank you!

This did the trick.

-Ram