[LLVMdev] Is -m32 supported by llvm-gcc when using LTO/gold?

Luke Dalessandro luked at cs.rochester.edu
Mon Aug 30 09:43:24 PDT 2010

I have gold from cvs, and llvm-gcc/llvm from svn. My platform is
Ubuntu 9.04 x86_64. I've configured llvm-gcc with "--enable-multilib".

When compiling the LTO example from
http://llvm.org/docs/LinkTimeOptimization.html I have no problems with
64-bit compilation, but get the following with -m32.

luked at node:~/tests/lto$ make USE32=1
llvm-gcc -m32   -c -o main.o main.c
llvm-gcc -m32 --emit-llvm   -c -o a.o a.c
ar q a.a a.o
ar: creating a.a
llvm-gcc -m32 -use-gold-plugin  main.o a.a   -o main
error: /tmp/llvmgold.o: incompatible target
main.o: in function main:main.c(.text+0x27): error: undefined
reference to 'foo1'
collect2: ld returned 1 exit status
make: *** [main] Error 1

The specific binutils and llvm-gcc/llvm version details follow. Is
-m32 supposed to be supported here, or is it not yet possible to use
LTO/gold for this target?



luked at node:~/tests/lto$ ld -v
GNU gold (GNU Binutils 1.10

luked at node:~/tests/lto$ llvm-gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/home/luked/local
--enable-llvm=/home/luked/local --program-prefix=llvm-
--enable-languages=c,c++ --enable-multilib : (reconfigured)
../configure --prefix=/home/luked/local
--enable-llvm=/home/luked/local --program-prefix=llvm-
--enable-languages=c,c++ --enable-multilib
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build)

luked at node:~/tests/lto$ llc --version
Low Level Virtual Machine (http://llvm.org/):
 llvm version 2.8svn
 Optimized build with assertions.
 Built Aug 30 2010 (11:10:38).
 Host: x86_64-unknown-linux-gnu
 Host CPU: corei7

 Registered Targets:
   alpha   - Alpha [experimental]
   arm     - ARM
   bfin    - Analog Devices Blackfin [experimental]
   c       - C backend
   cellspu - STI CBEA Cell SPU [experimental]
   cooper  - PIC16 Cooper [experimental]
   cpp     - C++ backend
   mblaze  - MBlaze
   mips    - Mips
   mipsel  - Mipsel
   msp430  - MSP430 [experimental]
   pic16   - PIC16 14-bit [experimental]
   ppc32   - PowerPC 32
   ppc64   - PowerPC 64
   sparc   - Sparc
   sparcv9 - Sparc V9
   systemz - SystemZ
   thumb   - Thumb
   x86     - 32-bit X86: Pentium-Pro and above
   x86-64  - 64-bit X86: EM64T and AMD64
   xcore   - XCore

More information about the llvm-dev mailing list