2015-11-25 96 views
0

我正在尝试使用Yocto Project Eclipse ADT插件,该插件使用手册作为参考,这是通过运行bitbake <recipename> -c populate_sdk创建的独立预构建工具链,然后运行poky-glibc-x86_64-<recipename>-x86-toolchain-2.0.sh,指定默认位置。我从opt/poky/2.0获取了环境设置。我的工具链根位置指向/opt/poky/2.0,我的系统根指向/opt/poky/2.0/sysroots/x86-poky-linuxYocto Eclipse ADT插件在配置过程中失败

我可以使用这个环境编译一个“Hello,world”程序,但是对于一个更大的项目,我在Build Project步骤中遇到了错误。

这里是我的config.log的相关部分:

Configured with: /home/presslertj/poky/build/tmp/work-shared/gcc-5.2.0-r0/gcc-5.2.0/configure --build=x86_64-linux --host=x86_64-pokysdk-linux --target=i586-poky-linux --prefix=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr --exec_prefix=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr --bindir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux --sbindir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux --libexecdir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/libexec/i586-poky-linux --datadir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/share --sysconfdir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/etc --sharedstatedir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/com --localstatedir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/var --libdir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/lib/i586-poky-linux --includedir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/include --oldincludedir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/include --infodir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/share/info --mandir=/opt/poky/2.0/sysroots/x86_64-pokysdk-linux/usr/share/man --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot=/home/presslertj/poky/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-gnu-ld --enable-shared --enable-languages=c,c++ --enable-threads=posix --enable-multilib --enable-c99 --enable-long-long --enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=i586-poky-linux- --without-local-prefix --enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap --disable-libmudflap --with-system-zlib --with-linker-hash-style=gnu --enable-linker-build-id --with-ppl=no --with-cloog=no --enable-checking=release --enable-cheaders=c_global --without-isl --with-gxx-include-dir=/not/exist/usr/include/c++/5.2.0 --with-build-time-tools=/home/presslertj/poky/build/tmp/sysroots/x86_64-linux/usr/i586-poky-linux/bin --with-sysroot=/not/exist --with-build-sysroot=/home/presslertj/poky/build/tmp/sysroots/piu --enable-targets=all --enable-poison-system-directories --with-mpfr=/home/presslertj/poky/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --with-mpc=/home/presslertj/poky/build/tmp/sysroots/x86_64-nativesdk-pokysdk-linux --enable-nls --enable-__cxa_atexit 
Thread model: posix 
gcc version 5.2.0 (GCC) 
configure:2971: $? = 0 
configure:2960: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -V >&5 
i586-poky-linux-gcc: error: unrecognized command line option '-V' 
i586-poky-linux-gcc: fatal error: no input files 
compilation terminated. 
configure:2971: $? = 1 
configure:2960: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -qversion >&5 
i586-poky-linux-gcc: error: unrecognized command line option '-qversion' 
i586-poky-linux-gcc: fatal error: no input files 
compilation terminated. 
configure:2971: $? = 1 
configure:2991: checking whether the C compiler works 
configure:3013: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5 
configure:3017: $? = 0 
configure:3065: result: yes 
configure:3068: checking for C compiler default output file name 
configure:3070: result: a.out 
configure:3076: checking for suffix of executables 
configure:3083: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5 
configure:3087: $? = 0 
configure:3109: result: 
configure:3131: checking whether we are cross compiling 
configure:3139: i586-poky-linux-gcc -m32 -march=pentium-m --sysroot=/opt/poky/2.0/sysroots/x86-poky-linux -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c >&5 
configure:3143: $? = 0 
configure:3150: ./conftest 
/home/presslertj/workspace/HMM/configure: ./conftest: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 
configure:3154: $? = 126 
configure:3161: error: in `/home/presslertj/workspace/HMM': 
configure:3163: error: cannot run C compiled programs. 
If you meant to cross compile, use `--host'. 

我认为这是最重要的行可能是:

/home/presslertj/workspace/HMM/configure: ./conftest: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

它看起来对我来说,它是找错了地方为ld-linux.so.2。 此外,在运行时所建,Eclipse的终端吐出来的是以下行:

ENV key HOST_CC_ARCH is NULL 
ENV key TOOLCHAIN_OPTIONS is NULL 
ENV key SELECTED_OPTIMIZATION is NULL 
ENV key TARGET_ARCH is NULL 
ENV key OECMAKE_C_LINK_FLAGS is NULL 
ENV key OECMAKE_CXX_LINK_FLAGS is NULL 
ENV key STAGING_DIR_HOST is NULL 
ENV key STAGING_DIR_NATIVE is NULL 
ENV key CROSS_DIR is NULL 
ENV key OECMAKE_EXTRA_ROOT_PATH is NULL 
ENV key EXTERNAL_TOOLCHAIN is NULL 
ENV key STAGING_DATADIR is NULL 

我猜测,需要这些变量中的一个,使LD-linux.so.2发现所定,但我不不知道哪个,我觉得我可能已经错过了一些关键的步骤。什么导致了这个错误?我的环境配置有误吗?

+0

如果'apt-get install ia32-libs'会怎么样?见http://www.howtodoityourself.org/how-to-fix-libld-linux-so-2-bad-elf-interpreter-no-such-file-or-directory.html – fedorqui

+0

我试过并解决了这个问题错误。我曾假设我应该使用预建的工具链的链接器/加载器,但我想我是过度思考。如果你让这个答案,我会接受它。 – karobar

回答

0

如阅读How to fix /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

会发生这种情况仅在64位系统上,原因是,32个 位库系统缺失,所以你可以很容易地通过安装解决这个 问题系统上的32位库。

所以,如果你遇到这样的错误/lib/ld-linux.so.2:坏ELF 解释:没有这样的文件或目录,这是你如何解决这个问题:

要解决这个问题:

在任何基于RPM分布(CentOS的/红帽/ Fedora的/粟色/的Mandriva):

yum -y install glibc.i686 

在任何基于DEB分布(于Debian/Ubuntu /薄荷/ Crunchbang):

apt-get update 
apt-get install ia32-libs