【问题】
折腾:
【记录】cygwin下在针对arm920t去ct-ng menuconfig配置后去ct-ng build去编译
期间,在cygwin下ct-ng build去编译crosstool-ng,结果出错:
Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build $ ct-ng build [INFO ] Performing some trivial sanity checks [INFO ] Build started 20130907.141734 [INFO ] Building environment variables [EXTRA] Preparing working directories [EXTRA] Installing user-supplied crosstool-NG configuration [EXTRA] ================================================================= [EXTRA] Dumping internal crosstool-NG configuration [EXTRA] Building a toolchain for: [EXTRA] build = i686-pc-cygwin [EXTRA] host = i686-pc-cygwin [EXTRA] target = arm-arm920t-linux-gnueabi [EXTRA] Dumping internal crosstool-NG configuration: done in 0.80s (at 00:33) [INFO ] ================================================================= [INFO ] Retrieving needed toolchain components' tarballs [EXTRA] Using 'linux-custom' from custom location [INFO ] Retrieving needed toolchain components' tarballs: done in 2.57s (at 00:36) [INFO ] ================================================================= [INFO ] Extracting, patching and installing companion tools [EXTRA] ================================================================= [EXTRA] Installing make [EXTRA] Installing make: done in 173.89s (at 03:30) [INFO ] Extracting, patching and installing companion tools: done in 174.61s (at 03:31) [INFO ] ================================================================= [INFO ] Extracting and patching toolchain components [ERROR] The 'binutils-2.20.1a' sources were partially extracted. [ERROR] Please remove first: [ERROR] - the source dir for 'binutils-2.20.1a', in '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src' [ERROR] - the file '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/.binutils-2.20.1a.extracting' [ERROR] I'll stop now to avoid any carnage... [ERROR] [ERROR] >> [ERROR] >> Build failed in step 'Extracting and patching toolchain components' [ERROR] >> called in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_Abort[scripts/functions@331] [ERROR] >> called from: CT_Extract[scripts/functions@901] [ERROR] >> called from: do_binutils_extract[scripts/build/binutils/binutils.sh@33] [ERROR] >> called from: main[scripts/crosstool-NG.sh@601] Current command (unknown), exited with error code: 1 Please fix it up and finish by exiting the shell with one of these values: 1 fixed, continue with next build command 3 abort build ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build>
如图:
即:
[ERROR] The 'binutils-2.20.1a' sources were partially extracted. [ERROR] Please remove first:
【解决过程】
1.看起来,这个问题,就像我之前遇到的:
然后按照此处作者的提示,去删除两个文件,然后exit 1:
看看能否解决问题。
结果还是不行:
ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> rm -rf /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/binutils-2.20.1a/ ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> rm /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/.binutils-2.20.1a.extracting ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> exit 1 exit Continuing past the failed command. [ERROR] [ERROR] >> [ERROR] >> Build failed in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_Extract[scripts/functions@90] [ERROR] >> called from: do_binutils_extract[scripts/build/binutils/binutils.sh@33] [ERROR] >> called from: main[scripts/crosstool-NG.sh@601] Current command (unknown), exited with error code: 1 Please fix it up and finish by exiting the shell with one of these values: 1 fixed, continue with next build command 3 abort build ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build>
2.那就去看看,对应的build.log文件:
E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\build.log
中的内容是什么:
结果也没看到其他内容:
[INFO ] ================================================================= [INFO ] Extracting and patching toolchain components [DEBUG] Already extracted 'gmp-4.3.2' [DEBUG] Already patched 'gmp-4.3.2' [DEBUG] Already extracted 'mpfr-2.4.2' [DEBUG] Already patched 'mpfr-2.4.2' [DEBUG] Already extracted 'libelf-0.8.13' [DEBUG] Already patched 'libelf-0.8.13' [ERROR] The 'binutils-2.20.1a' sources were partially extracted. [ERROR] Please remove first: [ERROR] - the source dir for 'binutils-2.20.1a', in '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src' [ERROR] - the file '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/.binutils-2.20.1a.extracting' [ERROR] I'll stop now to avoid any carnage... [ERROR] [ERROR] >> [ERROR] >> Build failed in step 'Extracting and patching toolchain components' [ERROR] >> called in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_Abort[scripts/functions@331] [ERROR] >> called from: CT_Extract[scripts/functions@901] [ERROR] >> called from: do_binutils_extract[scripts/build/binutils/binutils.sh@33] [ERROR] >> called from: main[scripts/crosstool-NG.sh@601] [ERROR] [ERROR] >> [ERROR] >> Build failed in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_Extract[scripts/functions@90] [ERROR] >> called from: do_binutils_extract[scripts/build/binutils/binutils.sh@33] [ERROR] >> called from: main[scripts/crosstool-NG.sh@601]
所以,还是不知道是什么特殊情况。
3.貌似是:
binutils-2.20.1a的源码包,本身有问题?
那就去看看对应的源码包:
E:\dev_install_root\cygwin\home\develop\crosstool-ng\src\binutils-2.20.1a.tar.bz2
双击,看看能否用winrar正常的打开。
确定是可以的。
并且也是可以通过7z去打开的。
说明压缩包,应该是正常的。
4.后来发现,原来是:
其实此处.build/src,即:
E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\src
中,已经是正常的,被我们删除掉那个有问题的:.binutils-2.20.1a.extracting,了。
但是,实际上,此处的.build\tarballs,即:
E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\tarballs
中,本身的tar包:binutils-2.20.1a.tar.bz2,就有问题的,是1KB的,还带个binutils-2.20.1a.tar.bz2.tmp-dl:
所以,尝试去删除掉
.build\tarballs
中的
binutils-2.20.1a.tar.bz2.tmp-dl
和
1KB的binutils-2.20.1a.tar.bz2
然后再exit 1:
看看是否有效。
结果还是不行:
ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> rm /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/tarballs/binutils-2.20.1a.tar.bz2* ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> ls .build/tarballs/ dmalloc-5.5.2.tgz expat-2.1.0.tar.gz gmp-4.3.2.tar.bz2 ltrace_0.5.3.orig.tar.gz strace-4.5.19.tar.bz2 duma_2_5_15.tar.gz gcc-4.3.2.tar.bz2 libelf-0.8.13.tar.gz make-3.81.tar.bz2 eglibc-2_17.tar.bz2 gcc-4.3.2.tar.lzma.tmp-dl linux-custom.tar.bz2 mpfr-2.4.2.tar.xz eglibc-ports-2_17.tar.bz2 gdb-6.8a.tar.bz2 ltrace-0.5.3.tar.gz ncurses-5.9.tar.gz ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> exit 1 exit Continuing past the failed command. [EXTRA] Extracting 'binutils-2.20.1a' [37:18] / bzip2: Can't open input file /home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/tarballs/binutils-2.20.1a.tar.bz2: No such file or directory. [ERROR] [ERROR] >> [ERROR] >> Build failed in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@257] [ERROR] >> called from: CT_Extract[scripts/functions@926] [ERROR] >> called from: do_binutils_extract[scripts/build/binutils/binutils.sh@33] [ERROR] >> called from: main[scripts/crosstool-NG.sh@601] Current command: 'tar' '--strip-components=1' '-C' 'binutils-2.20.1a' '-xv' '-f' '-' exited with error code: 2 Please fix it up and finish by exiting the shell with one of these values: 1 fixed, continue with next build command 2 repeat this build command 3 abort build ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src>
5.只能退出,再重新开始编译,估计就可以了。
所以去exit 3:
ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src> exit 3 exit [ERROR] >> [ERROR] >> For more info on this error, look at the file: 'build.log' [ERROR] >> There is a list of known issues, some with workarounds, in: [ERROR] >> '/opt/crosstool-ng/share/doc/crosstool-ng/ct-ng.1.18.0/B - Known issues.txt' [ERROR] [ERROR] (elapsed: 39:10.37) [39:15] / /opt/crosstool-ng/bin/ct-ng:148: recipe for target `build' failed make: *** [build] Error 2
再ct-ng build。
6.然后,这会,猜测:
E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\tarballs
下面那些都是1KB的文件,其实是对应的,crosstool-ng中的配置的src路径,此处即:
E:\dev_install_root\cygwin\home\develop\crosstool-ng\src
下面的,真正的源码包的软链接
然后去看了看,果然是的:
E:\dev_install_root\cygwin\home\develop\crosstool-ng\crosstool-ng-1.18.0_build\.build\tarballs\eglibc-2_17.tar.bz2
待会也可以去用ls命令确认一下的。
7.结果现在又是如最开始同样的错误:
[INFO ] ================================================================= [INFO ] Extracting and patching toolchain components [ERROR] The 'binutils-2.20.1a' sources were partially extracted. [ERROR] Please remove first: [ERROR] - the source dir for 'binutils-2.20.1a', in '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src' [ERROR] - the file '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src/.binutils-2.20.1a.extracting' [ERROR] I'll stop now to avoid any carnage... [ERROR] [ERROR] >> [ERROR] >> Build failed in step 'Extracting and patching toolchain components' [ERROR] >> called in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_Abort[scripts/functions@331] [ERROR] >> called from: CT_Extract[scripts/functions@901] [ERROR] >> called from: do_binutils_extract[scripts/build/binutils/binutils.sh@33] [ERROR] >> called from: main[scripts/crosstool-NG.sh@601] Current command (unknown), exited with error code: 1 Please fix it up and finish by exiting the shell with one of these values: 1 fixed, continue with next build command 3 abort build ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build>
所以,推测:
难道是最原始的,src下面的16.7MB的binutils-2.20.1a.tar.bz2,是有问题的?
所以,去网上重新下载一个完整的,看看是否和此文件一样大小。
不过,此刻,觉得貌似,和当前系统也有关系:
当前win7 x64,结果C盘只剩200多M了。
好像影响到使用了:
beyondCompare去比较两个刚刚下载的,都是正常的binutils-2.20.1a.tar.bz2,
结果说其中一个不可用。
难道是:
之前2次出错,都是由于c盘剩余空间不够,导致crosstool-ng解压期间,
没法正常解压,导致出错的???
不论如何,此处,已经将C盘,腾出5G,这下确保足够使用了。
且当前的E盘,也有超过2G的空间,也够用了。
确保不会由于空间不够而导致各种异常问题。
8.此处,去确保都是正常的,然后再试试exit 1:
ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> rm -rf .build/src/binutils-2.20.1a/ ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> rm .build/src/.binutils-2.20.1a.extracting ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> ls -lha .build/tarballs/binutils-2.20.1a.tar.bz2 lrwxrwxrwx 1 Administrator None 55 Sep 7 14:57 .build/tarballs/binutils-2.20.1a.tar.bz2 -> /home/develop/crosstool-ng/src/binutils-2.20.1a.tar.bz2 ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> ls ../src/binutils-2.20.1a.tar.bz2 -lha -rwxr-xr-x 1 Administrators None 17M Sep 7 15:05 ../src/binutils-2.20.1a.tar.bz2 ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> exit 1
结果是:
还是不行。
估计是由于没有exit 2的那种re-run current command的效果而导致的。
所以,exit 3:
ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build> exit 3 exit [ERROR] >> [ERROR] >> For more info on this error, look at the file: 'build.log' [ERROR] >> There is a list of known issues, some with workarounds, in: [ERROR] >> '/opt/crosstool-ng/share/doc/crosstool-ng/ct-ng.1.18.0/B - Known issues.txt' [ERROR] [ERROR] (elapsed: 20:53.74) [20:58] / /opt/crosstool-ng/bin/ct-ng:148: recipe for target `build' failed make: *** [build] Error 1
然后重新ct-ng build:
9.另外,发现一个不错的网站:
找某个软件包时,可以找到很多镜像mirror:
找:
binutils-2.20.1a.tar.bz2
时,找到的:
http://www.filewatcher.com/m/binutils-2.20.1a.tar.bz2.17591527-0.html
里面列了一堆的,几十个ftp地址,包含了对应的此软件包的。
以后缺少其他软件包时,可以去该网站找找。
10.然后终于可以了:
Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build $ ct-ng build [INFO ] Performing some trivial sanity checks [INFO ] Build started 20130907.151853 [INFO ] Building environment variables [EXTRA] Preparing working directories [EXTRA] Installing user-supplied crosstool-NG configuration [EXTRA] ================================================================= [EXTRA] Dumping internal crosstool-NG configuration [EXTRA] Building a toolchain for: [EXTRA] build = i686-pc-cygwin [EXTRA] host = i686-pc-cygwin [EXTRA] target = arm-arm920t-linux-gnueabi [EXTRA] Dumping internal crosstool-NG configuration: done in 0.89s (at 00:36) [INFO ] ================================================================= [INFO ] Retrieving needed toolchain components' tarballs [EXTRA] Using 'linux-custom' from custom location [INFO ] Retrieving needed toolchain components' tarballs: done in 2.87s (at 00:40) [INFO ] ================================================================= [INFO ] Extracting, patching and installing companion tools [EXTRA] ================================================================= [EXTRA] Installing make [EXTRA] Installing make: done in 176.19s (at 03:37) [INFO ] Extracting, patching and installing companion tools: done in 177.08s (at 03:37) [INFO ] ================================================================= [INFO ] Extracting and patching toolchain components [EXTRA] Extracting 'binutils-2.20.1a' [EXTRA] Patching 'binutils-2.20.1a' [EXTRA] Extracting 'gcc-4.3.2'
【总结】
此处,当cygwin下编译crosstool-ng,出现:
[INFO ] Extracting and patching toolchain components [ERROR] The 'binutils-2.20.1a' sources were partially extracted. [ERROR] Please remove first:
的错误时,我此处的原因是:
不是软件包没下载完整的问题,而是空间不够的问题。
(注:如果是软件包下载不完整,则请参考:
cygwin所在的E盘,空间不够(只有1G左右)
或者是:
当前win7 x64的系统,有问题:
C盘空间太小,当时只有300M,
由此导致解压软件包(binutils-2.20.1a)无法正常解压,导致报此错误。
解决办法:
确保你的windows系统C盘正常->剩余空间不要太小->至少也是正常的1,2G以上
cygwin所在的盘,我的是E盘,也最好有足够的空间->也最好剩余1,2G以上
转载请注明:在路上 » 【已解决】cygwin下ct-ng build编译crosstool-ng出错:The ‘binutils-2.20.1a’ sources were partially extracted. Please remove first