首页 > 代码库 > Ubuntu12.04 安装ltib遇到的问题及解决办法
Ubuntu12.04 安装ltib遇到的问题及解决办法
Ubuntu12.04 安装ltib遇到的问题及解决办法
在ubuntu 12.04 上,参考《在 Ubuntu 12.04 上用 LTIB 编译 linux BSP》,
编译freescale LTIB (L3.0.35_4.1.0_130816_source.tar.gz),还是遇到
了不少问题,下面列出了问题及解决办法(很多都是google得来的)。
1.Error:
Failed building ncurses -- /bin/sh: ./gen: cannot execute binary file
Solution:
Index: dist/lfs-5.1/ncurses/ncurses.spec
===================================================================
RCS file: /sources/ltib/ltib/dist/lfs-5.1/ncurses/ncurses.spec,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 ncurses.spec
--- dist/lfs-5.1/ncurses/ncurses.spec 18 Mar 2009 17:53:25 -0000 1.1.1.5
+++ dist/lfs-5.1/ncurses/ncurses.spec 10 Jul 2009 09:19:46 -0000
@@ -31,11 +31,11 @@
then
./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} \
--with-install-prefix=$RPM_BUILD_ROOT --mandir=%{_mandir} \
- --with-shared --without-debug --without-cxx-binding
+ --with-shared --without-debug --without-cxx-binding --without-ada
else
./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} \
--with-install-prefix=$RPM_BUILD_ROOT --mandir=%{_mandir} \
- --without-shared --without-debug --without-cxx-binding
+ --without-shared --without-debug --without-cxx-binding --without-ada
fi
make -j1 HOSTCC="$BUILDCC"
2.Error:
/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 -lgssapi_krb5
/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 -lkrb5
/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 -lk5crypto
collect2: ld returned 1 exit status
make[2]: *** [libftp.la] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .deps/sftp-method.Tpo .deps/sftp-method.Plo
make[2]: Leaving directory `/home/zhushangzhi/ltib/rpm/BUILD/gnome-vfs-2.24.1/modules‘
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/zhushangzhi/ltib/rpm/BUILD/gnome-vfs-2.24.1‘
make: *** [all] Error 2
error: Bad exit status from /home/zhushangzhi/ltib/tmp/rpm-tmp.11198 (%build)
RPM build errors:
Bad exit status from /home/zhushangzhi/ltib/tmp/rpm-tmp.11198 (%build)
Build time for gnome-vfs: 418 seconds
Failed building gnome-vfs
Solution:
sudo apt-get remove krb5-multidev
I recently had trouble building gnome-vfs from a Freescale release
of LTIB and thought I‘d share my work-around.
The problem appeared as a link failure in gnome-vfs-2.24.1/modules/
with an error that "-Bsymbolic" isn‘t a supported link option by the
cross-compiler.
What I found by looking at the configure logs was that the link
flags were being leaked from the build machine into the cross-compilation
by these lines in configure.in:
AC_PATH_PROG([KRB5_CONFIG], krb5-config, none, $PATH:/usr/kerberos/bin)
if test "x$KRB5_CONFIG" != "xnone"; then
GSSAPI_LIBS="`${KRB5_CONFIG} --libs gssapi`"
GSSAPI_CFLAGS="`${KRB5_CONFIG} --cflags gssapi`"
In English, these lines will use the krb5-config to determine the compiler
and linker flags needed to support the kerberos authentication libraries
in a manner similar to pkg-config.
I suspect that a patch doctoring the PATH could prevent leakage from, but
I don‘t need kerberos on my machine, so I solved the issue in an easier
way:
~/$ sudo apt-get remove krb5-multidev
I hope this helps someone else.
http://web.archiveorange.com/archive/v/zE6LZGvcspFz1vbo4yUn
3.Error:
checking for new_panel in -lpanel... no
configure: error: panel library not found
error: Bad exit status from /home/zhushangzhi/ltib/tmp/rpm-tmp.16521 (%build)
RPM build errors:
Bad exit status from /home/zhushangzhi/ltib/tmp/rpm-tmp.16521 (%build)
Build time for alsa-utils: 22 seconds
Failed building alsa-utils
Solution:
1). Make sure if libncurses.so exist in ltib/rootfs/usr/lib/, if not, build it with command “$ ./ltib -p ncurse”.
2). Create soft link libtinfo.so to libncurse.so
$ cd rootfs/usr/lib
$ sudo ln -s libncurses.so libtinfo.so
4.Error:
gcc fbset.o modes.tab.o lex.yy.o -o fbset
fbset.o: In function `main‘:
fbset.c:(.text.startup+0x11c): undefined reference to `yyparse‘
lex.yy.o: In function `yylex‘:
lex.yy.c:(.text+0xf50): undefined reference to `yylval‘
collect2: ld returned 1 exit status
make: *** [fbset] Error 1
Solution:
Delete ltib/rpm/BUILD/fbset-2.1 , and run ./ltib again.
5.Error:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory.
Solution:
sudo apt-get install gcc-multilib
6.Error:
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
Solution:
You‘re missing the 32 bit libc dev package:
On Ubuntu it‘s called libc6-dev-i386 - do sudo apt-get install libc6-dev-i386. See below for extra instructions for Ubuntu 12.04.
On Red Hat distros, the package name is glibc-devel.i686 (Thanks to David Gardner‘s comment)
On CentOS 5.8, the package name is glibc-devel.i386 (Thanks to JimKleck‘s comment)
On CentOS 6.3, the package name is glibc-devel.i686.
On SLES it‘s called glibc-devel-32bit - do zypper in glibc-devel-32bit
Are you using Ubuntu 12.04? There is a known problem that puts the files in a non standard location. You‘ll also need to do:
export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
somewhere before you build (say in your .bashrc).
If you are also compiling C++ code, you will also need the 32 bit stdc++ library. If you see this warning:
.... /usr/bin/ld: cannot find -lstdc++ ....
On Ubuntu you will need to do sudo apt-get install g++-multilib
On CentOS 5 you will need to do yum install libstdc++-devel.i386
On CentOS 6 you will need to do yum install libstdc++-devel.i686
Please feel free to edit in the packages for other systems.
7.Error:
/usr/include/i386-linux-gnu/bits/mathinline.h error: impossible constraint in ‘asm‘
Solution:
将上面加进/etc/bash.bashrc 的
export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
去掉,然后重启ubuntu,重新./ltib即可。