在收到有关libgsl.so: File format not recognised
的错误后,我一直在尝试将x86 GNU科学库交叉编译为ARM架构,以便在我的Cyclone V FPGA上执行。我已经转到gsl-2.4
目录,然后运行./configure --build=x86_64-pc-linux-gnu --host=arm-linux-gnueabi --prefix=/usr/local/arm-linux
这似乎有效,并创建了makefile:
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabi
checking for arm-linux-gnueabi-gcc... arm-linux-gnueabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
...
...
config.status: creating utils/Makefile
config.status: creating vector/Makefile
config.status: creating wavelet/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
然而,当我在一段时间后运行make
时,命令停止并出现以下错误:
.libs/sasum.o: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:679: recipe for target 'libgslcblas.la' failed
make[2]: *** [libgslcblas.la] Error 1
make[2]: Leaving directory '/home/gsl-2.4/cblas'
Makefile:961: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/gsl-2.4'
Makefile:663: recipe for target 'all' failed
make: *** [all] Error 2
我尝试过使用像arm-linux-gnueabihf这样的其他工具链,结果相似。有没有人知道为什么会出现这些错误,或者我最终如何为ARM架构编译这个GSL库!
提前致谢
https://pastebin.com/S5HSqmT6:来自make CC的输出:..
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabi/5/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-armel-cross/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-armel-cross --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-armel-cross --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libgcj --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv5t --with-float=soft --disable-werror --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabi --program-prefix=arm-linux-gnueabi- --includedir=/usr/arm-linux-gnueabi/include
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9)
COMPILER_PATH=/usr/lib/gcc-cross/arm-linux-gnueabi/5/:/usr/lib/gcc-cross/arm-linux-gnueabi/5/:/usr/lib/gcc-cross/arm-linux-gnueabi/:/usr/lib/gcc-cross/arm-linux-gnueabi/5/:/usr/lib/gcc-cross/arm-linux-gnueabi/:/usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/bin/
LIBRARY_PATH=/usr/lib/gcc-cross/arm-linux-gnueabi/5/:/usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/lib/../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/lib/:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-shared' '-fPIC' '-D' 'PIC' '-O2' '-o' '.libs/libgslcblas.so.0.0.0' '-v' '-march=armv5t' '-mfloat-abi=soft' '-mtls-dialect=gnu'
/usr/lib/gcc-cross/arm-linux-gnueabi/5/collect2 -plugin /usr/lib/gcc-cross/arm-linux-gnueabi/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc-cross/arm-linux-gnueabi/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccdsl841.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -shared -X --hash-style=gnu --as-needed -m armelf_linux_eabi -z relro -o .libs/libgslcblas.so.0.0.0 /usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/lib/../lib/crti.o /usr/lib/gcc-cross/arm-linux-gnueabi/5/crtbeginS.o -L/usr/lib/gcc-cross/arm-linux-gnueabi/5 -L/usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/lib/../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/lib .libs/sasum.o .libs/saxpy.o .libs/scasum.o .libs/scnrm2.o .libs/scopy.o .libs/sdot.o .libs/sdsdot.o .libs/sgbmv.o .libs/sgemm.o .libs/sgemv.o .libs/sger.o .libs/snrm2.o .libs/srot.o .libs/srotg.o .libs/srotm.o .libs/srotmg.o .libs/ssbmv.o .libs/sscal.o .libs/sspmv.o .libs/sspr.o .libs/sspr2.o .libs/sswap.o .libs/ssymm.o .libs/ssymv.o .libs/ssyr.o .libs/ssyr2.o .libs/ssyr2k.o .libs/ssyrk.o .libs/stbmv.o .libs/stbsv.o .libs/stpmv.o .libs/stpsv.o .libs/strmm.o .libs/strmv.o .libs/strsm.o .libs/strsv.o .libs/dasum.o .libs/daxpy.o .libs/dcopy.o .libs/ddot.o .libs/dgbmv.o .libs/dgemm.o .libs/dgemv.o .libs/dger.o .libs/dnrm2.o .libs/drot.o .libs/drotg.o .libs/drotm.o .libs/drotmg.o .libs/dsbmv.o .libs/dscal.o .libs/dsdot.o .libs/dspmv.o .libs/dspr.o .libs/dspr2.o .libs/dswap.o .libs/dsymm.o .libs/dsymv.o .libs/dsyr.o .libs/dsyr2.o .libs/dsyr2k.o .libs/dsyrk.o .libs/dtbmv.o .libs/dtbsv.o .libs/dtpmv.o .libs/dtpsv.o .libs/dtrmm.o .libs/dtrmv.o .libs/dtrsm.o .libs/dtrsv.o .libs/dzasum.o .libs/dznrm2.o .libs/caxpy.o .libs/ccopy.o .libs/cdotc_sub.o .libs/cdotu_sub.o .libs/cgbmv.o .libs/cgemm.o .libs/cgemv.o .libs/cgerc.o .libs/cgeru.o .libs/chbmv.o .libs/chemm.o .libs/chemv.o .libs/cher.o .libs/cher2.o .libs/cher2k.o .libs/cherk.o .libs/chpmv.o .libs/chpr.o .libs/chpr2.o .libs/cscal.o .libs/csscal.o .libs/cswap.o .libs/csymm.o .libs/csyr2k.o .libs/csyrk.o .libs/ctbmv.o .libs/ctbsv.o .libs/ctpmv.o .libs/ctpsv.o .libs/ctrmm.o .libs/ctrmv.o .libs/ctrsm.o .libs/ctrsv.o .libs/zaxpy.o .libs/zcopy.o .libs/zdotc_sub.o .libs/zdotu_sub.o .libs/zdscal.o .libs/zgbmv.o .libs/zgemm.o .libs/zgemv.o .libs/zgerc.o .libs/zgeru.o .libs/zhbmv.o .libs/zhemm.o .libs/zhemv.o .libs/zher.o .libs/zher2.o .libs/zher2k.o .libs/zherk.o .libs/zhpmv.o .libs/zhpr.o .libs/zhpr2.o .libs/zscal.o .libs/zswap.o .libs/zsymm.o .libs/zsyr2k.o .libs/zsyrk.o .libs/ztbmv.o .libs/ztbsv.o .libs/ztpmv.o .libs/ztpsv.o .libs/ztrmm.o .libs/ztrmv.o .libs/ztrsm.o .libs/ztrsv.o .libs/icamax.o .libs/idamax.o .libs/isamax.o .libs/izamax.o .libs/xerbla.o -lm -soname libgslcblas.so.0 -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc-cross/arm-linux-gnueabi/5/crtendS.o /usr/lib/gcc-cross/arm-linux-gnueabi/5/../../../../arm-linux-gnueabi/lib/../lib/crtn.o
.libs/sasum.o: file not recognized: File format not recognised
collect2: error: ld returned 1 exit status
然后:
.libs/sasum.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped