Problems compiling llvm-gcc4 frontend on x86_64

Hi all,

I've run into problems compiling the llvm-gcc frontend on x86_64. Is this
not supported, or am I making an error somewhere?

The procedure I followed was:

1. Download LLVM 2.0 source as a tarball (from a few days ago, during
the testing phase).
2. Download the llvm-gcc4 source today, as a tarball.
3. Extract both.

4. Configure LLVM as: ../src/configure --prefix=`pwd`../install
--enable-optimized --enable-jit --enable-targets=host-only
(There is no llvm-gcc in the path)
5. make ENABLE_OPTIMIZED=1

6. Configure the frontend as:
../llvm-gcc4-2.0.source/configure --prefix=`pwd`../install
--program-prefix=llvm- --enable-llvm=/home/warren/llvm/obj/
--enable-languages=c,c++ --disable-shared

7. make LLVM_VERSION_INFO=2.0

This produced errors from the assembler. I reran the failing command
with -v, and got the output below.
I then changed the command to use -S instead of -c, the resulting
assembler is attached.

Any advice gratefully received.

Cheers,
Warren

32crtbegin.S (2.04 KB)

Hi Warren,

You have the -m32 flag set, but it's still giving you this:

Warning: Generation of 64-bit code for a 32-bit processor requested.
Warning: 64-bit processors all have at least SSE2.

But are you sure you want to compile the LLVM-GCC source? You should use the binaries unless absolutely necessary.

-bw

Hi Warren,
you can try to configure with the following

export CFLAGS="-m64"
export LDFLAGS="-L/usr/lib64"

LLVM:
…/src/configure --prefix=pwd…/install --enable-optimized --enable-jit --enable-targets=host-only
make

LLVM-GCC:
…/llvm-gcc4-2.0.source/configure --prefix=pwd…/install --program-prefix=llvm- --enable-llvm=/home/warren/llvm/obj/ --enable-languages=c,c++ --disable-shared --disable-multilib

make

Sometimes the gcc you use to compile matters. I wasn’t able to compile with 4.1.* for example. I use 4.0.4 right now.

Regards,
Ferad Zyulkyarov

Hi Bill,

I didn't explicitly set -m32, but I tried redoing things with -m64, and
everything works fine.

The reason I was using the source version is that I was running into the
same sort of error when trying to compile C code - my simple Hello World
C program was failing to compile, with error messages from the assembler
similar to those reported below. When I passed -v to llvm-gcc, it
reported that it was configured for x86, but the local assembler (gnu
as) was configured for x86_64 - I thought there might be a mismatch
there. Hence I decided to try with a copy of llvm-gcc configured for
x86_64.

Cheers,
Warren

Bill Wendling wrote:

Hi Ferad,

Yes, that worked. Thanks!

Cheers,
Warren

Ferad Zyulkyarov wrote: