linux - ARM toolchain looks in the wrong directory for libraries -
for project need compile qt 5.9.1 generic arm device. i've set linaro's toolchain. qt configure halts @ this:
/usr/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/mnt/elvees-rootfs/ -wl,-o1 -fuse-ld=gold -o verifyspec verifyspec.o
/usr/bin/arm-linux-gnueabihf-ld.gold: error: /lib/libc.so.6: incompatible target /usr/bin/arm-linux-gnueabihf-ld.gold: error: cannot open /lib/ld-linux-armhf.so.3: no such file or directory /usr/bin/arm-linux-gnueabihf-ld.gold: error: /lib/libc_nonshared.a(elf-init.os): incompatible target ../sysdeps/arm/start.s:124: error: undefined reference '__libc_start_main' ../sysdeps/arm/start.s:128: error: undefined reference 'abort' ../sysdeps/arm/start.s:113: error: undefined reference '__libc_csu_fini' ../sysdeps/arm/start.s:120: error: undefined reference '__libc_csu_init' collect2: error: ld returned 1 exit status
from looks of it, arm-linux-gnueabihf-g++ looks libs in host's /lib/ directory, instead of sysroot's. reason such behavior , how fix it? best bet broken symlinks in mounted sysroot, i've manualy changed "libc.so.6" one, , output still same. clarify, host , target running arch.
edit
by request, here qmake.conf (that generates mkspec):
include(../common/linux_device_pre.conf) elvees_cflags = -march=armv7-a -mtune=cortex-a9 -mfpu=neon-fp16 -dlinux=1 qmake_cflags += $$elvees_cflags qmake_cxxflags += $$elvees_cflags distro_opts += hard-float qt_qpa_default_platform = eglfs include(../common/linux_arm_device_post.conf) qmake_incdir_egl = /mnt/elvees-rootfs/usr/include/egl qmake_libdir_egl = /mnt/elvees-rootfs/usr/lib qmake_incdir_opengl_es2 = /mnt/elvees-rootfs/include/gles2 qmake_libdir_opengl_es2 = /mnt/elvees-rootfs/usr/lib qmake_libs_egl = -legl qmake_libs_opengl_es2 = -lglesv2 $${qmake_libs_egl} load(qt_config)
and these qt_config options:
./configure \ -opengl es2 \ -device arch-elvees-g++ \ -device-option cross_compile=/usr/bin/arm-linux-gnueabihf- \ -sysroot /mnt/elvees-rootfs/ \ -opensource \ -confirm-license \ -optimized-qmake \ -release \ -make libs \ -prefix /opt/qt-elvees\ -no-pch \ -nomake examples \ -nomake tests \ -no-xcb \ -eglfs \ -v
apparently, adding -no-gcc-sysroot
parameter configure worked.
Comments
Post a Comment