【记录】第三次去研究: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

期间,继续去折腾。

【折腾过程】

18.然后想起来,试着把环境变量,比如CC等,放到./configure后面,看看能否传递到进去:

即,把:

LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32"

放到后面,变成:

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/c/Program Files/TortoiseSVN/bin:/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/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"   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 LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32"  --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

然后试试结果:

结果错误依旧:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05
$ cd /home/CLi/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10/

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ rm -rf config.cache

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ 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/c/Program Files/TortoiseSVN/bin:/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/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"   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 LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32"  --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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

不过,对应的:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\build\host-libtool-2.2.10\config.log

中已经可以传递进来LD_LIBRARY_PATH参数了:

$ ./configure LD_LIBRARY_PATH=/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32 --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

19。所以,再去把所有参数,都放到configure后面:

./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 LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32" 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/c/Program Files/TortoiseSVN/bin:/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/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"   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"

再去试试:

结果还是错误:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ./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 LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32" 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/c/Program Files/TortoiseSVN/bin:/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/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"   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: 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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

对应的:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\build\host-libtool-2.2.10\config.log

中已经是:

$ ./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 LD_LIBRARY_PATH=/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32 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/c/Program Files/TortoiseSVN/bin:/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/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 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

了。

20.怀疑,有一丁点可能是PATH中有空格或许会导致问题?

所以再去试试,把path去掉:

./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 LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32" 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"   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"

再去试试:

结果真的就可以了:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ./configure --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --ele-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xmlto=no  --with-fop=no LD_LIBRARY_PATH="/home/CLi/develop/ldroot/buildroot-2013.05/output/host/usr/lib:/usr/bin:/cygdrive/c/Windows/system32" AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildrobuildroot-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/bdroot/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=2 -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"  LDFLA"-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/buildrobuildroot-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/outpuost/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/buioot/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLLIB="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/perl"   CFLAGS="-O2 -I/home/CLi/develouildroot/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-2015/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib"
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
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc accepts -g... yes
checking for /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc... gcc3
checking whether /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... /bin/cpp
checking build system type... i686-pc-cygwin
checking host system type... i686-pc-cygwin
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F

此处,直观的看起来,貌似是PATH中包含特殊字符(空格,括号等)导致的

21.那再去把上面,加上额外路径的LD_LIBRARY_PATH中的路径去掉,变成:

./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 LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib" 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"   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"

然后再去试试:

也是可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ./configure --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --ele-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xmlto=no  --with-fop=no LD_LIBRARY_PATH="/home/CLi/develop/ldroot/buildroot-2013.05/output/host/usr/lib" AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bccache /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/hostr/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/buioot-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/builot-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/l  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_CONFIGSROOT_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/ushare/pkgconfig"  PERLLIB="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/perl"   CFLAGS="-O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/h/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,/h/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib"
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
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc accepts -g... yes
checking for /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc option to accept ISO C89...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

22.那再去,把这些参数,都换到之前的,configure之前:

LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib" 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"   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

再去试试,结果也是可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib" AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildt/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/developildroot/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"  CFLAG-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"  LDFS="-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/buildt/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/out/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/bdroot/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLLIB="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/perl"   CFLAGS="-O2 -I/home/CLi/deve/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-2.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.05tput/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --disabdocs  --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
checking for suffix of object files... o
checking whether we are using the GNU C compiler...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

23.那就把最原始的命令,去掉PATH,且保留有错误的LD_LIBRARY_PATH(最后是冒号):

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

看看结果,也是可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ 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/ldroot/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"  CLAGS="-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"  CXXGS="-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/deop/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_CIG_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/Cdevelop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLLIB="/home/CLi/deve/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/devp/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-3.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-2005/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --able-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
checking for suffix of object files...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

24.所以,至此,已经完全确定,就是环境变量中有空格,括号等特殊字符,导致了后续不知道哪里

(估计是cc1内部搜索库的时候)找不到对应的路径下的库,而导致出错的。

那就再去:

尽量保留之前的PATH的设置,然后只是去掉其中带空格的路径,变成:

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/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/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:/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/d/DevRoot/IndustrialMobileAutomation/HandheldDataSetter/ANTLR/batchFile:/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/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

然后再去试试,

结果竟然就是错误依旧的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ 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-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_r/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/Per/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/d/tmp/WordPress/Devt/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:/home/CLi/develop/docbook/tools/fop/lihome/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/EmbeddedDeve/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/dp/dev_install_root/ant/apache-ant-1.8.4/bin:/cygdrive/d/DevRoot/IndustrialMobileAutomation/HandheldDataSetter/ANTLR/batchFile:/cygdrive/d/tmp/tmp_dev_root/android/adt-bue-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:/cygdr/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.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/usin/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/h/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/ldroot-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/bdroot-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/usib"  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_CON_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/hossr/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/out/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/holib -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  --pix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disabstatic  --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.

看来,还是此处PATH中的某些路径,导致了问题。

25.那再去去掉一些路径,尽量只保留和cygwin有关的,变成:

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:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/home/CLi/develop/docbook/tools/fop/lib:/home/CLi/develop/docbook/tools/fop:/cygdrive/d/DevRoot/EmbeddedDevelop/trunk/Research/CLI/FF/FBK/develop/tools/develop-tools:/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

再去试试:

结果还是错误:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ 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-x-tools/arm-xscale-linux-gnueabi/bin:/opt/crosstool-ng/bin:/home/CLi/develop/crosstool-ng/x-tools/armxscalecurl/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygve/c/Windows/System32/Wbem:/home/CLi/develop/docbook/tools/fop/lib:/home/CLi/develop/docbook/tools/fop:/cygdrive/d/DevRoot/EmbeddedDevelop/trunk/Research/CLI/FF/FBK/deve/tools/develop-tools:/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-axscale-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/ccachein/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/che /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-2005/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-2015/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_FIG_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_="/"  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/config"  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/usrb:"  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/hoCLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/homei/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  -sable-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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

26.再去把PATH变短:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows"  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

再去试试,结果仍然出错:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin:/cygdrive/c/Windows/system32ygdrive/c/Windows"  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="me/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++" P="/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/hostr/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/ -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_SYSTCFLAGS=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_CONFLIBDIR="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLL"/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="--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/buroot/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/builot/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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

27.看来,真的只能是把path变成最短:

PATH="/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

然后再去试试:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/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="/homei/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=in/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/lude"  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 -ome/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_CFS=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_LIR="/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="/e/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 -Ime/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/buildrobuildroot-2013.05/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildrootildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --dile-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
checking for suffix of object files... o
checking whether we are using the GNU C compiler...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-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

时,就是:

PATH路径太长

把其变短

比如:

PATH="/bin"

然后就可以编译通过了。

 

28.另外注意到一点:

Re: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

是病毒软件搞的鬼。

It turned out that my anti-virus software updated itself and
they added a sandbox feature that malfunctioned in a way that all my cygwin
programs, and only those, failed in the way I described.

所以:

此处的错误,我这里,貌似和当前的win7所安装的symantec无关,但是别的时候,有可能有关。

29.再去试试,增加PATH的路径:

PATH="/bin:/cygdrive/c/Windows"  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

试试结果:

也是可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/bin:/cygdrive/c/Windows"  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 //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/cce /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/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.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_COG_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_DI/"  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/pknfig"  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/l"  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/homei/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/Cdevelop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --dble-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
checking for suffix of object files...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

30.再增加PATH的值:

PATH="/bin:/cygdrive/c/Windows:/cygdrive/c/Windows/system32"  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

结果,也是可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/bin:/cygdrive/c/Windows:/cygdrive/c/Windows/system32"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildroot/buildroot-2013.05tput/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-2.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/devp/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/deve/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.05tput/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-cig"  PKG_CONFIG_SYSROOT_DIR="/"  PKG_CONFIG_LIBDIR="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig:/home/CLi/develop/buildroot/buildroot-2015/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/buildr-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-2005/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"    .nfigure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/etc"  --enableared --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
checking for suffix of object files...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

31.再增加:

PATH="/bin:/cygdrive/c/Windows:/cygdrive/c/Windows/system32:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/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

结果也是可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/bin:/cygdrive/c/Windows:/cygdrive/c/Windows/system32:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  N/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/che /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/buildroot13.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/buildro2013.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/usib -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/CLivelop/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/housr/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//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/usrclude"  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/CLivelop/buildroot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/elop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xm=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
checking for suffix of object files... o
checking whether we are using the GNU C compiler...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

32.再增加:

PATH="/bin:/cygdrive/c/Windows:/cygdrive/c/Windows/system32:/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

结果也是可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/bin:/cygdrive/c/Windows:/cygdrive/c/Windows/system32:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05tput/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="me/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++" P="/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/hostr/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/ -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_SYSTCFLAGS=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_CONFLIBDIR="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLL"/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="--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/buroot/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/builot/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
checking for suffix of object files... o
checking whether we are using the GNU C compiler...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

但是注意到,之前的:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows"  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

是不可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin:/cygdrive/c/Windows/system32ygdrive/c/Windows"  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="me/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++" P="/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/hostr/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/ -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_SYSTCFLAGS=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_CONFLIBDIR="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLL"/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="--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/buroot/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/builot/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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

貌似是PATH中的路径的顺序变了。就导致出错了。

而从:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows"

变成:

PATH="/bin:/cygdrive/c/Windows:/cygdrive/c/Windows/system32:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin"

就是支持的了。

33.看起来,像是:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

放到

/bin

前面,就出错了。

然后去看看对应的:

(1)/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin

结果根本不存在

只有对应的

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\host

没有:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\host\bin

(2)/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

有对应的:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\host\usr\bin

其下只有3个文件:

host urs bin only contain 3 file_thumb

所以,看起来,像是:

cc1,内部去查找相关的库的时候,去:

如果先给/bin,则可以找到所有依赖的库->编译正常

如果先给/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin->只能找到当前这几个有限的文件:cygmpfr-4.dll,ccache.exe,m4.exe->没法编译,报错,说缺少库。

34.那就单独去测试这两个路径:

(1)先把bin放前面,host/usr/bin放后面,试试:

PATH="/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

