[LLVMdev] Cross compilation error LLVM-3.0

shivani malik malikkshivani at gmail.com
Mon Jan 23 12:44:06 PST 2012


Hi,

I am trying to cross compile LLVM-3.0 for Arm target i.e. I would like to
run the LLVM tools on ARM platform and generate the code for the ARM
platform. I configured the build with

../src/configure --build=i686-pc-linux-gnu --host=arm-linux-gnueabi
--target=arm-linux-gnueabi --enable-optimized=no
--prefix=/home/user/Acads/Compiler/LLVM/llvm-3.0/bin
--with-as=/usr/bin/arm-linux-gnueabi-as
--with-ld=/usr/bin/arm-linux-gnueabi-ld
--with-ar=/usr/bin/arm-linux-gnueabi-ar

and then fire the build with
make -j4.

However following error occurs while doing the build,

make[2]: Entering directory
`/home/user/Acads/Compiler/LLVM/llvm-3.0/build/tools/llvm-extract'
llvm[2]: Linking Debug executable llvm-extract

/usr/bin/ld:
/home/user/Acads/Compiler/LLVM/llvm-3.0/build/Debug/lib/libLLVMSupport.a(regcomp.o):
Relocations in generic ELF (EM: 40)
/home/user/Acads/Compiler/LLVM/llvm-3.0/build/Debug/lib/libLLVMSupport.a:
could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[2]: ***
[/home/user/Acads/Compiler/LLVM/llvm-3.0/build/Debug/bin/llvm-extract]
Error 1
make[2]: Leaving directory
`/home/user/Acads/Compiler/LLVM/llvm-3.0/build/tools/llvm-extract'
make[1]: *** [llvm-extract/.makeall] Error 2
make[1]: Leaving directory
`/home/user/Acads/Compiler/LLVM/llvm-3.0/build/tools'
make: *** [all] Error 1

------------------------------------------------------------------------------------------------------------------------------------------------------
Also, when I look into config.log, it shows configure statement two times -

Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.4.4-14ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.4 --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.4.5
--libdir=/usr/lib --enable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-objc-gc --disable-sjlj-exceptions
--with-arch=armv7-a --with-float=softfp --with-fpu=vfpv3-d16
--with-mode=thumb --disable-werror --enable-checking=release
--program-prefix=arm-linux-gnueabi-
--includedir=/usr/arm-linux-gnueabi/include --build=i686-linux-gnu
--host=i686-linux-gnu --target=arm-linux-gnueabi
--with-headers=/usr/arm-linux-gnueabi/include
--with-libs=/usr/arm-linux-gnueabi/lib
Thread model: posix

So here it has not configures host as arm-linux-gnueabi as specified by in
the configure command. For the other time this statement occurs,

Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.4.4-14ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.4 --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=i686-linux-gnu
--host=i686-linux-gnu --target=i686-linux-gnu

In this case, the target is also configured as i686.

Please help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120124/edcd63bd/attachment.html>


More information about the llvm-dev mailing list