为嵌入式设备构建静态Qt(交叉编译)失败

时间:2019-07-08 14:35:41

标签: linux qt

我正在尝试为我拥有的多个嵌入式设备(均带有iMX6处理器)静态构建Qt。它们都有不同版本的Qt,因此为了进行测试,我尝试静态构建Qt 5.13,以便我们可以进行一些测试。我可以为主机静态构建Qt。我的问题是我添加了用于交叉编译的选项。我使用的交叉编译工具链是armhf的debian Stretch,可与我的设备媲美,并且目前能够进行动态Qt 5.9构建。因此,我相信这应该能够构建Qt 5.13。

这是我正在运行的用于配置的命令:

./configure -static -release -verbose -opensource -ltcg -no-pch -prefix /usr/local/lib/qt5.13 -hostprefix $PWD/build/host -device linux-imx6-g++ -device-option CROSS_COMPILE=/home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/usr/bin/arm-linux-gnueabihf- -sysroot /home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/ -skip webengine -nomake tools -nomake tests -nomake examples

以下是输出:

dlogic@dlogic-vm:~/qt-everywhere-src-5.13.0$ ./configure -static -release -verbose -opensource -ltcg -no-pch -prefix /usr/local/lib/5.13 -hostprefix $PWD/build/host -device linux-imx6-g++ -device-option CROSS_COMPILE=/home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/usr/bin/arm-linux-gnueabihf- -sysroot /home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/ -skip webengine -nomake tools -nomake tests -nomake examples
+ cd qtbase
+ /home/dlogic/qt-everywhere-src-5.13.0/qtbase/configure -top-level -static -release -verbose -opensource -ltcg -no-pch -prefix /usr/local/lib/5.13 -hostprefix /home/dlogic/qt-everywhere-src-5.13.0/build/host -device linux-imx6-g++ -device-option CROSS_COMPILE=/home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/usr/bin/arm-linux-gnueabihf- -sysroot /home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/ -skip webengine -nomake tools -nomake tests -nomake examples
Creating qmake...
make: Nothing to be done for 'first'.
Command line: -static -release -verbose -opensource -ltcg -no-pch -prefix /home/dlogic/qt-everywhere-src-5.13.0/build/target -hostprefix /home/dlogic/qt-everywhere-src-5.13.0/build/host -device linux-imx6-g++ -device-option CROSS_COMPILE=/home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/usr/bin/arm-linux-gnueabihf- -sysroot /home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/ -skip webengine -nomake tools -nomake tests -nomake examples

This is the Qt Open Source Edition.

You are licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) version 3
or the GNU General Public License (GPL) version 2.

Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3).
Type 'G' to view the GNU General Public License version 2 (GPLv2).
Type 'y' to accept this license offer.
Type 'n' to decline this license offer.

Do you accept the terms of either license? y


Running configuration tests...
Checking for machine tuple... 
+ /home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/usr/bin/arm-linux-gnueabihf-g++ -dumpmachine
> /lib/ld-linux-armhf.so.3: No such file or directory
test config.qtbase.tests.machineTuple FAILED
Checking for valid makespec... 
+ cd /home/dlogic/qt-everywhere-src-5.13.0/config.tests/verifyspec && /home/dlogic/qt-everywhere-src-5.13.0/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/" "QMAKE_CXXFLAGS += --sysroot=/home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/" "QMAKE_LFLAGS += --sysroot=/home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/" -early "CONFIG += cross_compile" /home/dlogic/qt-everywhere-src-5.13.0/qtbase/config.tests/verifyspec
+ cd /home/dlogic/qt-everywhere-src-5.13.0/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
> rm -f verifyspec.o
> rm -f *~ core *.core
> /home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/usr/bin/arm-linux-gnueabihf-g++ -c -pipe -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard --sysroot=/home/dlogic/Development/fs/debian-stretch-armhf-rootfs_dl-dm-x/ -O2 -w -fPIC  -I/home/dlogic/qt-everywhere-src-5.13.0/qtbase/config.tests/verifyspec -I. -I/home/dlogic/qt-everywhere-src-5.13.0/qtbase/mkspecs/devices/linux-imx6-g++ -o verifyspec.o /home/dlogic/qt-everywhere-src-5.13.0/qtbase/config.tests/verifyspec/verifyspec.cpp
> /lib/ld-linux-armhf.so.3: No such file or directory
> Makefile:182: recipe for target 'verifyspec.o' failed
> make: *** [verifyspec.o] Error 255
Note: Also available for Linux: linux-clang linux-icc

ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

似乎是路径问题,但我不确定需要更改什么。 设备BSP的rootfs中确实存在文件/lib/ld-linux-armhf.so.3

0 个答案:

没有答案