[LLVMdev] Building llvm-gcc with fortran support

Scott Ricketts sricketts at maxentric.com
Thu Aug 27 16:51:14 PDT 2009


I have been working successfully with llvm-gcc for some time now with
support for c/c++. Today I tried going back and reconfiguring and
rebuilding with support for fortran, and I am running into problems.

It seems ld cannot find -lffi. I am configuring like this:

/gro/pkg/src/llvm-gcc/configure --prefix=/pkg/bin/llvm-gcc
--program-prefix=llvm- --enable-llvm=/pkg/build/llvm
--enable-languages=c,c++,fortran

I then set LD_LIBRARY_PATH to include the path of the libs for
gcc-4.3.2, add that version of gcc to the PATH, and then run gmake
-j8.

Here is the error:

/pkg/build/llvm-gcc/./prev-gcc/xgcc -B/pkg/build/llvm-gcc/./prev-gcc/
-B/pkg/bin/llvm-gcc/x86_64-unknown-linux-gnu/bin/   -g -O2 -DIN_GCC
-W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings
-Wold-style-definition -Wmissing-format-attribute    -DHAVE_CONFIG_H
-o gfortran \
          gcc.o opts-common.o gcc-options.o gfortranspec.o version.o
prefix.o intl.o driver-i386.o  ../libcpp/libcpp.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a
-L/pkg/build/llvm/Debug/lib  -lpthread -lffi -ldl -lm -lelf
/usr/bin/ld: cannot find -lffi
collect2: ld returned 1 exit status
gmake[4]: *** [gfortran] Error 1



Actually, gcc 4.3.2 is in my path already (verified by gcc -v from a
fresh shell). And the appropriate library dirs are in /etc/ld.so.conf.
But it seems that the error is thrown by xgcc within the llvm-gcc
tree, which I guess is looking for libraries based on 4.2.1? I'm not
too familiar with the llvm-gcc or its build process.

I had actually been getting a similar error (cannot find -lffi)
previously when configuring and building without fortran enabled, and
it was fixed by adding all the seemingly unnecessary LD_LIBRARY_PATH
and PATH settings (considering that gcc 4.3.2 was already in my path).

Any insight here would be greatly appreciated.

Thanks,
Scott



More information about the llvm-dev mailing list