结果,是正常的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/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/ldroot-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/builot/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="-OI/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=/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/ldroot-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/h/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/buildr/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/developildroot/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/buildt/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/h/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/hoetc"  --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
checking for suffix of object files... o
checking whether we are using the GNU C compiler...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

 

(2)把host/usr/bin放前面,/bin放后面试试:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/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

结果,的确就出错了:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildroot/ldroot-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/builot/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="-OI/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=/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/ldroot-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/h/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/buildr/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/developildroot/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/buildt/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/h/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/buildroot/buildroot-2013.05/output/hoetc"  --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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

(3)不给host/usr/bin,但是给其他的(此处实际上根本不存在的)host/bin,以及其他(存在的,且正常的)windows的几个路径:/cygdrive/c/Windows和/cygdrive/c/Windows/system32,且都放在/bin前面,变成:

PATH="/cygdrive/c/Windows:/cygdrive/c/Windows/system32:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/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

结果是:

也是可以的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/cygdrive/c/Windows:/cygdrive/c/Windows/system32:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/bin"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  N/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/che /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/buildroot13.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/buildro2013.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/usib -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/CLivelop/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/housr/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//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/usrclude"  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/CLivelop/buildroot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/elop/buildroot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xm=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
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc accepts -g... yes
checking for /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc option to accept ISO C89...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

所以,截止目前:

可以锁定具体错误的细节是:

当./configure时,传入的PATH环境变量中的路径的值中:

给定了buildroot的output/host/usr/bin路径:

(此处是:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

对应windows的路径:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\host\usr\bin

)时,如果放到了

/bin

前面,则一定会出错。

如果是放到

/bin

后面,则是不会出错的。

而错误的根本原因,好像是:

由于此处的buildroot的output/host/usr/bin路径中,只包含了三个文件:

cygmpfr-4.dll

ccache.exe

m4.exe

导致了

/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe

去编译的时候,去加载所依赖的库:

(通过cygcheck查得:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ cygcheck /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe
D:\tmp\tmp_dev_root\cgwin\lib\gcc\i686-pc-cygwin\4.5.3\cc1.exe
  D:\tmp\tmp_dev_root\cgwin\bin\cygcloog-0.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygwin1.dll
      C:\Windows\system32\KERNEL32.dll
        C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
        C:\Windows\system32\ntdll.dll
        C:\Windows\system32\KERNELBASE.dll
        C:\Windows\system32\API-MS-Win-Core-ProcessThreads-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Heap-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Memory-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Handle-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Synch-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-File-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-IO-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ThreadPool-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-LibraryLoader-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-NamedPipe-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Misc-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-SysInfo-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Localization-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-String-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Debug-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ErrorHandling-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Fibers-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Util-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Profile-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Security-Base-L1-1-0.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cyggmp-10.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygppl_c-4.dll
      D:\tmp\tmp_dev_root\cgwin\bin\cygppl-9.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cyggcc_s-1.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cygstdc++-6.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cyggmpxx-4.dll
      D:\tmp\tmp_dev_root\cgwin\bin\cygpwl-5.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cyggmp-3.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygiconv-2.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygintl-8.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygmpc-1.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygmpfr-1.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygmpfr-4.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygppl_c-2.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygppl-7.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygz.dll

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

其中:

  • D:\tmp\tmp_dev_root\cgwin\bin 对应着 cygwin的/bin路径;
  • C:\Windows\system32 对应着cygwin的/cygdrive/c/Windows/system32路径;

其中包含

cygmpfr-4.dll

等库文件,但是估计是cygwin中的cc1的路径有误

35.此处,正在分析根本原因,正在推测和猜测根本原因,以为是path路径导致的,但是觉得,实际上,或许,和此处的

LD_LIBRARY_PATH

也有关系。

因为此处是:

LD_LIBRARY_PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib:"

而对应的

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\host\usr\lib

也只有几个文件:

libgmp.la

libgmp.lib

libgmp-10.dll

libmpfr.dll.a

libmpfr.la

host usr lib only contains some mpfr dll files_thumb

所以,或许是:

此处的:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib

路径,的确生效了,而导致,此处找不到所需要的那一堆的cygxxx.dll而出错?

所以,再去在

PATH中的hosr/usr/bin在/bin前面,会出错的前提下,

去把LD_LIBRARY_PATH加上对应的上述的路径,变成:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/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:/cygdrive/c/Windows/system32:/bin"  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

试试结果:

结果错误依旧:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildroot/ldroot-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/builot/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="-OI/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=/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/ldroot-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/h/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/buildr/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/developildroot/buildroot-2013.05/output/host/usr/lib:/cygdrive/c/Windows/system32:/bin"  CFLAGS="-O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"  LAGS="-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/buioot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/builot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xmlto=no  --wifop=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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

36.那再把LD_LIBRARY_PATH中的/bin和/cygdrive/c/Windows/system32,放到/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib前面:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/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="/bin:/cygdrive/c/Windows/system32:/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

试试,结果还是错误依旧:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildroot/ldroot-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/builot/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="-OI/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=/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/ldroot-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/h/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/buildr/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLLIB="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/perl"  LD_LIBRARY_PATH="/bin:/cygdrive/c/dows/system32:/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"  LAGS="-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/buioot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/builot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xmlto=no  --wifop=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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

37.注意到,之前的PATH中的system32的路径,都是小写的s开头的:

/cygdrive/c/Windows/system32

而当前的cygwin下,已经是通过之前的:

【已解决】cygwin下crosstool去build出错:Performing some trivial sanity checks,Your file system in xxx is *not* case-sensitive!

把win7(和cygwin)变成了大小写敏感的,所以路径:

/cygdrive/c/Windows/system32

是错误的,应该是:

/cygdrive/c/Windows/System32

对应的,可以在cygwin中验证:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /cygdrive/c/Windows/Sys
System32/ SysWOW64/

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /cygdrive/c/Windows/Sys^C

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /cygdrive/c/Windows/system
system/     system.ini

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /cygdrive/c/Windows/system

所以,再去把此正确的路径加到LD_LIBRARY_PATH,变成:

PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/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="/bin:/cygdrive/c/Windows/System32:/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

看看是否有效,结果错误依旧:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin"  AR="/bin/ar"  AS="/bin/as"  LD="/bin/ld"  NM="/bin/nm"  CC="/home/CLi/develop/buildroot/ldroot-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/builot/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="-OI/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=/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/ldroot-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/h/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/buildr/buildroot-2013.05/output/host/usr/share/pkgconfig"  PERLLIB="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/perl"  LD_LIBRARY_PATH="/bin:/cygdrive/c/dows/System32:/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"  LAGS="-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/buioot/buildroot-2013.05/output/host/usr/lib"    ./configure  --prefix="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr"  --sysconfdir="/home/CLi/develop/builot/buildroot-2013.05/output/host/etc"  --enable-shared --disable-static  --disable-gtk-doc  --disable-doc  --disable-docs  --disable-documentation  --with-xmlto=no  --wifop=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.

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

38.那么,再去,针对原先的完全的命令,只是去把/bin放到PATH最开始,确保是在

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

之前,而保留原先的PATH中有特殊的空格等路径(当然,PATH的值,整体是之前就已经通过括号括起来的,以避免路径出错的)

然后看看是否也是正常的。

即,针对原先命令,唯一改动是:

/bin

移到PATH最开始:

PATH="/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/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/c/Program Files/TortoiseSVN/bin:/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/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

结果是:

果然就可以了:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/home/CLi/develop/crosstool-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_r/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/Per/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/tem32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/100/ls/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-518/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/Wordss/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 6)/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/DevInstallR/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:/cyive/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/Pram Files/nodejs:/cygdrive/c/Program Files/Microsoft/Web Platform Installer:/cygdrive/c/Program Files/TortoiseSVN/bin:/cygdrive/d/DevRoot/IndustrialMobileAutomation/HandhDataSetter/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/_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:/crive/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-.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/hossr/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/outphost/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/buildr/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/buildrobuildroot-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/hossr/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"  PKGNFIG_SYSROOT_DIR="/"  PKG_CONFIG_LIBDIR="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib/pkgconfig:/home/CLi/develop/buildroot/buildroot-2013.05/outputst/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.05tput/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/outpuost/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 --dble-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
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc accepts -g... yes
checking for /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc...
CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ^C

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

 

