[LLVMdev] using llvm-ld with existing libraries
Jack Howarth
howarth at bromo.msbb.uc.edu
Mon Dec 31 16:47:13 PST 2007
I am seeing the same problems using 'llvm-ld' with llvm-gcc
at -O4 on x86_64 Fedora 8 linux as on Darwin. Another example
of this is building the scimark2_1c benchmark...
http://math.nist.gov/scimark2/download_c.html
as follows on x86_64 Fedora 8...
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c FFT.c
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c kernel.c
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c Stopwatch.c
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c Random.c
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c SOR.c
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c SparseCompRow.c
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c array.c
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c MonteCarlo.c
/home/howarth/llvm-gcc42-work/bin/gcc -O4 -m64 -c LU.c
/home/howarth/llvm-gcc42-work/bin/llvm-ld -O4 -native -o scimark2 scimark2.o FFT.o kernel.o Stopwatch.o Random.o SOR.o SparseCompRow.o array.o MonteCarlo.o LU.o /usr/lib64/libm.so
/usr/lib/../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
llvm-ld:
make: *** [scimark2] Error 1
This is identical to what I see on Darwin...
llvm-ld -native -O4 -o scimark2 scimark2.o FFT.o kernel.o Stopwatch.o Random.o SOR.o SparseCompRow.o array.o MonteCarlo.o LU.o -lm
llvm-ld: warning: Ignoring file 'scimark2.o' because does not contain bitcode.
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
llvm-ld:
make: *** [scimark2] Error 1
How are people testing code at -O4 if the existing linkers can't use any
pre-existing system libraries? Thanks in advance for any clarifications.
Jack
More information about the llvm-dev
mailing list