最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】第四次去研究:cygwin下编译buildroot在编译libtool时出错:configure: error: C compiler cannot create executables

Buildroot crifan 3389浏览 0评论

【背景】

之前已经搞定此问题了:

【已解决】cygwin下make编译buildroot时在libtool-2.2.10时出错:configure: error: C compiler cannot create executables

【已解决】再次研究:Cygwin下编译Buildroot时在编译libtool-2.2.10时出错:/usr/lib/gcc/i686-pc- cygwin/4.7.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

【记录】第三次去研究:Cygwin下编译Buildroot时在编译libtool-2.2.10时出错:/usr/lib/gcc/i686-pc- cygwin/4.7.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

但是,此处去:

make clean

make

结果又出错同样错误:

>>> host-libtool 2.2.10 Patching package//libtool
>>> host-libtool 2.2.10 Updating config.sub and config.guess
for file in config.guess config.sub; do  for i in $(find /home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10 -name $file); do  cp support/gnuconfig/$file $i;  done;  done
>>> host-libtool 2.2.10 Configuring
(cd /home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10/ && rm -rf config.cache;  PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin:/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin:/opt/crosstool-ng/bin:/home/CLi/develop/crosstool-ng/x-tools/armxscalecurl/bin:/usr/local/bin:/usr/bin:/cygdrive/d/tmp/dev_install_root/Python27_x64:/cygdrive/d/tmp/dev_install_root/Python27_x64/Lib/site-packages/PyQt4:/cygdrive/d/tmp/dev_install_root/Perl64/site/bin:/cygdrive/d/tmp/dev_install_root/Perl64/bin:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/cygdrive/d/tmp/WordPress/mysql/mysql-5.5.18/MySQL/MySQL Server 5.5/bin:/cygdrive/d/tmp/WordPress/DevRoot/MySQL/MySQL Server 5.5/bin:/cygdrive/d/tmp/WordPress/DevRoot/php-5.3.6-Win32-VC9-x64:/cygdrive/d/tmp/WordPress/DevRoot/php-5.3.6-Win32-VC9-x64/ext:/cygdrive/d/tmp/WordPress/DevRoot/Python27:/cygdrive/c/Program Files (x86)/Common Files/Acronis/SnapAPI:/cygdrive/c/Program Files (x86)/Windows Live/Shared:/cygdrive/c/Program Files/Java/jdk1.7.0_11/bin:/home/CLi/develop/docbook/tools/fop/lib:/home/CLi/develop/docbook/tools/fop:/cygdrive/d/DevInstallRoot/FF/DD_IDE_1.1.2/TOK/BIN:/cygdrive/d/DevInstallRoot/FF/DD_IDE_1.2.0/TOK/BIN:/cygdrive/d/DevRoot/EmbeddedDevelop/trunk/Research/CLI/FF/FBK/develop/tools/develop-tools:/cygdrive/d/tmp/WordPress/DevRoot/Python27/Scripts:/cygdrive/d/tmp/dev_install_root/PostgreSQL/8.3/bin:/cygdrive/d/tmp/dev_install_root/ant/apache-ant-1.8.4/bin:/cygdrive/c/Program Files/nodejs:/cygdrive/c/Program Files/Microsoft/Web Platform Installer:/cygdrive/d/DevRoot/IndustrialMobileAutomation/HandheldDataSetter/ANTLR/batchFile:/cygdrive/c/Program Files (x86)/QuickTime/QTSystem:/cygdrive/d/tmp/tmp_dev_root/android/adt-bundle-windows/sdk/platform-tools:/cygdrive/d/tmp/dev_install_root/Tesseract-OCR:/cygdrive/d/tmp/dev_install_root/jython2.5.3/bin:/cygdrive/d/devinstallroot/gnuarm/bin:/cygdrive/d/tmp/dev_install_root/HTML Help Workshop:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/d/tmp/dev_install_root/Go/bin:/cygdrive/d/tmp/tmp_dev_root/go/bin:/cygdrive/c/Users/CLi/AppData/Roaming/npm:/usr/lib/lapack:/opt/gcc-4.0.4-glibc-2.3.6-kernel-2.6.17/sysroot-arm-xscale-linux-gnu/usr/include:/opt/gcc-4.0.4-glibc-2.3.6-kernel-2.6.17/sysroot-arm-xscale-linux-gnu/usr/include/linux"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc"  GCC="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc"  CXX="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/g++"  CPP="/bin/cpp"  CPPFLAGS="-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  CFLAGS="-O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  CXXFLAGS="-O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  LDFLAGS="-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib"  PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1  PKG_CONFIG_ALLOW_SYSTEM_LIBS=1  PKG_CONFIG="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/pkg-config"  PKG_CONFIG_SYSROOT_DIR="/"  PKG_CONFIG_LIBDIR="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLLIB="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/perl"  LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:"  CFLAGS="-O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  LDFLAGS="-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xmlto=no  --with-fop=no    )
configure: WARNING: unrecognized options: --disable-gtk-doc, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop
## -------------------------- ##
## Configuring libtool 2.2.10 ##
## -------------------------- ##

checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether subdir libobjs are useable... yes
checking for gcc... /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc
checking whether the C compiler works... no
configure: error: in `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10':
configure: error: C compiler cannot create executables
See `config.log' for more details.
package/pkg-generic.mk:106: recipe for target `/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10/.stamp_configured' failed
make: *** [/home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10/.stamp_configured] Error 77

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05
$

如图:

forth time C compiler cannot create executables bin not ahead path

即:

configure: error: C compiler cannot create executables

 

【折腾过程】

1.注意到,PATH路径值:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/......

即,不是之前设置的,最开始应该是/bin的那个路径。

而去看看,之前修改的:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\package\Makefile.in

其中的确是已经修改好了的:

# Quotes are needed for spaces et al in path components.
#TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(PATH)"
TARGET_PATH="$(PATH):$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/"

并且,对应的:

D:\tmp\tmp_dev_root\cgwin\home\CLi\.bashrc

最后的配置也是bin在最开始的:

PATH=/bin:$HOME/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin:/opt/crosstool-ng/bin:$HOME/develop/crosstool-ng/x-tools/armxscalecurl/bin:$PATH:/opt/gcc-4.0.4-glibc-2.3.6-kernel-2.6.17/sysroot-arm-xscale-linux-gnu/usr/include:/opt/gcc-4.0.4-glibc-2.3.6-kernel-2.6.17/sysroot-arm-xscale-linux-gnu/usr/include/linux

所以,结果还是有点奇怪的:

(TARGET_PATH中的)PATH没有变成我们所设置的,/bin在最前面。

2.注意到,此处的PATH是:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:...

即:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\package\Makefile.in

中的那个

$(HOST_DIR)/bin

$(HOST_DIR)/usr/bin

又跑到/bin之前了。

感觉像是:

在上面

TARGET_PATH="$(PATH):$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/"

设置之外,又是哪里,去故意把此两个路径,加到了我主动设置的PATH前面了。

3.然后注意到:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\package\Makefile.in

中是:

#HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
HOST_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)"

# hostcc version as an integer - E.G. 4.3.2 => 432
HOSTCC_VERSION:=$(shell $(HOSTCC_NOCCACHE) --version | \
	sed -n 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[ ]*.*$$/\1\2\3/p')

......

TARGET_MAKE_ENV=PATH=$(TARGET_PATH) \
		PERLLIB="$(HOST_DIR)/usr/lib/perl"

HOST_CONFIGURE_OPTS=PATH=$(HOST_PATH) \
		AR="$(HOSTAR)" \
		.......

HOST_MAKE_ENV=PATH=$(HOST_PATH) \
		LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)" \
		......

即:

此处,虽然TARGET_MAKE_ENV等变量,是依赖于我之前已经改好了的

TARGET_PATH="$(PATH):$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/"

但是,另外两个:

HOST_CONFIGURE_OPTS

HOST_MAKE_ENV

都是依赖于:HOST_PATH

而HOST_PATH,目前设置的值,就是:

HOST_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)"

4.所以,去把:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\package\Makefile.in

中的HOST_PATH改为:

#HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
#HOST_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)"
HOST_PATH="$(PATH):$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin"

5.然后再去重新

make clean

再make

看看结果。

然后才终于解决此问题,终于可以正常去继续编译:

[7m>>> host-libtool 2.2.10 Extracting[27m
gzip -d -c /home/CLi/develop/buildroot/buildroot-2013.05/dl/libtool-2.2.10.tar.gz |  tar --strip-components=1 -C /home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10  -xf -
[7m>>> host-libtool 2.2.10 Patching package//libtool[27m
[7m>>> host-libtool 2.2.10 Updating config.sub and config.guess[27m
for file in config.guess config.sub; do  for i in $(find /home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10 -name $file); do  cp support/gnuconfig/$file $i;  done;  done
[7m>>> host-libtool 2.2.10 Configuring[27m
(cd /home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10/ && rm -rf config.cache;  PATH="/bin:/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/bin:/opt/crosstool-ng/bin:/home/CLi/develop/crosstool-ng/x-tools/armxscalecurl/bin:/usr/local/bin:/usr/bin:/cygdrive/d/tmp/dev_install_root/Python27_x64:/cygdrive/d/tmp/dev_install_root/Python27_x64/Lib/site-packages/PyQt4:/cygdrive/d/tmp/dev_install_root/Perl64/site/bin:/cygdrive/d/tmp/dev_install_root/Perl64/bin:/cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Program Files (x86)/Common Files/Microsoft Shared/Windows Live:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/cygdrive/d/tmp/WordPress/mysql/mysql-5.5.18/MySQL/MySQL Server 5.5/bin:/cygdrive/d/tmp/WordPress/DevRoot/MySQL/MySQL Server 5.5/bin:/cygdrive/d/tmp/WordPress/DevRoot/php-5.3.6-Win32-VC9-x64:/cygdrive/d/tmp/WordPress/DevRoot/php-5.3.6-Win32-VC9-x64/ext:/cygdrive/d/tmp/WordPress/DevRoot/Python27:/cygdrive/c/Program Files (x86)/Common Files/Acronis/SnapAPI:/cygdrive/c/Program Files (x86)/Windows Live/Shared:/cygdrive/c/Program Files/Java/jdk1.7.0_11/bin:/home/CLi/develop/docbook/tools/fop/lib:/home/CLi/develop/docbook/tools/fop:/cygdrive/d/DevInstallRoot/FF/DD_IDE_1.1.2/TOK/BIN:/cygdrive/d/DevInstallRoot/FF/DD_IDE_1.2.0/TOK/BIN:/cygdrive/d/DevRoot/EmbeddedDevelop/trunk/Research/CLI/FF/FBK/develop/tools/develop-tools:/cygdrive/d/tmp/WordPress/DevRoot/Python27/Scripts:/cygdrive/d/tmp/dev_install_root/PostgreSQL/8.3/bin:/cygdrive/d/tmp/dev_install_root/ant/apache-ant-1.8.4/bin:/cygdrive/c/Program Files/nodejs:/cygdrive/c/Program Files/Microsoft/Web Platform Installer:/cygdrive/d/DevRoot/IndustrialMobileAutomation/HandheldDataSetter/ANTLR/batchFile:/cygdrive/c/Program Files (x86)/QuickTime/QTSystem:/cygdrive/d/tmp/tmp_dev_root/android/adt-bundle-windows/sdk/platform-tools:/cygdrive/d/tmp/dev_install_root/Tesseract-OCR:/cygdrive/d/tmp/dev_install_root/jython2.5.3/bin:/cygdrive/d/devinstallroot/gnuarm/bin:/cygdrive/d/tmp/dev_install_root/HTML Help Workshop:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/d/tmp/dev_install_root/Go/bin:/cygdrive/d/tmp/tmp_dev_root/go/bin:/cygdrive/c/Users/CLi/AppData/Roaming/npm:/usr/lib/lapack:/opt/gcc-4.0.4-glibc-2.3.6-kernel-2.6.17/sysroot-arm-xscale-linux-gnu/usr/include:/opt/gcc-4.0.4-glibc-2.3.6-kernel-2.6.17/sysroot-arm-xscale-linux-gnu/usr/include/linux:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc"  GCC="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc"  CXX="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/g++"  CPP="/bin/cpp"  CPPFLAGS="-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  CFLAGS="-O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  CXXFLAGS="-O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  LDFLAGS="-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib"  PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1  PKG_CONFIG_ALLOW_SYSTEM_LIBS=1  PKG_CONFIG="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/pkg-config"  PKG_CONFIG_SYSROOT_DIR="/"  PKG_CONFIG_LIBDIR="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLLIB="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/perl"  LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:"  CFLAGS="-O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  LDFLAGS="-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xmlto=no  --with-fop=no    )
configure: WARNING: unrecognized options: --disable-gtk-doc, --disable-doc, --disable-docs, --disable-documentation, --with-xmlto, --with-fop
## -------------------------- ##
## Configuring libtool 2.2.10 ##
## -------------------------- ##

checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether subdir libobjs are useable... yes
checking for gcc... /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no

如图:

fourth time in end libtool compiler work check is yes

 

其中,可见对应的PATH是需要需要的/bin在最开始的了:

PATH="/bin:......

 

【总结】

buildroot中的makefile,由于官网没支持cygwin

所以对于cygwin中的很多,和路径有关的支持,并不完善。

所以才导致,之前遇到:

【已解决】Cygwin下为xscale编译Buildroot时make出错:/bin/sh: -c: line 0: syntax error near unexpected token `(‘

所以才对于:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\package\Makefile.in

中的:

HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)

改为:

HOST_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)"

的。

而此处,又是由于:

configure: error: C compiler cannot create executables

而去再把:

HOST_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)"

改为:

HOST_PATH="$(PATH):$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin"

才解决问题的。

转载请注明:在路上 » 【记录】第四次去研究:cygwin下编译buildroot在编译libtool时出错:configure: error: C compiler cannot create executables

与本文相关的文章

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.175 seconds, using 22.31MB memory