Hi,<br><br>I have been trying to figure this out for a long time and really need some help.<br>I am compiling C programs which uses some math functions (such as pow, ceil) into SPARC ISA, using llvm-gcc.<br>I imagine below is the right process:<br>
llvm-gcc -c -emit-llvm *.c <br>llvm-ld -lm *.bc -o test<br>llc -march=sparc test.bc -o test.s<br clear="all"><br>However when I look into test.s, I realized that those math functions are not linked in.<br>This can be also seen if I use "llc test.bc -o test.s" to generate the assembly for the local machine and run "gcc test.s", it will prompt the error saying that there are undefined reference to math functions. So the "-lm" option in llvm-ld really did not link the math functions.<br>
How could I link those math functions into the compiled assemblies?<br>Thanks.<br>-- <br>Xun Li<br>Computer Architecture Lab<br>Department of Computer Science<br>University of California, Santa Barbara<br>