[LLVMdev] mixed bc file
小林
chongzhilin at 163.com
Mon Oct 20 00:23:21 PDT 2008
I have a question with llvm-gcc and llvm-gfortran.
Is it possible that llvm-ld can combine different bc files compiled from C programme and Fortran Programme together?
For example:
Compile a c program into llvm bc file by the task:
# llvm-gcc -emit-llvm test.c -c -o test.bc
and then compile a fortran program into llvm bc file by the task:
# llvm-gfortran -emit-llvm testf.f -c -o testf.bc
And then use llvm-ld to combine two bc files into a single bc file as follows:
# llvm-ld test.bc testf.bc -o testp.bc
# ./testp.bc
ERROR: Program used external function '_gfortran_st_write' which could not be resolved!
lli[0x85c245f]
/lib/libc.so.6(abort+0x101)[0x6988b1]
lli(_ZN4llvm3JIT25getPointerToNamedFunctionERKSs+0xd2)[0x8267952]
Aborted
I have also tried to link gfortran dynamic libraries like this and here is a error message:
# llvm-ld test.bc testf.bc -lgfortran
llvm-ld: error: Cannot find library 'gfortran'
Note:gcc can find library 'gfortran'.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081020/27a83930/attachment.html>
More information about the llvm-dev
mailing list