On 27 May 2014 11:59, Denys Dmytriyenko denis@denix.org wrote:
On Tue, May 27, 2014 at 11:17:47AM +0800, Zhenqiang Chen wrote:
On 27 May 2014 10:17, Denys Dmytriyenko denis@denix.org wrote:
Hi,
I've been having this issue with latest binary Linaro 2014.04 toolchain from http://releases.linaro.org/14.04/components/toolchain/binaries/gcc-linaro-ar...
It comes with own sysroot, but linker fails to locate /lib/ld-linux-armhf.so.3
$ make arm-linux-gnueabihf-gcc -I/tmp/include/libnl3/ -DCONFIG_LIBNL32 -c -o nvs.o nvs.c arm-linux-gnueabihf-gcc -I/tmp/include/libnl3/ -DCONFIG_LIBNL32 -c -o misc_cmds.o misc_cmds.c arm-linux-gnueabihf-gcc -I/tmp/include/libnl3/ -DCONFIG_LIBNL32 -c -o calibrator.o calibrator.c arm-linux-gnueabihf-gcc -I/tmp/include/libnl3/ -DCONFIG_LIBNL32 -c -o plt.o plt.c arm-linux-gnueabihf-gcc -I/tmp/include/libnl3/ -DCONFIG_LIBNL32 -c -o wl18xx_plt.o wl18xx_plt.c arm-linux-gnueabihf-gcc -I/tmp/include/libnl3/ -DCONFIG_LIBNL32 -c -o ini.o ini.c arm-linux-gnueabihf-gcc -L/tmp/lib/ nvs.o misc_cmds.o calibrator.o plt.o wl18xx_plt.o ini.o -lm -lnl-3 -lnl-genl-3 -o calibrator /opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/ld-linux-armhf.so.3 collect2: error: ld returned 1 exit status Makefile:26: recipe for target 'all' failed make: *** [all] Error 1
And when I pass my own sysroot, it works fine.
Is it supposed to work as a standalone toolchain with its own bundled sysroot?
It should work as a standalone toolchain. Please check do you have ld-linux-armhf.so.3 at /opt/linaro-2014.04/arm-linux-gnueabihf/libc/lib/
$ ls -l /opt/linaro-2014.04/arm-linux-gnueabihf/libc/lib/ total 8 drwxr-xr-x 2 root root 4096 May 26 21:35 arm-linux-gnueabi drwxr-xr-x 2 root root 4096 May 26 21:33 arm-linux-gnueabihf lrwxrwxrwx 1 root root 38 May 22 15:11 ld-linux-armhf.so.3 -> arm-linux-gnueabihf/ld-2.19-2014.04.so lrwxrwxrwx 1 root root 36 May 22 15:11 ld-linux.so.3 -> arm-linux-gnueabi/ld-2.19-2014.04.so
If ld-linux-armhf.so.3 is there, please show us more detail log by adding option "-v" in your last step.
arm-linux-gnueabihf-gcc -v -L/tmp/lib/ nvs.o misc_cmds.o calibrator.o plt.o wl18xx_plt.o ini.o -lm -lnl-3 -lnl-genl-3 -o calibrator Using built-in specs. COLLECT_GCC=arm-linux-gnueabihf-gcc COLLECT_LTO_WRAPPER=/opt/linaro-2014.04/bin/../libexec/gcc/arm-linux-gnueabihf/4.8.3/lto-wrapper Target: arm-linux-gnueabihf Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.8-2014.04/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --enable-multilib --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.8-2014.04 - Linaro GCC 4.8-2014.04' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-mode=thumb --with-float=hard Thread model: posix gcc version 4.8.3 20140401 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2014.04 - Linaro GCC 4.8-2014.04) COMPILER_PATH=/opt/linaro-2014.04/bin/../libexec/gcc/arm-linux-gnueabihf/4.8.3/:/opt/linaro-2014.04/bin/../libexec/gcc/arm-linux-gnueabihf/:/opt/linaro-2014.04/bin/../libexec/gcc/:/opt/linaro-2014.04/bin/../libexec/gcc/arm-linux-gnueabihf/:/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ LIBRARY_PATH=/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/:/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/:/opt/linaro-2014.04/bin/../lib/gcc/:/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/:/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/lib/:/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf/:/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/lib/:/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf/:/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/:/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib/:/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/ COLLECT_GCC_OPTIONS='-v' '-L/tmp/lib/' '-o' 'calibrator' '-march=armv7-a' '-mtune=cortex-a9' '-mfloat-abi=hard' '-mfpu=vfpv3-d16' '-mthumb' '-mtls-dialect=gnu' /opt/linaro-2014.04/bin/../libexec/gcc/arm-linux-gnueabihf/4.8.3/collect2 --sysroot=/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc --build-id --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi -o calibrator /opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/crt1.o /opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/crti.o /opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/crtbegin.o -L/tmp/lib/ -L/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3 -L/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf -L/opt/linaro-2014.04/bin/../lib/gcc -L/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf -L/opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/lib -L/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf -L/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/lib -L/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf -L/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf -L/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib -L/opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf nvs.o misc_cmds.o calibrator.o plt.o wl18xx_plt.o ini.o -lm -lnl-3 -lnl-genl-3 -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/crtend.o /opt/linaro-2014.04/bin/../arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/crtn.o /opt/linaro-2014.04/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find /lib/ld-linux-armhf.so.3 collect2: error: ld returned 1 exit status Makefile:26: recipe for target 'all' failed make: *** [all] Error 1
It seams correct. I downloaded the toolchain and tried to build a small project. It worked.
Can you create a sample project for us to reproduce your issue?
Thanks! -Zhenqiang