39.至此,完全确定了错误的表面的原因,即:

用make去编译buildroot时,执行到:

用./configure去配置libtool时

由于传入的PATH变量值中的

/bin

路径,是放在了:

buildroot的output/host/usr/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\output\host\usr\bin

的前面,就导致:

./configure

过程中,报错:

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

对应的config.log文件

(此处是

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\build\host-libtool-2.2.10\config.log

中的错误现象是:

configure:3496: checking for C compiler version
configure:3505: /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc --version >&5
gcc (GCC) 4.5.3
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3516: $? = 0
configure:3505: /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc -v >&5
Using built-in specs.
COLLECT_GCC=/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.5.3/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/configure --srcdir=/gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/gcc4 -C --datadir=/usr/share --infodir=/usr/share/info --mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap --enable-version-specific-runtime-libs --libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-lto --enable-java-awt=gtk --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libgcj-sublibs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake GNATBIND_FOR_TARGET=gnatbind --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.5.3 (GCC) 
configure:3516: $? = 0
configure:3505: /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc -V >&5
gcc: '-V' option must have argument
configure:3516: $? = 1
configure:3505: /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc -qversion >&5
gcc: unrecognized option '-qversion'
gcc: no input files
configure:3516: $? = 1
configure:3536: checking whether the C compiler works
configure:3558: /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc -O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -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 conftest.c  >&5
/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory
configure:3562: $? = 1
configure:3600: result: no

即:

/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

 

此处,解决办法是:

把PATH中的

/bin

路径,放到

buildroot的output/host/usr/bin路径

(即:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

的前面,比如,把

/bin

放到PATH的最开始,变成:

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

再去配置,就可以正常了。

 

而对应的根本原因,目前不确定,此处只是个人推测:

 

此处的:

buildroot的output/host/usr/bin路径

(/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin)

中,只包含了3个文件:

  • ccache.exe
  • cygmpfr-4.dll
  • m4.exe

对应的,由于此output/host/usr/bin是放在/bin路径之前,

此点,对应的含义是,也是完全可以确定和理解的是:

cc1执行期间,会先去到output/host/usr/bin,如果找不到,再去到/bin下面去找。

另外,一个背景是:

cc1,所依赖,包含很多库,其中就有cygmpfr-4.dll

这点,可以通过cygcheck确定:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ cygcheck /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe
D:\tmp\tmp_dev_root\cgwin\lib\gcc\i686-pc-cygwin\4.5.3\cc1.exe
  D:\tmp\tmp_dev_root\cgwin\bin\cygcloog-0.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygwin1.dll
      C:\Windows\system32\KERNEL32.dll
        C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
        C:\Windows\system32\ntdll.dll
        C:\Windows\system32\KERNELBASE.dll
        C:\Windows\system32\API-MS-Win-Core-ProcessThreads-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Heap-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Memory-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Handle-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Synch-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-File-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-IO-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ThreadPool-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-LibraryLoader-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-NamedPipe-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Misc-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-SysInfo-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Localization-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-String-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Debug-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ErrorHandling-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Fibers-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Util-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Profile-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Security-Base-L1-1-0.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cyggmp-10.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygppl_c-4.dll
      D:\tmp\tmp_dev_root\cgwin\bin\cygppl-9.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cyggcc_s-1.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cygstdc++-6.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cyggmpxx-4.dll
      D:\tmp\tmp_dev_root\cgwin\bin\cygpwl-5.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cyggmp-3.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygiconv-2.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygintl-8.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygmpc-1.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygmpfr-1.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygmpfr-4.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygppl_c-2.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygppl-7.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygz.dll

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

其中:

  • D:\tmp\tmp_dev_root\cgwin\bin 对应着 cygwin的/bin路径;
  • C:\Windows\system32 对应着cygwin的/cygdrive/c/Windows/System32路径;

然后,可能是:

cc1去找其所依赖的库的时候,

 

38.而就在推测根本原因时,又想到一个可以去测试和验证的事情。

之前手动执行cc1的那行代码,是可以正常执行的,但是是没有去设置PATH变量值的。

所以此处可以:

手动先去设置PATH的值为,会导致出错的那个:

host/usr/bin在/bin之前的那个路径

然后再去执行cc1,加上-v看看其内部执行过程,会不会出错:

此处再把之前的conftest.c拿过来,然后手动去执行:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc -O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/Cdevelop/buildroot/buildroot-2013.05/output/host/usr/include -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2013.output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib conftest.c

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc -v -O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/homLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2005/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib conftest.c
Using built-in specs.
COLLECT_GCC=/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.5.3/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/configure --srcdir=/gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/gcc4 -C --datadir=/usr/share --infodir=/usr/share/info --mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap --enable-version-specific-runtime-libs --libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-lto --enable-java-awt=gtk --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libgcj-sublibs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake GNATBIND_FOR_TARGET=gnatbind --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.5.3 (GCC)
COLLECT_GCC_OPTIONS='-v' '-O2' '-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include' '-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include' '-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib' '-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe -quiet -v -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api -idirafter ../../include/w32api conftest.c -quiet -dumpbase conftest.c -mtune=generic -march=i686 -auxbase conftest -O2 -version -o /tmp/ccjOePeo.s
GNU C (GCC) version 4.5.3 (i686-pc-cygwin)
        compiled by GNU C version 4.5.3, GMP version 4.3.2, MPFR version 3.0.1-p4, MPC version 0.8
warning: MPFR header version 3.0.1-p4 differs from library version 3.1.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/include"
ignoring nonexistent directory "../../include/w32api"
ignoring duplicate directory "/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/include-fixed
 /usr/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api
End of search list.
GNU C (GCC) version 4.5.3 (i686-pc-cygwin)
        compiled by GNU C version 4.5.3, GMP version 4.3.2, MPFR version 3.0.1-p4, MPC version 0.8
warning: MPFR header version 3.0.1-p4 differs from library version 3.1.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 89d6774c1d510265da7d48b735ce61fb
COLLECT_GCC_OPTIONS='-v' '-O2' '-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include' '-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include' '-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib' '-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/as.exe -v -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -o /tmp/ccJh5ErS.o /tmp/ccjOePeo.s
GNU assembler version 2.23.52 (i686-cygwin) using BFD version (GNU Binutils) 2.23.52.20130309
COMPILER_PATH=/usr/lib/gcc/i686-pc-cygwin/4.5.3/:/usr/lib/gcc/i686-pc-cygwin/4.5.3/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.5.3/:/usr/lib/gcc/i686-pc-cygwin/:/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/
LIBRARY_PATH=/usr/lib/gcc/i686-pc-cygwin/4.5.3/:/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-O2' '-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include' '-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include' '-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib' '-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/collect2.exe --wrap _Znwj --wrap _Znaj --wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwjRKSt9nothrow_t --wrap _ZnajRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t -Bdynamic --dll-search-prefix=cyg --large-address-aware --tsaware /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../crt0.o /usr/lib/gcc/i686-pc-cygwin/4.5.3/crtbegin.o -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib -L/usr/lib/gcc/i686-pc-cygwin/4.5.3 -L/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../.. -rpath /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib /tmp/ccJh5ErS.o -lgcc -lgcc_eh -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc -lgcc_eh /usr/lib/gcc/i686-pc-cygwin/4.5.3/crtend.o

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin"

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc -v -O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/homLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib -L/home/CLi/develop/buildroot/buildroot-2005/output/host/usr/lib -Wl,-rpath,/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib conftest.c
Using built-in specs.
COLLECT_GCC=/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.5.3/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/configure --srcdir=/gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3 --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share --docdir=/usr/share/doc/gcc4 -C --datadir=/usr/share --infodir=/usr/share/info --mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap --enable-version-specific-runtime-libs --libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-lto --enable-java-awt=gtk --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libgcj-sublibs CC=gcc-4 CXX=g++-4 CC_FOR_TARGET=gcc-4 CXX_FOR_TARGET=g++-4 GNATMAKE_FOR_TARGET=gnatmake GNATBIND_FOR_TARGET=gnatbind --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.5.3 (GCC)
COLLECT_GCC_OPTIONS='-v' '-O2' '-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include' '-I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include' '-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/lib' '-L/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/lib' '-mtune=generic' '-march=i686'
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe -quiet -v -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api -idirafter ../../include/w32api conftest.c -quiet -dumpbase conftest.c -mtune=generic -march=i686 -auxbase conftest -O2 -version -o /tmp/ccKIXXmv.s
/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

从上述结果中可以看出:

(1)直接执行,是OK的;

(2)把PATH设置为

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

后,就不可以了;

 

然后再去试试,去掉quiet,结果还是无详细信息:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe -v -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildroot-2013.05/out/host/usr/include -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api -idirafter ../../includ32api conftest.c -quiet -dumpbase conftest.c -mtune=generic -march=i686 -auxbase conftest -O2 -version -o /tmp/ccKIXXmv.s
/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

然后再去加上-I/bin试试,结果错误依旧:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe -v -I/bin -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildroot-2015/output/host/usr/include -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api -idirafter ../..clude/w32api conftest.c -quiet -dumpbase conftest.c -mtune=generic -march=i686 -auxbase conftest -O2 -version -o /tmp/ccKIXXmv.s
/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

再加上-L/bin,结果也不行:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe -v -I/bin -L/bin -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildr-2013.05/output/host/usr/include -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api -idirafte./../include/w32api conftest.c -quiet -dumpbase conftest.c -mtune=generic -march=i686 -auxbase conftest -O2 -version -o /tmp/ccKIXXmv.s
/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

很明显,此处:

cc1的执行,和之前的PATH,密切相关

PATH的路径,觉得了其搜索库的顺序。

 

然后再去把PATH改为正确的顺序,就的确是可以正常编译的:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/bin:/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin"

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe -v -I/bin -L/bin -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildr-2013.05/output/host/usr/include -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api -idirafte./../include/w32api conftest.c -quiet -dumpbase conftest.c -mtune=generic -march=i686 -auxbase conftest -O2 -version -o /tmp/ccKIXXmv.s
cc1: error: unrecognized command line option "-L/bin"
GNU C (GCC) version 4.5.3 (i686-pc-cygwin)
        compiled by GNU C version 4.5.3, GMP version 4.3.2, MPFR version 3.0.1-p4, MPC version 0.8
warning: MPFR header version 3.0.1-p4 differs from library version 3.1.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/include"
ignoring nonexistent directory "../../include/w32api"
ignoring duplicate directory "/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /bin
 /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/include-fixed
 /usr/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api
End of search list.
GNU C (GCC) version 4.5.3 (i686-pc-cygwin)
        compiled by GNU C version 4.5.3, GMP version 4.3.2, MPFR version 3.0.1-p4, MPC version 0.8
warning: MPFR header version 3.0.1-p4 differs from library version 3.1.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

所以,完全验证了:

就是PATH中的路径,决定了cc1的内部的执行期间,搜索库的路径。

39.然后突然想到:

貌似是由于此处的:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

即:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\host\usr\bin

中的那个

cygmpfr-4.dll

和原先的cygwin中的不一样:

导致了cc1,找到了cygmpfr-4.dll文件:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\host\usr\bin\cygmpfr-4.dll

而实际上,并不是其所依赖的:

D:\tmp\tmp_dev_root\cgwin\bin\cygmpfr-4.dll

所以此出错的?

所以,去看看这两个文件,至少先比较一下大小:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /bin/cygmpfr-4.dll -lha
-rwxr-xr-x 1 CLi Domänen-Benutzer 344K Apr 12 02:07 /bin/cygmpfr-4.dll*

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll -lha
-rwxr-xr-x 1 CLi Domänen-Benutzer 432K Sep  9 17:18 /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll*

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

很明显,是有问题的:

cc1原先所依赖的是344K的/bin/cygmpfr-4.dll

而此处却找到的是:

432K的

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll

所以,必然会导致出错。

所以,想到一个事情:

故意把此处的/bin下面的cygmpfr-4.dll拷贝到对应的

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/

下面,或许就可以编译成功了?

然后去试试:

果然完全验证了我的猜想:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /bin/cygmpfr-4.dll -lha
-rwxr-xr-x 1 CLi Domänen-Benutzer 344K Apr 12 02:07 /bin/cygmpfr-4.dll*

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll -lha
-rwxr-xr-x 1 CLi Domänen-Benutzer 432K Sep  9 17:18 /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll*

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ mv /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4_buildroompiled.dll

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ cp /bin/cygmpfr-4.dll /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ ls /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ -lha
total 1.3M
drwxr-xr-x+ 1 CLi Domänen-Benutzer    0 Sep 10 15:30 ./
drwxr-xr-x+ 1 CLi Domänen-Benutzer    0 Sep  9 17:13 ../
-rwxr-xr-x  1 CLi Domänen-Benutzer 198K Sep  9 16:54 ccache.exe*
-rwxr-xr-x  1 CLi Domänen-Benutzer 344K Sep 10 15:30 cygmpfr-4.dll*
-rwxr-xr-x  1 CLi Domänen-Benutzer 432K Sep  9 17:18 cygmpfr-4_buildrootCompiled.dll*
-rwxr-xr-x  1 CLi Domänen-Benutzer 293K Sep  9 17:04 m4.exe*

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ PATH="/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin:/bin"

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe -v -I/bin -L/bin -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildr-2013.05/output/host/usr/include -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api -idirafte./../include/w32api conftest.c -quiet -dumpbase conftest.c -mtune=generic -march=i686 -auxbase conftest -O2 -version -o /tmp/ccKIXXmv.s
cc1: error: unrecognized command line option "-L/bin"
GNU C (GCC) version 4.5.3 (i686-pc-cygwin)
        compiled by GNU C version 4.5.3, GMP version 4.3.2, MPFR version 3.0.1-p4, MPC version 0.8
warning: MPFR header version 3.0.1-p4 differs from library version 3.1.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/include"
ignoring nonexistent directory "../../include/w32api"
ignoring duplicate directory "/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include"
#include "..." search starts here:
#include <...> search starts here:
 /bin
 /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/include-fixed
 /usr/include
 /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api
End of search list.
GNU C (GCC) version 4.5.3 (i686-pc-cygwin)
        compiled by GNU C version 4.5.3, GMP version 4.3.2, MPFR version 3.0.1-p4, MPC version 0.8
warning: MPFR header version 3.0.1-p4 differs from library version 3.1.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

即使路径设置有误:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

放到

/bin

的前面,导致cc1执行期间,会误搜索用到

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

下面的那个cygmpfr-4.dll

但是由于我故意换掉cygmpfr-4.dll

(由buildroot编译出来的cygmpfr-4.dll,对于cc1来说,就是个错误的,不正确的cygmpfr-4.dll)

然后使得编译也是可以正常的。

由此,完全确定了根本原因:

就是PATH中:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

放到

/bin

前面,导致cc1执行期间,搜索其所依赖的库,其中包括cygmpfr-4.dll

结果先找到了

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

下面的那个

cygmpfr-4.dll

而此文件,是buildroot编译期间所生成的,

不是cygwin本身自带的,cc1真正所依赖的那个:

/bin/cygmpfr-4.dll

由此导致:

cc1,引用了错误的cygmpfr-4.dll,从而报错;

而且,由于此处的cygmpfr-4.dll是个错误的dll文件,从而导致:

在报错的时候,都是:

/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

即,都没有明确指明,是缺少了具体哪个shared object file

而之前别人遇到类似的问题,很多都是:

cc1.exe: error while loading shared libraries: cygmpfr-1.dll: cannot open shared object file: No such file or directory

/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: cygmpfr-4.dll: cannot open shared object file: No such file or directory

即:

cc1报的错误,说缺少动态库文件,都没说是缺少了哪个库

-> 因为此处实际上是没缺少库文件:cygmpfr-4.dll

->而只是载入了错误的cygmpfr-4.dll,从而导致出错的

40.另外顺便提示一句:

很久之前,就遇到类似的问题,并且整理过了:

【基本解决】Cygwin中运行程序出现错误:error while loading shared libraries: ?: cannot open shared object file: No such file or directory

41.至此,算是完全明白错误原因了。

但是,对于为何buildroot会在host/usr/bin中生成这个cygmpfr-4.dll,则要去找找原因,看看是为何:

【记录】尝试去搞懂cygwin下编译buildroot期间,对于mpfr是如何编译生成并安装cygmpfr-4.dll到buildroot的output/host/usr/bin目录下的

42.搞懂了逻辑后,现在结论和办法就清楚了:

此处,cygwin下编译buildroot,对于mpfr,最终生成cygmpfr-4.dll并安装到:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

是正常的步骤。

所以无需去规避。

所以,剩下的,解决此处问题的最佳办法就是:

把/bin放到PATH前面,即可。

43.所以,再去验证一下上述办法:

(1)关闭cygwin窗口。

(2)去修改.bashrc文件:

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

把PATH中的/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

所以,问题就变为:

buildroot在编译期间,把host/usr等路径,放到了PATH的前面了,导致传入libtool的./configure中的PATH是

先host/usr等路径,再是PATH等路径的。

所以,那再去参考之前的:

【已解决】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

然后发现对应的:

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

去改为:

# 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/"

(3)重新打开cygwin窗口,然后再去buildroot中make,看看结果:

然后就的确可以了:

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05
$ make
>>> 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/c/Program Files/TortoiseSVN/bin:/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/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... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc accepts -g... yes
checking for /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /bin/gcc option to accept ISO C89... none needed
checking for style of include used by make...

如图:

buildroot libtool checking whether the C compiler works yes

至此,算是彻底解决了。

 

【总结】

现象:

在cygwin下,编译buildroot期间,在libtool的./configure的配置的时候,出现:

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

现象,对应的config.log文件:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\buildroot\buildroot-2013.05\output\build\host-libtool-2.2.10\config.log

中的根本错误是:

checking for C compiler version

期间,cc1编译出错:

/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

其根本原因是:

./configure去配置libtool时,传递的PATH环境变量中

buildroot的output/host/usr/bin路径、

(此处是:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

放在了

/bin

之前,即:

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

而使得

libtool的./configure期间,去检查c编译器版本,去调用cc1去编译测试程序:

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/ccache /usr/bin/gcc -O2 -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -I/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/include -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 conftest.c

时,内部的执行过程是,先去搜索cc1所依赖的各种库函数,其中就有cygmpfr-4.dll这个库文件。

而此处,

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin

下面,也有之前buildroot编译mpfr所生成并安装到此文件夹的cygmpfr-4.dll

导致:

cc1先搜到的cygmpfr-4.dll是buildroot编译mpfr所生成的

/home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll

而不是正常的,其所依赖的,cygwin的bin目录下的cygmpfr-4.dll

/bin/cygmpfr-4.dll

从而导致报此错误。

 

解决办法:

主要思路是:确保/bin是放在host/usr/bin的之前,就可以了。

所以,目前的,相对最好的,一劳永逸的解决办法是:

去修改buildroot下面的package\Makefile.in,即:

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

中,把PATH放到HOST_DIR之前即可。

即从:

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

去改为:

# 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/"

即可。

 

一些提示:

1.cc1所依赖的库函数可以通过cygcheck而查到

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$ cygcheck /usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe
D:\tmp\tmp_dev_root\cgwin\lib\gcc\i686-pc-cygwin\4.5.3\cc1.exe
  D:\tmp\tmp_dev_root\cgwin\bin\cygcloog-0.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygwin1.dll
      C:\Windows\system32\KERNEL32.dll
        C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
        C:\Windows\system32\ntdll.dll
        C:\Windows\system32\KERNELBASE.dll
        C:\Windows\system32\API-MS-Win-Core-ProcessThreads-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Heap-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Memory-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Handle-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Synch-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-File-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-IO-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ThreadPool-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-LibraryLoader-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-NamedPipe-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Misc-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-SysInfo-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Localization-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-String-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Debug-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-ErrorHandling-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Fibers-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Util-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Core-Profile-L1-1-0.dll
        C:\Windows\system32\API-MS-Win-Security-Base-L1-1-0.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cyggmp-10.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygppl_c-4.dll
      D:\tmp\tmp_dev_root\cgwin\bin\cygppl-9.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cyggcc_s-1.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cygstdc++-6.dll
        D:\tmp\tmp_dev_root\cgwin\bin\cyggmpxx-4.dll
      D:\tmp\tmp_dev_root\cgwin\bin\cygpwl-5.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cyggmp-3.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygiconv-2.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygintl-8.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygmpc-1.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygmpfr-1.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygmpfr-4.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygppl_c-2.dll
    D:\tmp\tmp_dev_root\cgwin\bin\cygppl-7.dll
  D:\tmp\tmp_dev_root\cgwin\bin\cygz.dll

CLi@PC-CLI-1 ~/develop/buildroot/buildroot-2013.05/output/build/host-libtool-2.2.10
$

其中:

  • D:\tmp\tmp_dev_root\cgwin\bin 对应着 cygwin的/bin路径;
  • C:\Windows\system32 对应着cygwin的/cygdrive/c/Windows/System32路径;

2.cc1所找不到库,且也没说明,具体是缺少什么库

如果你去网上搜

cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

更多时候,都是搜到的是类似于:

cc1.exe: error while loading shared libraries: cygmpfr-1.dll: cannot open shared object file: No such file or directory

/usr/lib/gcc/i686-pc-cygwin/4.5.3/cc1.exe: error while loading shared libraries: cygmpfr-4.dll: cannot open shared object file: No such file or directory

的,即:

cc1是的确没找到某个dll库而报错的。

而此处的错误是:

cc1.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

即,问号,没说明,具体是缺少哪个dll库。

那是因为:

此处是找到了cygmpfr-4.dll,但是找的是错误的cygmpfr-4.dll,即属于误用了cygmpfr-4.dll,所以,出现异常。

但是报错时,却不提示缺少哪个库,实际上是库文件错误。

本质上,应该是类似于这样的错误提示:

cc1.exe: error while loading shared libraries: /home/CLi/develop/buildroot/buildroot-2013.05/output/host/usr/bin/cygmpfr-4.dll

才对。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量