Problem compiling llvm-gcc (needed for KLEE)


I'm having problems compiling
llvm-gcc-4.2-2.9 (from [1]). I need to use this version because I am
trying to use KLEE (see [3]) which needs these versions.
I am compiling on Arch Linux using gcc (GCC) 4.7.0 20120505 (prerelease)

the output of `gcc -v` can be found at

I have tried the following

1. Extracted llvm-2.9 (from [2])
2. Applied a patch (adds missing unistd.h include) as mentioned here
3. Now I compiled llvm-2.9 as follows

$ mkdir obj-llvm
$ cd obj-llvm
$ ../llvm-2.9/configure --enable-optimized
$ make -j4

The compilation was successful. Now I try to compile llvm-gcc-4.2-2.9

1. Extract llvm-gcc-4.2-2.9 (from [1])
2. Now try to compile as follows

$ mkdir obj-llvm-gcc
$ cd obj-llvm-gcc
$ ../llvm-gcc-4.2-2.9.source/configure
--disable-multilib --enable-languages=c,c++

The output of the configure step can be seen at [4]. Now I try to compile


The full compile output can be seen at [5]. But essentially the
compilation fails when the following command fails

-B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/x86_64-unknown-linux-gnu/include -isystem
/usr/local/x86_64-unknown-linux-gnu/sys-include -O2 -O2 -g -O2
-DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -isystem ./include -I.
-I. -I../../llvm-gcc-4.2-2.9.source/gcc
-I../../llvm-gcc-4.2-2.9.source/gcc/../libdecnumber -I../libdecnumber
-I/home/dan/documents/projects/llvm2.9/llvm-2.9/include -g0
-finhibit-size-directive -fno-inline-functions -fno-exceptions
-fno-zero-initialized-in-bss -fno-toplevel-reorder
-fno-omit-frame-pointer -fno-asynchronous-unwind-tables \
-c ../../llvm-gcc-4.2-2.9.source/gcc/crtstuff.c -DCRT_BEGIN \
-o crtbegin.o
/tmp/ccWAqtEK.s: Assembler messages:
/tmp/ccWAqtEK.s:36: Error: junk at end of line, first unrecognized
character is `"'
/tmp/ccWAqtEK.s:37: Error: bad expression
/tmp/ccWAqtEK.s:37: Error: junk at end of line, first unrecognized
character valued 0xffffffb0
make[3]: *** [crtbegin.o] Error 1

I decided to rerun as below to investigate the assembler.
$ make C_FLAGS=-save-temps

And indeed there appears to be junk on lines 36 and 37. I'm not an
expert on assembly but those characters do look odd. The files can be
seen at [6] and [7].

I have no idea why this is happening. I had a quick "google search"
and people who have come across this error seem to be trying to
cross-compile which I'm not doing here. My target and host should be
the same.

Does anyone have any idea why this happening and what I can do to fix it?

Dan Liew.