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

【记录】cygwin下在针对arm920t去ct-ng menuconfig配置后去ct-ng build去编译

crosstool-ng crifan 3493浏览 0评论

【背景】

折腾:

【记录】Cygwin下安装crosstool-ng后去为arm920t制作交叉编译器

期间,在用ct-ng menuconfig去配置:

【记录】Cygwin下为arm920t配置crosstool-ng

后,此处就可以去ct-ng build去编译了。

【折腾过程】

1.直接去ct-ng build,结果出现了之前就遇到的错误:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng build
[INFO ]  Performing some trivial sanity checks
[ERROR]  Your file system in '/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build' is *not* case-sensitive!
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step '(top-level)'
[ERROR]  >>
[ERROR]  >>  Error happened in: CT_Abort[scripts/functions@331]
[ERROR]  >>        called from: CT_TestAndAbort[scripts/functions@351]
[ERROR]  >>        called from: main[scripts/crosstool-NG.sh@90]


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>

所以,参考:

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

去改注册表,重启win7。

注:

其实之前也看到有说别的解决办法,说是cygwin启动时,挂载为managed,好像也可以。

但是暂时不去弄那个,还是用之前的方式,暂时解决此问题:

去改:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel

中的

obcaseinsensitive=0

即可:

set obcaseinsensitive from 1 to 0

