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:
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.
32crtbegin.S (2.04 KB)
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.
you can try to configure with the following
pwd…/install --enable-optimized --enable-jit --enable-targets=host-only
pwd…/install --program-prefix=llvm- --enable-llvm=/home/warren/llvm/obj/ --enable-languages=c,c++ --disable-shared --disable-multilib
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.
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
Bill Wendling wrote:
Yes, that worked. Thanks!
Ferad Zyulkyarov wrote: