Libtool 声称它在交叉编译期间不支持共享库 [英] Libtool claims it does not support shared libraries during cross compilation

查看:21
本文介绍了Libtool 声称它在交叉编译期间不支持共享库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为运行 busybox 1.13 的 ARM 嵌入式机器构建 expat (2.0.0) XML 解析库,并且在 ./configure 期间,我收到错误:

正在检查 libtool 是否支持共享库... 否

我已经指定了我的 gcc、g++、ar、ranlib、strip 等,这些都可以通过配置工具找到,并且我已经运行了最新的 libtool(在撰写本文时为 2.4.2)在 Ubuntu 12.10 上,为什么说 libtool 不支持共享库?我的配置命令是:

./configure --host=arm --enable-shared CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ AR=arm-none-linux-gnueabi-ar RANLIB=arm-none-linux-gnueabi-ranlib STRIP=arm-none-linux-gnueabi-strip

... 调用的完整输出是:

 配置:警告:如果你想设置--build 类型,不要使用--host.如果检测到交叉编译器,则将使用交叉编译模式.检查构建系统类型... i686-pc-linux-gnu检查主机系统类型... arm-unknown-none检查 arm-gcc... arm-none-linux-gnueabi-gcc检查 C 编译器默认输出文件名... a.out检查 C 编译器是否工作...是的检查我们是否正在交叉编译...是的检查可执行文件的后缀...检查目标文件的后缀... o检查我们是否正在使用 GNU C 编译器...是检查 arm-none-linux-gnueabi-gcc 是否接受 -g... 是检查 arm-none-linux-gnueabi-gcc 选项以接受 ANSI C... 不需要检查不截断输出的 sed.../bin/sed检查 egrep ... grep -E检查 arm-none-linux-gnueabi-gcc 使用的 ld.../usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld检查链接器 (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) 是否为 GNU ld...是检查/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld 选项以重新加载目标文件... -r检查与 BSD 兼容的 nm... nm检查 ln -s 是否有效...是的检查如何识别依赖库...未知检查如何运行 C 预处理器... arm-none-linux-gnueabi-gcc -E检查 ANSI C 头文件...是检查 sys/types.h ... 是检查 sys/stat.h ... 是的检查 stdlib.h ... 是的检查 string.h ... 是的检查内存.h...是的检查字符串.h ...是的检查 inttypes.h ... 是的检查 stdint.h ... 是的检查 unistd.h ... 是的检查 dlfcn.h 可用性...是的检查 dlfcn.h 的存在...是的检查 dlfcn.h ... 是的检查 arm-g++... arm-none-linux-gnueabi-g++检查我们是否正在使用 GNU C++ 编译器...是检查 arm-none-linux-gnueabi-g++ 是否接受 -g... 是检查如何运行 C++ 预处理器... arm-none-linux-gnueabi-g++ -E检查 arm-g77... 否检查 arm-f77... 否检查 arm-xlf ... 否检查 arm-frt... 不检查 arm-pgf77... 否检查 arm-fort77 ... 否检查 arm-fl32... 否检查 arm-af77... 否检查 arm-f90... 否检查 arm-xlf90... 否检查 arm-pgf90... 否检查 arm-epcf90... 否检查 arm-f95... 否检查 arm-fort... 不检查 arm-xlf95... 否检查 arm-ifc... 否检查 arm-efc... 否检查 arm-pgf95... 否检查 arm-lf95... 否检查 arm-gfortran ... 否检查 g77...没有检查 f77... 否检查 xlf ... 没有检查frt...没有检查 pgf77 ... 没有检查 fort77... 没有检查 fl32... 否检查 af77...没有检查 f90... 否检查 xlf90... 否检查 pgf90... 没有检查 epcf90... 否检查 f95... 否检查堡垒...不检查 xlf95... 否检查 ifc... 否检查 efc... 否检查 pgf95... 没有检查 lf95... 否检查 gfortran ......没有检查我们是否正在使用 GNU Fortran 77 编译器...没有检查是否接受 -g... 否检查命令行参数的最大长度... 32768检查命令以解析来自 arm-none-linux-gnueabi-gcc 对象的 nm 输出......好的检查 objdir....libs检查 arm-ar... arm-none-linux-gnueabi-ar检查 arm-ranlib... arm-none-linux-gnueabi-ranlib检查 arm-strip... arm-none-linux-gnueabi-strip检查 arm-none-linux-gnueabi-gcc 是否支持 -fno-rtti -fno-exceptions... 不检查 arm-none-linux-gnueabi-gcc 选项以生成 PIC... -fPIC检查 arm-none-linux-gnueabi-gcc PIC 标志 -fPIC 是否有效...是的检查 arm-none-linux-gnueabi-gcc 静态标志 -static 是否有效...是的检查 arm-none-linux-gnueabi-gcc 是否支持 -c -o file.o ... 是检查 arm-none-linux-gnueabi-gcc 链接器 (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) 是否支持共享库...是检查 -lc 是否应显式链接到... 否检查动态链接器特性...没有检查如何将库路径硬编码到程序中......立即检查是否可以剥离库...是的检查 libtool 是否支持共享库...不检查是否构建共享库...否检查是否构建静态库...是配置:创建libtool将配置标签CXX"附加到 libtool检查 arm-none-linux-gnueabi-g++ 使用的 ld.../usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld检查链接器 (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) 是否为 GNU ld...是检查 arm-none-linux-gnueabi-g++ 链接器 (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) 是否支持共享库...不检查 arm-none-linux-gnueabi-g++ 选项以生成 PIC... -fPIC检查 arm-none-linux-gnueabi-g++ PIC 标志 -fPIC 是否有效...是的检查 arm-none-linux-gnueabi-g++ 静态标志 -static 是否有效...是的检查 arm-none-linux-gnueabi-g++ 是否支持 -c -o file.o ... 是检查 arm-none-linux-gnueabi-g++ 链接器 (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) 是否支持共享库...不检查动态链接器特性...没有检查如何将库路径硬编码到程序中......立即将配置标签F77"附加到 libtool检查 arm-gcc ...(缓存) arm-none-linux-gnueabi-gcc检查我们是否正在使用 GNU C 编译器...(缓存)是检查 arm-none-linux-gnueabi-gcc 是否接受 -g...(缓存)是检查 arm-none-linux-gnueabi-gcc 选项以接受 ANSI C...(缓存)不需要检查 BSD 兼容的安装.../usr/bin/install -c检查 gcc 是否接受 -fexceptions ... 是检查 ANSI C 头文件...(缓存)是检查字节顺序是否是 bigendian ... 否检查符合 ANSI C 的常量...是的检查 size_t ... 是检查 memmo... 是的检查 bcopy...是的检查 fcntl.h 可用性...是的检查 fcntl.h 的存在...是的检查 fcntl.h ... 是的检查 unistd.h...(缓存)是检查 off_t ... 是的检查 stdlib.h...(缓存)是检查 unistd.h...(缓存)是检查 getpagesize ... 是的检查工作 mmap... 否检查符合 ANSI C99 的 __func__... 是配置:创建 ./config.statusconfig.status: 正在创建 Makefileconfig.status: 创建 expat_config.hamarshall3@pg-oj-amarshall3:~/Sandbox/expat-2.0.0$ make/bin/bash ./libtool --silent --mode=compile arm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o lib/xmlparse.lo -c lib/xmlparse.c/bin/bash ./libtool --silent --mode=compile arm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o lib/xmltok.lo -c lib/xmltok.c/bin/bash ./libtool --silent --mode=compile arm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o lib/xmlrole.lo -c lib/xmlrole.c/bin/bash ./libtool --silent --mode=link arm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -no-undefined -version-info 6:0:5 -rpath/usr/local/lib -o libexpat.la lib/xmlparse.lo lib/xmltok.lo 库/xmlrole.loarm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o xmlwf/xmlwf.o -c xmlwf/xmlwf.carm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o xmlwf/xmlfile.o -c xmlwf/xmlfile.carm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o xmlwf/codepage.o -c xmlwf/codepage.carm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o xmlwf/readfilemap.o -c xmlwf/readfilemap.cxmlwf/readfilemap.c:在函数filemap"中:xmlwf/readfilemap.c:65:警告:函数read"的隐式声明xmlwf/readfilemap.c:69:警告:函数close"的隐式声明/bin/bash ./libtool --silent --mode=link arm-none-linux-gnueabi-gcc -I./lib -I.-g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o xmlwf/xmlwf xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/readfilemap.o libexpat.la

谁能给我解释一下 configure 如何确定 libtool 是否支持构建共享库?

解决方案

来自输出:

<前>检查构建系统类型... i686-pc-linux-gnu检查主机系统类型... arm-unknown-none...检查 arm-none-linux-gnueabi-gcc 链接器 (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) 是否支持共享库...是...检查 libtool 是否支持共享库...不检查是否构建共享库...否检查是否构建静态库...是

可能 libtool 被您的主机标志混淆了:--host=arm,对于 libtool 来说,它与 --host=arm-unknown-none 相同.尝试 --host=arm-none-linux 代替.IIRC,arm-unknown-none 被那些想要为 MCU 和其他没有操作系统且所有东西都静态链接到图像的嵌入式板做非 RTOS(主循环)类型的东西的人使用.您的工具链是为 Linux 构建的:arm-none-linux.

I'm attempting to build the expat (2.0.0) XML parsing library for an ARM embedded machine running busybox 1.13, and during the ./configure, I get the error:

checking if libtool supports shared libraries... no

I've specified my gcc, g++, ar, ranlib, strip, etc and those all get found by the configure tool, and I've got the very latest libtool (2.4.2 at the time of this writing) running on Ubuntu 12.10, so why is it saying that libtool doesn't support shared libraries ? My configure command is :

./configure --host=arm --enable-shared CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ AR=arm-none-linux-gnueabi-ar RANLIB=arm-none-linux-gnueabi-ranlib STRIP=arm-none-linux-gnueabi-strip

... and the complete output of the call is :

    configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-none
checking for arm-gcc... arm-none-linux-gnueabi-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... yes
checking for arm-none-linux-gnueabi-gcc option to accept ANSI C... none needed
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by arm-none-linux-gnueabi-gcc... /usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld
checking if the linker (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes
checking for /usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld option to reload object files... -r
checking for BSD-compatible nm... nm
checking whether ln -s works... yes
checking how to recognise dependent libraries... unknown
checking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for arm-g++... arm-none-linux-gnueabi-g++
checking whether we are using the GNU C++ compiler... yes
checking whether arm-none-linux-gnueabi-g++ accepts -g... yes
checking how to run the C++ preprocessor... arm-none-linux-gnueabi-g++ -E
checking for arm-g77... no
checking for arm-f77... no
checking for arm-xlf... no
checking for arm-frt... no
checking for arm-pgf77... no
checking for arm-fort77... no
checking for arm-fl32... no
checking for arm-af77... no
checking for arm-f90... no
checking for arm-xlf90... no
checking for arm-pgf90... no
checking for arm-epcf90... no
checking for arm-f95... no
checking for arm-fort... no
checking for arm-xlf95... no
checking for arm-ifc... no
checking for arm-efc... no
checking for arm-pgf95... no
checking for arm-lf95... no
checking for arm-gfortran... no
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse nm output from arm-none-linux-gnueabi-gcc object... ok
checking for objdir... .libs
checking for arm-ar... arm-none-linux-gnueabi-ar
checking for arm-ranlib... arm-none-linux-gnueabi-ranlib
checking for arm-strip... arm-none-linux-gnueabi-strip
checking if arm-none-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for arm-none-linux-gnueabi-gcc option to produce PIC... -fPIC
checking if arm-none-linux-gnueabi-gcc PIC flag -fPIC works... yes
checking if arm-none-linux-gnueabi-gcc static flag -static works... yes
checking if arm-none-linux-gnueabi-gcc supports -c -o file.o... yes
checking whether the arm-none-linux-gnueabi-gcc linker (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by arm-none-linux-gnueabi-g++... /usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld
checking if the linker (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) is GNU ld... yes
checking whether the arm-none-linux-gnueabi-g++ linker (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) supports shared libraries... no
checking for arm-none-linux-gnueabi-g++ option to produce PIC... -fPIC
checking if arm-none-linux-gnueabi-g++ PIC flag -fPIC works... yes
checking if arm-none-linux-gnueabi-g++ static flag -static works... yes
checking if arm-none-linux-gnueabi-g++ supports -c -o file.o... yes
checking whether the arm-none-linux-gnueabi-g++ linker (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) supports shared libraries... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
appending configuration tag "F77" to libtool
checking for arm-gcc... (cached) arm-none-linux-gnueabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... (cached) yes
checking for arm-none-linux-gnueabi-gcc option to accept ANSI C... (cached) none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether gcc accepts -fexceptions... yes
checking for ANSI C header files... (cached) yes
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for memmove... yes
checking for bcopy... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for unistd.h... (cached) yes
checking for off_t... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... no
checking for an ANSI C99-conforming __func__... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating expat_config.h
amarshall3@pg-oj-amarshall3:~/Sandbox/expat-2.0.0$ make
/bin/bash ./libtool --silent --mode=compile arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H   -o lib/xmlparse.lo -c lib/xmlparse.c
/bin/bash ./libtool --silent --mode=compile arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H   -o lib/xmltok.lo -c lib/xmltok.c
/bin/bash ./libtool --silent --mode=compile arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H   -o lib/xmlrole.lo -c lib/xmlrole.c
/bin/bash ./libtool --silent --mode=link arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H   -no-undefined -version-info 6:0:5 -rpath /usr/local/lib  -o libexpat.la lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H   -o xmlwf/xmlwf.o -c xmlwf/xmlwf.c
arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H   -o xmlwf/xmlfile.o -c xmlwf/xmlfile.c
arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H   -o xmlwf/codepage.o -c xmlwf/codepage.c
arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H   -o xmlwf/readfilemap.o -c xmlwf/readfilemap.c
xmlwf/readfilemap.c: In function 'filemap':
xmlwf/readfilemap.c:65: warning: implicit declaration of function 'read'
xmlwf/readfilemap.c:69: warning: implicit declaration of function 'close'
/bin/bash ./libtool --silent --mode=link arm-none-linux-gnueabi-gcc -I./lib -I. -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H    -o xmlwf/xmlwf xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/readfilemap.o libexpat.la

Could somebody please explain to me how configure determines whether libtool supports building shared libraries ?

解决方案

From the output:

checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-none
...
checking whether the arm-none-linux-gnueabi-gcc linker (/usr/local/arm/arm-2007q1/arm-none-linux-gnueabi/bin/ld) supports shared libraries... yes
...
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes

Probably libtool is confused by your host flag: --host=arm, which to libtool is the same as --host=arm-unknown-none. Try --host=arm-none-linux instead. IIRC, arm-unknown-none is used by people who want to do non-RTOS (main loop) type stuff for MCUs and other embedded boards where there's no OS and everything is statically linked into an image. Your toolchain is built for Linux: arm-none-linux.

这篇关于Libtool 声称它在交叉编译期间不支持共享库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