为Beaglebone交叉编译Qt5时发生链接错误



尊敬的stackoverflow社区。

我正在为我的Beaglebone Black与EGL支持交叉编译Qt 5.12。主机操作系统是在虚拟机中运行的Ubuntu 18.04.1 LTS(x64)。我已经在目标(以及主机上的一些)上安装了任何可能的依赖项(我可以在不同的帖子中找到),并将系统根复制到主机上。基本上,我遵循了本指南,该指南最初适用于RPi2:https://wiki.qt.io/RaspberryPi2EGLFSQt5base软件包编译得很好,至少我认为是这样。它制作并安装,但配置测试中有一些错误。我稍后会回来找他们。

现在我也尝试构建qtdeclarative。Qmake运行时没有任何错误,但make由于链接错误而失败。libQt5Core.so找不到某些引用,因为找不到一些依赖项。例如libicudata.so.57。当然,我检查了它们在sysroot下的正确位置,它们确实存在。我想最初的qtbase构建有问题,因为我在一些配置测试中遇到了类似的错误(但使用了不同的库),如果我试图构建一个示例应用程序,它也是一样的。

以下是一些信息。。。

qtbase构建中的配置命令行:

Command line: -release -opengl es2 -device linux-beagleboard-g++ -device-option CROSS_COMPILE=/home/martin/beaglebone/tools/gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /home/martin/beaglebone/sysroot -opensource -confirm-license -make libs -make tools -prefix /usr/local/qt5bbb -extprefix /home/martin/beaglebone/qt5build/qt5bbb -hostprefix /home/martin/beaglebone/qt5build/qt5 -qt-zlib -qt-libpng -no-use-gold-linker -v

所有qmake持久变量的转储:

~/beaglebone/qt5build/qt5/bin/qmake -query
QT_SYSROOT:/home/martin/beaglebone/sysroot
QT_INSTALL_PREFIX:/home/martin/beaglebone/qt5build/qt5bbb
QT_INSTALL_PREFIX/dev:/usr/local/qt5bbb
QT_INSTALL_ARCHDATA:/home/martin/beaglebone/qt5build/qt5bbb
QT_INSTALL_ARCHDATA/dev:/usr/local/qt5bbb
QT_INSTALL_DATA:/home/martin/beaglebone/qt5build/qt5bbb
QT_INSTALL_DATA/dev:/usr/local/qt5bbb
QT_INSTALL_DOCS:/home/martin/beaglebone/qt5build/qt5bbb/doc
QT_INSTALL_DOCS/dev:/usr/local/qt5bbb/doc
QT_INSTALL_HEADERS:/home/martin/beaglebone/qt5build/qt5bbb/include
QT_INSTALL_HEADERS/dev:/usr/local/qt5bbb/include
QT_INSTALL_LIBS:/home/martin/beaglebone/qt5build/qt5bbb/lib
QT_INSTALL_LIBS/dev:/usr/local/qt5bbb/lib
QT_INSTALL_LIBEXECS:/home/martin/beaglebone/qt5build/qt5bbb/libexec
QT_INSTALL_LIBEXECS/dev:/usr/local/qt5bbb/libexec
QT_INSTALL_BINS:/home/martin/beaglebone/qt5build/qt5bbb/bin
QT_INSTALL_BINS/dev:/usr/local/qt5bbb/bin
QT_INSTALL_TESTS:/home/martin/beaglebone/qt5build/qt5bbb/tests
QT_INSTALL_TESTS/dev:/usr/local/qt5bbb/tests
QT_INSTALL_PLUGINS:/home/martin/beaglebone/qt5build/qt5bbb/plugins
QT_INSTALL_PLUGINS/dev:/usr/local/qt5bbb/plugins
QT_INSTALL_IMPORTS:/home/martin/beaglebone/qt5build/qt5bbb/imports
QT_INSTALL_IMPORTS/dev:/usr/local/qt5bbb/imports
QT_INSTALL_QML:/home/martin/beaglebone/qt5build/qt5bbb/qml
QT_INSTALL_QML/dev:/usr/local/qt5bbb/qml
QT_INSTALL_TRANSLATIONS:/home/martin/beaglebone/qt5build/qt5bbb/translations
QT_INSTALL_TRANSLATIONS/dev:/usr/local/qt5bbb/translations
QT_INSTALL_CONFIGURATION:/home/martin/beaglebone/qt5build/qt5bbb/etc/xdg
QT_INSTALL_CONFIGURATION/dev:/usr/local/qt5bbb/etc/xdg
QT_INSTALL_EXAMPLES:/home/martin/beaglebone/qt5build/qt5bbb/examples
QT_INSTALL_EXAMPLES/dev:/usr/local/qt5bbb/examples
QT_INSTALL_DEMOS:/home/martin/beaglebone/qt5build/qt5bbb/examples
QT_INSTALL_DEMOS/dev:/usr/local/qt5bbb/examples
QT_HOST_PREFIX:/home/martin/beaglebone/qt5build/qt5
QT_HOST_DATA:/home/martin/beaglebone/qt5build/qt5
QT_HOST_BINS:/home/martin/beaglebone/qt5build/qt5/bin
QT_HOST_LIBS:/home/martin/beaglebone/qt5build/qt5/lib
QMAKE_SPEC:linux-g++
QMAKE_XSPEC:devices/linux-beagleboard-g++
QMAKE_VERSION:3.1
QT_VERSION:5.12.2

