【未解决】crosstool-ng编译出错:Installing C library headers中的make[3]: xxx/sys-root/usr/include/sys/uio.h] Error 1

【背景】

折腾:

【记录】crosstool为xscale编译(ct-ng build)过程

期间,出错了:

[INFO ]  Installing C library headers
[EXTRA]    Configuring C library
[EXTRA]    Installing C library headers
[ERROR]    make[3]: *** [/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include/sys/uio.h] Error 1
[ERROR]    make[2]: *** [misc/install-headers] Error 2
[ERROR]    make[1]: *** [install-headers] Error 2
[ERROR]    Build failed in step 'Installing C library headers'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/build/libc/glibc.sh' at line # 175 in function 'do_libc_headers'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh' at line # 597 in function 'main'
[ERROR]    Look at '/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/build.log' for more info on this error.
[ERROR]  (elapsed: 76:07.10)
[76:12] / /opt/crosstool-ng/bin/ct-ng:143: recipe for target `build' failed
make: *** [build] Error 2

 

其中,编译的时候,用的是多线程编译:

ct-ng build.4

【解决过程】

1.去看了下log:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\crosstool-ng\x-tools\arm-xscale-linux-gnueabi\build.log

相关的内容是:

[ALL  ]    make[3]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/src/glibc-2.9/resource'
[ALL  ]    /usr/bin/make -j4 subdir=misc -C misc ..=../ install-headers
[ALL  ]    make[3]: Entering directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/src/glibc-2.9/misc'
[ALL  ]    .././scripts/mkinstalldirs /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc
[ALL  ]    mkdir /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc
[ALL  ]    {  echo '/* Generated at libc build time from kernel syscall list.  */'; echo '';  echo '#ifndef _SYSCALL_H';  echo '# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."';  echo '#endif';  echo '';  /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/gcc-core-static/bin/arm-xscale-linux-gnueabi-gcc -E -MD -MP -MF /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.d-t1 -MT '/home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.d'        -x c -nostdinc -isystem /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/gcc-core-static/lib/gcc/arm-xscale-linux-gnueabi/4.4.3/include -isystem /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/gcc-core-static/lib/gcc/arm-xscale-linux-gnueabi/4.4.3/include-fixed -isystem /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include ../sysdeps/unix/sysv/linux/sys/syscall.h          -D_LIBC -dM |  sed -n 's@^#define __NR_([^ ]*) .*$@#define SYS_1 __NR_1@p' |  LC_ALL=C sort > /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new32;  /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/gcc-core-static/bin/arm-xscale-linux-gnueabi-gcc -E -MD -MP -MF /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.d-t2 -MT '/home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.d'        -x c -nostdinc -isystem /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/gcc-core-static/lib/gcc/arm-xscale-linux-gnueabi/4.4.3/include -isystem /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/gcc-core-static/lib/gcc/arm-xscale-linux-gnueabi/4.4.3/include-fixed -isystem /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include ../sysdeps/unix/sysv/linux/sys/syscall.h          -D_LIBC -dM |  sed -n 's@^#define __NR_([^ ]*) .*$@#define SYS_1 __NR_1@p' |  LC_ALL=C sort > /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new64;  if cmp -s /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new32 /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new64; then    cat /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new32;  else    echo '#include <bits/wordsize.h>';    echo '';    LC_ALL=C comm -12 /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new32 /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new64;    echo '#if __WORDSIZE == 64';    LC_ALL=C comm -13 /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new32 /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new64;    echo '#else';    LC_ALL=C comm -23 /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new32 /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new64;    echo '#endif';  fi;  rm -f /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new32 /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new64; } > /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers/misc/syscall-list.h.new
[ALL  ]    /bin/sh: line 7: /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/gcc-core-static/bin/arm-xscale-linux-gnueabi-gcc: Cannot allocate memory
[ALL  ]    /bin/sh: line 10: /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/tools/bin/sed: Cannot allocate memory
[ALL  ]    /bin/sh: line 12: /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/gcc-core-static/bin/arm-xscale-linux-gnueabi-gcc: Cannot allocate memory
[ALL  ]    /bin/sh: line 16: /usr/bin/sort: Cannot allocate memory
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/tools/bin/sed: line 2: /usr/bin/sed: Cannot allocate memory
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/tools/bin/sed: line 2: /usr/bin/sed: No error
[ALL  ]    /bin/sh: line 17: /usr/bin/cmp: Cannot allocate memory
[ALL  ]    /bin/sh: line 22: /usr/bin/comm: Cannot allocate memory
[ALL  ]    /bin/sh: line 24: /usr/bin/comm: Cannot allocate memory
[ALL  ]    /bin/sh: line 26: /usr/bin/comm: Cannot allocate memory
[ALL  ]    /bin/sh: line 29: /usr/bin/rm: Cannot allocate memory
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/tools/bin/install -c -m 644 sys/uio.h /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include/sys/uio.h
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/tools/bin/install -c -m 644 ../sysdeps/unix/sysv/linux/bits/uio.h /home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include/bits/uio.h
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/tools/bin/install: line 2: /usr/bin/install: Cannot allocate memory
[ALL  ]    /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/tools/bin/install: line 2: /usr/bin/install: No error
[ALL  ]    ../Makerules:1111: recipe for target `/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include/sys/uio.h' failed
[ERROR]    make[3]: *** [/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include/sys/uio.h] Error 1
[ALL  ]    make[3]: *** Waiting for unfinished jobs....
[ALL  ]    make[3]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/src/glibc-2.9/misc'
[ALL  ]    Makefile:207: recipe for target `misc/install-headers' failed
[ERROR]    make[2]: *** [misc/install-headers] Error 2
[ALL  ]    make[2]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/src/glibc-2.9'
[ALL  ]    Makefile:12: recipe for target `install-headers' failed
[ERROR]    make[1]: *** [install-headers] Error 2
[ALL  ]    make[1]: Leaving directory `/home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/arm-xscale-linux-gnueabi/build/build-libc-headers'
[ERROR]    Build failed in step 'Installing C library headers'
[ERROR]    Error happened in '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/functions' in function 'CT_DoExecLog' (line unknown, sorry)
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/build/libc/glibc.sh' at line # 175 in function 'do_libc_headers'
[ERROR]          called from '/opt/crosstool-ng/lib/ct-ng-1.9.3/scripts/crosstool-NG.sh' at line # 597 in function 'main'
[ERROR]    Look at '/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/build.log' for more info on this error.
[ERROR]  (elapsed: 76:07.10)

2.所以,看起来,第一个错误是:

/bin/sh: line 10: /home/CLi/develop/crosstool-ng/crosstool-ng-1.9.3_build/targets/tools/bin/sed: Cannot allocate memory

但是不应该啊,当前pc是8GB内存,肯定够分配的。

3.看到:

Error building crossgcc on cygwin

说是,让去找crosstool-ng方面,问这类问题。

4.另外,想起来一个事情,就是之前遇到了几次的:

【未解决】firefox的CPU占用率太高而多次崩溃

感觉,就像是,此刻,估计被编译

算了,再去重新编译一次,这次不用多线程的:

ct-ng build

看看结果如何。

如果到时候再出错,考虑换用最新版本的crosstool-ng:

crosstool-ng-1.18.0.tar.bz2

5.另外,看到:

/home/CLi/develop/crosstool-ng/x-tools/arm-xscale-linux-gnueabi/arm-xscale-linux-gnueabi//sys-root/usr/include/sys/uio.h

觉得也不太对,毕竟,路径

arm-xscale-linux-gnueabi//sys-root

中包含两个斜杠,就不太对。

 

【总结】

后来,由于,编译太耗时间了。

所以,决定:

中断编译

放弃放弃当前版本的crosstool-ng-1.9.3

换用最新的:crosstool-ng-1.18.0.tar.bz2



发表评论

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

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