Yocto Eclipse ADT 插件在配置期间失败

Yocto Eclipse ADT plugin fails during configure

我正在尝试使用 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,我的 sysroot 指向 /opt/poky/2.0/sysroots/x86-poky-linux

我能够使用这个环境编译一个 "Hello, world" 程序,但是对于一个更大的项目,我在构建项目步骤中遇到了错误。

这是我 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,但我不知道是哪一个,我觉得我可能错过了一些关键的步。是什么导致了这个错误?我是否错误配置了我的环境?

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

This will happen only on 64 bit systems, the cause is the fact that 32 bit libraries are missing from the system, so you can easily fix this issue by installing the 32 bit libraries on your system.

So if you encounter this error /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory this is how you can fix it:

修复它:

On any RPM based distribution (CentOS/RedHat/Fedora/Suse/Mandriva):

yum -y install glibc.i686

On any DEB based distribution (Debian/Ubuntu/Mint/Crunchbang):

apt-get update
apt-get install ia32-libs