2.重启后,继续编译:

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 20130829.233429
[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.72s (at 00:27)
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[EXTRA]    Retrieving 'make-3.81'
[EXTRA]    Saving 'make-3.81.tar.bz2' to local storage
[EXTRA]    Using 'linux-custom' from custom location
[EXTRA]    Retrieving 'gmp-4.3.2'
[EXTRA]    Saving 'gmp-4.3.2.tar.bz2' to local storage
[EXTRA]    Retrieving 'mpfr-2.4.2'
[EXTRA]    Saving 'mpfr-2.4.2.tar.xz' to local storage
[EXTRA]    Retrieving 'libelf-0.8.13'
[EXTRA]    Saving 'libelf-0.8.13.tar.gz' to local storage
[EXTRA]    Retrieving 'binutils-2.20.1a'
[03:48] / /opt/crosstool-ng/bin/ct-ng:148: recipe for target `build' failed
make: *** [build] Interrupt

3.期间,为了加快速度,手动终止编译,手动去下载了一下包文件:

http://ftp.gnu.org/gnu/binutils/binutils-2.20.1a.tar.bz2

http://cbuild.validation.linaro.org/snapshots/eglibc-2_17.tar.bz2

http://ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.bz2

然后就下载完毕,进入解压,打包,安装的阶段:

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 20130829.234101
[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.73s (at 00:31)
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[EXTRA]    Using 'linux-custom' from custom location
[EXTRA]    Retrieving 'eglibc-2_17'
[EXTRA]    Saving 'eglibc-2_17.tar.bz2' to local storage
[EXTRA]    Retrieving 'eglibc-ports-2_17'
[EXTRA]    Saving 'eglibc-ports-2_17.tar.bz2' to local storage
[EXTRA]    Retrieving 'dmalloc-5.5.2'
[EXTRA]    Saving 'dmalloc-5.5.2.tgz' to local storage
[EXTRA]    Retrieving 'duma_2_5_15'
[EXTRA]    Saving 'duma_2_5_15.tar.gz' to local storage
[EXTRA]    Retrieving 'gdb-6.8a'
[EXTRA]    Saving 'gdb-6.8a.tar.bz2' to local storage
[EXTRA]    Retrieving 'ncurses-5.9'
[EXTRA]    Saving 'ncurses-5.9.tar.gz' to local storage
[EXTRA]    Retrieving 'expat-2.1.0'
[EXTRA]    Saving 'expat-2.1.0.tar.gz' to local storage
[EXTRA]    Retrieving 'ltrace_0.5.3.orig'
[EXTRA]    Saving 'ltrace_0.5.3.orig.tar.gz' to local storage
[EXTRA]    Retrieving 'strace-4.5.19'
[EXTRA]    Saving 'strace-4.5.19.tar.bz2' to local storage
[INFO ]  Retrieving needed toolchain components' tarballs: done in 459.86s (at 08:11)
[INFO ]  =================================================================
[INFO ]  Extracting, patching and installing companion tools
[EXTRA]    Extracting 'make-3.81'
[EXTRA]    Patching 'make-3.81'
[EXTRA]    =================================================================
[EXTRA]    Installing make
[EXTRA]    Installing make: done in 155.55s (at 10:50)
[INFO ]  Extracting, patching and installing companion tools: done in 158.54s (at 10:50)
[INFO ]  =================================================================
[INFO ]  Extracting and patching toolchain components
[EXTRA]    Extracting 'linux-custom'
[EXTRA]    Extracting 'gmp-4.3.2'
[EXTRA]    Patching 'gmp-4.3.2'
[EXTRA]    Extracting 'mpfr-2.4.2'
[EXTRA]    Patching 'mpfr-2.4.2'
[11:42] /

4.结果此处,由于E盘空间的问题,竟然出错了:

[INFO ]  =================================================================
[INFO ]  Extracting and patching toolchain components
[EXTRA]    Extracting 'linux-custom'
[EXTRA]    Extracting 'gmp-4.3.2'
[EXTRA]    Patching 'gmp-4.3.2'
[EXTRA]    Extracting 'mpfr-2.4.2'
[EXTRA]    Patching 'mpfr-2.4.2'
[EXTRA]    Extracting 'libelf-0.8.13'
[EXTRA]    Patching 'libelf-0.8.13'
[EXTRA]    Extracting 'binutils-2.20.1a'
[12:16] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[ERROR]
[ERROR]  >>
[12:17] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[ERROR]  >>  Build failed in step 'Extracting and patching toolchain components'
[12:17] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[ERROR]  >>        called in step '(top-level)'
[12:17] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[ERROR]  >>
[12:17] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[ERROR]  >>  Error happened in: CT_DoLog[scripts/functions@198]
[12:17] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[ERROR]  >>        called from: CT_DoExecLog[scripts/functions@257]
[12:17] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[ERROR]  >>        called from: CT_Extract[scripts/functions@926]
[12:17] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[ERROR]  >>        called from: do_binutils_extract[scripts/build/binutils/binutils.sh@33]
[12:17] / /opt/crosstool-ng/lib/ct-ng.1.18.0/scripts/functions: line 198: printf: write error: No space left on device
[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: 1
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>

所以去给E盘腾出更多空间,然后继续输入:

exit 2

去继续执行,结果还是出错了:

ct-ng:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/src> exit 2
exit

Re-trying last command.

[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Extracting and patching toolchain components'
[ERROR]  >>        called 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>

算了,先去clean一遍:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng clean
  CLEAN config
  CLEAN config.gen
  CLEAN log

然后再重新继续ct-ng build吧。

5.继续去ct-ng build编译之前,想起来一个事情:

根据自己教程中总结的:

多线程编译以节省时间

此处的多线程数,应该是CPU核数的2倍。

此处我的是2核的,所以应该设置成4比较好。

所以去确认一下是否是4:

Administrator@PC-20130611GART /home/develop/crosstool-ng/crosstool-ng-1.18.0_build
$ ct-ng menuconfig
  LN    config
  MKDIR config.gen
  IN    config.gen/arch.in
  IN    config.gen/kernel.in
  IN    config.gen/cc.in
  IN    config.gen/binutils.in
  IN    config.gen/libc.in
  IN    config.gen/debug.in
  CONF  config/config.in

结果果真是2:

(2) Number of parallel jobs

去改为4:

(4) Number of parallel jobs

然后开始ct-ng build编译:

6.结果出错:

【已解决】cygwin下ct-ng build编译crosstool-ng出错:The ‘binutils-2.20.1a’ sources were partially extracted. Please remove first

7.继续编译,结果出错:

【已解决】cygwin下编译crosstool-ng出错:make Error 254,1 [main] sh 7800 child_info_fork::abort: can’t commit memory for stack 0x28A000(90112), Win32 error 487

8.然后又出错:

【或许解决】cygwin中编译crosstool-ng在Installing C library headers & start files阶段出错:configure: error: support for the tls_model attribute is required

9.接着继续去解决:

【未解决】cygwin下编译crosstool-ng期间在配置eglibc时出现警告:checking add-on ports for preconfigure fragments… aarch64 alpha am33 arm arm/preconfigure: Did not find ARM architecture type; using default

10.接着,又出现其他错误:

【已解决】cygwin中编译crosstool-ng在eglibc 2.17中的rpc_parse.c出错:rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

11.继续编译,又出现:

【已解决】cygwin下编译crosstool-ng在Building C library时出错:../wcsmbs/uchar.h:47:5: error: #error "<uchar.h> requires ISO C11 mode"

12.然后又出现:

【未解决】cygwin下编译crosstool-ng在Installing C library的Building C library出错:rpc/types.h:73:18: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘u_char’

13.接着又出现:

【未解决】cygwin下编译crosstool-ng在Installing C library的Building C library阶段出错:/home/develop/crosstool-ng/crosstool-ng-1.18.0_build/.build/arm-arm920t-linux-gnueabi/build/build-libc-final/sunrpc/cross-rpc_main.o:rpc_main.c:(.text+0x537): undefined reference to `_libintl_gettext’

14.

 

【总结】

转载请注明:在路上 » 【记录】cygwin下在针对arm920t去ct-ng menuconfig配置后去ct-ng build去编译

发表我的评论
取消评论

表情

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

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