2015年(9)
分类: LINUX
2015-09-25 13:14:11
--- original/bin/Ltibutils.pm 2012-08-15 12:04:53.728901999 -0500
+++ ltib/bin/Ltibutils.pm 2012-08-15 12:12:01.916901781 -0500
@@ -562,7 +562,7 @@
binutils => 'ar --version 2>/dev/null',
'gcc-c++' => 'g++ --version 2>/dev/null',
glibc => 'ldd --version 2>/dev/null',
- 'glibc-devel' => sub { -f '/usr/lib/libm.so' || -f '/usr/lib64/libm.so' || -f '/usr/lib32/libm.so' || -f '/usr/lib/x86_64-linux-gnu/libm.so' || -f '/usr/lib/i386-linux-gnu/libm.so' },
+ 'glibc-devel' => sub { -f '/usr/lib/libm.so' || -f '/usr/lib64/libm.so' || -f '/usr/lib32/libm.so' || -f '/usr/lib/x86_64-linux-gnu/libm.so' || -f '/usr/lib/i386-linux-gnu/libm.so' || -f '/usr/lib64/libz.so' },
'glibc-headers' => sub { -f '/usr/include/stdio.h' },
'libstdc++' => sub { return system_nb(<<TXT) == 0;
@@ -585,6 +585,7 @@
zlib => sub { my @f = (glob('/usr/lib/libz.so*'),
glob('/lib/libz.so*'),
glob('/lib64/libz.so*'),
+ glob('/lib/i386-linux-gnu/libz.so*'),
glob('/usr/lib/i386-linux-gnu/libz.so*'),
glob('/usr/lib32/libz.so*'),
glob('/usr/lib/x86_64-linux-gnu/libz.so*') ); @f > 1 ? 1 : 0 },
哪个路径没有,添加哪个路径。
错误2:
You don't have a working TeX binary installed, but the texi2dvi script
can't proceed without it. If you want to use this script, you have to
install some kind of TeX, for example TeX Live Debian packages. You can do that with this command:
apt-get install texlive
make[2]: *** [flex.pdf] Error 1
make[2]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/flex-2.5.37/doc'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/opt/freescale/ltib/usr/src/rpm/BUILD/flex-2.5.37'
make: *** [install] Error 2
error: Bad exit status from /home/cody/i.mx6/ltib/tmp/rpm-tmp.99407 (%install)
RPM build errors:
Bad exit status from /home/cody/i.mx6/ltib/tmp/rpm-tmp.99407 (%install)
Build time for flex: 27 seconds
Failed building flex
Died at ./ltib line 1392.
traceback:
main::build_host_rpms:1392
main::host_checks:1447
main:554
解决: sudo apt-get install texinfo sudo apt-get install texlive 错误3:
Build path taken because: directory build, no prebuilt rpm,
Cowardly refusing to clobber existing directory:
/opt/freescale/ltib/usr/src/rpm/BUILD/flex-2.5.37
Remove this by hand if you really want to rebuild this package from scratch
Died at ./ltib line 1392.
traceback:
main::build_host_rpms:1392
main::host_checks:1447
main:554
解决: sudo rm -Rf /opt/freescale/ltib/usr/src/rpm/BUILD/flex-2.5.37 sudo rm -Rf /opt/freescale/ltib/usr/src/rpm/BUILD/libtool-2.4.2错误4:
/opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-3.0.35-4.0.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-3.0.35-4.0.0/bld/linux'
make: *** [all] Error 2
error: Bad exit status from /home/cody/i.mx6/ltib/tmp/rpm-tmp.77914 (%build)
RPM build errors:
Bad exit status from /home/cody/i.mx6/ltib/tmp/rpm-tmp.77914 (%build)
Build time for elftosb: 1 seconds
Failed building elftosb
Died at ./ltib line 1392.
traceback:
main::build_host_rpms:1392
main::host_checks:1447
main:554
解决:将下面内容保存为:elftosb-types_h-fix.patch并放在/opt/freescale/pkgs/目录
diff -rupN elftosb-11.09.01/common/stdafx.h elftosb-11.09.01-new/common/stdafx.h
--- elftosb-11.09.01/common/stdafx.h 2011-03-01 05:05:19.000000000 +0100
+++ elftosb-11.09.01-new/common/stdafx.h 2013-05-07 06:03:56.399989483 +0200
@@ -27,7 +27,7 @@ // For Linux systems only, types.h only defines the signed // integer types. This is not professional code. // Update: They are defined in the header files in the more recent version of redhat enterprise gcc. -#include "/usr/include/sys/types.h"
+#include
#include //typedef unsigned long uint32_t; //typedef unsigned short uint16_t; diff -rupN elftosb-11.09.01/stdafx.h elftosb-11.09.01-new/stdafx.h
--- elftosb-11.09.01/stdafx.h 2013-05-07 06:04:25.055987505 +0200
+++ elftosb-11.09.01-new/stdafx.h 2013-05-07 06:03:23.671990775 +0200
@@ -27,7 +27,7 @@ // For Linux systems only, types.h only defines the signed // integer types. This is not professional code. // Update: They are defined in the header files in the more recent version of redhat enterprise gcc. -#include "/usr/include/sys/types.h"
+#include //typedef unsigned long uint32_t; //typedef unsigned short uint16_t; //typedef unsigned char uint8_t;
再编辑文件ltib_root/dist/lfs-5.1/elftosb/elftosb.spec,增加如下红色部分内容: ... Source : %{name}-%{version}-%{release}.tar.gz Patch0 : elftosb-types_h-fix.patch BuildRoot : %{_tmppath}/%{name}... %setup -n %{name}-%{version}-%{release} %patch0 -p1 %Build make ... 再删掉/opt/freescale/ltib/usr/src/rpm/BUILD/elftosb-3.0.35-4.0.0,或其它以elftosb开头的,如有的话
注意: 在编译的过程中,你或许会遇到下面的问题:(In compile process, you will meet the following problem.)1. sys/acl.h: No such file or directory --> sudo apt-get install libacl1-dev 2. compr_lzo.c:29:23: error: lzo/lzo1x.h: No such file or directory --> sudo apt-get install liblzo-dev (Maybe use liblzo2-dev replace it) 3. uuid/uuid.h: No such file or directory --> sudo apt-get install uuid-dev 4. 到这里应该没什么错误了,再根据官方文档“i.MX_6Dual6Quad_Sabre-AI_Linux_User_Guide”来配置就OK了 5.运行./ltib 又遇到错误:
/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
collect2: ld returned 1 exit status
make: *** [busybox_unstripped] Error 1
error: Bad exit status from /home/cody/i.mx6/ltib/tmp/rpm-tmp.92805 (%build)
RPM build errors:
Bad exit status from /home/cody/i.mx6/ltib/tmp/rpm-tmp.92805 (%build)
Build time for busybox: 46 seconds
Failed building busybox
解决:
1) install patch-ltib-ubuntu12.04.sh from (https://community.freescale.com/docs/DOC-93455). 2) create a soft link under /usr/include.
sudo ln -s i386-linux-gun/sys sys
3) install additional packages.
sudo aptitude -y install asciidoc texlive-latex-base dblatex xutils-dev
sudo apt-get install texinfo
4) modify 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;
6.终于看到成功的信息 Build Succeeded