gcc -g -I/opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/elftosb2 -I/opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/keygen -I/opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/sbtool -I/opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/common -DLinux -c /opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/common/AESKey.cpp In file included from /opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/common/AESKey.h:10:0, from /opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/common/AESKey.cpp:8: /opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/common/stdafx.h:30:36: fatal error: /usr/include/sys/types.h: No such file or directory compilation terminated. make[1]: *** [AESKey.o] Error 1 make[1]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/bld/linux' make: *** [all] Error 2 error: Bad exit status from /home/think/imx6/ltib/tmp/rpm-tmp.51338 (%build) RPM build errors: Bad exit status from /home/think/imx6/ltib/tmp/rpm-tmp.51338 (%build) Build time for elftosb: 0 seconds Failed building elftosb Died at ./ltib line 1392. traceback: main::build_host_rpms:1392 main::host_checks:1447 main:554
以上错误是因为/opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0/common/stdafx.h,包含的头文件types.h的路径
不对导致,修改stdafx.h文件:
1)cd /opt/freescale/pkgs/
2)tar zxvf elftosb-1.1.0.tar.gz
3)修改stdafx.h文件,#include"/usr/include/sys/types.h" 改成 #include"/usr/include/i386-linux-gnu/sys/types.h"
4)重新打包:
tar zcvf elftosb-1.1.0.tar.gz elftosb-1.1.0
5)rm -rf /opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-1.1.0
-
/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: cannot find /lib/libc.so.6
/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: cannot find /usr/lib/libc_nonshared.a
/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.6.2/../../../../arm-fsl-linux-gnueabi/bin/ld: cannot find /lib/ld-linux.so.3
解决方法:
编辑 ltib/dist/lfs-5.1/base_libs/base_libs.spec
找到以下行
perl -w -e '
@ARGV = grep { `file $_` =~ m,ASCII C program text, } @ARGV
exit(0) unless @ARGV;
删除.“ @ARGV = grep { `file $_` =~ m,ASCII C program text, } @ARGV”以及"exit(0) unless @ARGV;"
保存退出。