失败的qtdeclarative构建的片段:

/home/martin/beaglebone/tools/gcc-linaro-6.4.1-2018.05-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/6.4.1/../../../../arm-linux-gnueabihf/bin/ld: warning: libicudata.so.57, needed by /home/martin/beaglebone/qt5build/qt5bbb/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
/home/martin/beaglebone/qt5build/qt5bbb/lib/libQt5Core.so: Warnung: undefinierter Verweis auf »ucol_getSortKey_57«

提到的标题:

readelf -d /home/martin/beaglebone/qt5build/qt5bbb/lib/libQt5Core.so
Dynamic section at offset 0x4125b0 contains 37 entries:
Tag       Typ                          Name/Wert
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libpthread.so.0]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libicui18n.so.57]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libicuuc.so.57]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libicudata.so.57]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [librt.so.1]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libdl.so.2]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libstdc++.so.6]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libm.so.6]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libgcc_s.so.1]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [libc.so.6]
0x00000001 (NEEDED)                     Gemeinsame Bibliothek [ld-linux-armhf.so.3]
0x0000000e (SONAME)                     soname der Bibliothek: [libQt5Core.so.5]
0x0000000c (INIT)                       0x6ab1c
0x0000000d (FINI)                       0x298ed0
0x00000019 (INIT_ARRAY)                 0x41c000
0x0000001b (INIT_ARRAYSZ)               16 (Bytes)
0x0000001a (FINI_ARRAY)                 0x41c010
0x0000001c (FINI_ARRAYSZ)               12 (Bytes)
0x00000004 (HASH)                       0x158
0x00000005 (STRTAB)                     0x20c6c
0x00000006 (SYMTAB)                     0x838c
0x0000000a (STRSZ)                      228634 (Bytes)
0x0000000b (SYMENT)                     16 (Bytes)
0x00000003 (PLTGOT)                     0x4226f8
0x00000002 (PLTRELSZ)                   24664 (Bytes)
0x00000014 (PLTREL)                     REL
0x00000017 (JMPREL)                     0x64ac4
0x00000011 (REL)                        0x5beac
0x00000012 (RELSZ)                      35864 (Bytes)
0x00000013 (RELENT)                     8 (Bytes)
0x6ffffffc (VERDEF)                     0x5baa4
0x6ffffffd (VERDEFNUM)                  16
0x6ffffffe (VERNEED)                    0x5bccc
0x6fffffff (VERNEEDNUM)                 8
0x6ffffff0 (VERSYM)                     0x58986
0x6ffffffa (RELCOUNT)                   1928
0x00000000 (NULL)                       0x0

力比库达的定位搜索:

locate libicudata.so.57
/home/martin/beaglebone/sysroot/lib/arm-linux-gnueabihf/libicudata.so.57
/home/martin/beaglebone/sysroot/usr/lib/arm-linux-gnueabihf/libicudata.so.57
/home/martin/beaglebone/sysroot/usr/lib/arm-linux-gnueabihf/libicudata.so.57.1
/home/martin/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libicudata.so.57
/home/martin/raspi/sysroot/usr/lib/arm-linux-gnueabihf/libicudata.so.57.1

链接器如何搜索动态库的依赖项?这可能是"双重匹配",因为我在同一主机上也有一个RPi3系统根吗?如果有帮助的话,我可以从qtbase构建中提供配置日志。

谢谢并致以最良好的问候,马丁。

我一次又一次地承受着同样的痛苦。使用chroot并在那里编译。这是我的全部

相关内容

  • 没有找到相关文章

最新更新