$ /opt/A133/buildroot/buildroot-20200212-Qt/output/host/bin/aarch64-linux-gnu-objdump -x qopenglwindow/qopenglwindow |grep NEED
NEEDED libatomic.so.1
NEEDED libQt5Gui.so.5
NEEDED libQt5Core.so.5
NEEDED /opt/A133/buildroot/buildroot-20200212-Qt/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libGLESv2.so
NEEDED /opt/A133/buildroot/buildroot-20200212-Qt/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libGLESv1_CM.so
NEEDED libpthread.so.0
NEEDED librt.so.1
NEEDED libdl.so.2
NEEDED libstdc++.so.6
NEEDED libm.so.6
NEEDED libgcc_s.so.1
NEEDED libc.so.6
VERNEED 0x0000000000403540
VERNEEDNUM 0x0000000000000004
离线
不知道是不是buildroot的eglfs的bug,生成的elf都是依赖绝对路径
找到patchelf 命令可以直接修改elf文件:
patchelf --replace-needed /opt/A133/buildroot/buildroot-20200212-Qt/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libGLESv2.so libGLESv2.so qopenglwindow/qopenglwindow
patchelf --replace-needed /opt/A133/buildroot/buildroot-20200212-Qt/output/host/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libGLESv1_CM.so libGLES_CM.so qopenglwindow/qopenglwindow
看结果:
$ /opt/A133/buildroot/buildroot-20200212-Qt/output/host/bin/aarch64-linux-gnu-objdump -x /opt/A133/buildroot/buildroot-20200212-Qt/output/build/qt5base-5.12.9/examples/opengl/qopenglwindow/qopenglwindow |grep NEED
NEEDED libatomic.so.1
NEEDED libQt5Gui.so.5
NEEDED libQt5Core.so.5
NEEDED libGLESv2.so
NEEDED libGLES_CM.so
NEEDED libpthread.so.0
NEEDED librt.so.1
NEEDED libdl.so.2
NEEDED libstdc++.so.6
NEEDED libm.so.6
NEEDED libgcc_s.so.1
NEEDED libc.so.6
VERNEED 0x0000000000403540
VERNEEDNUM 0x0000000000000004
参考: https://forum.qt.io/topic/101590/absolute-paths-to-egl-library-in-libqt5gui-so-since-qt-5-12-1/13
离线
这里有人提出同样的问题:
The output of readelf shows this issue:
$ arm-linux-gnueabihf-readelf -a qtbase/lib/libQt5Gui.so | grep "Shared library"
readelf: Warning: [ 9]: Info field (0) should index a relocatable section.
0x00000001 (NEEDED) Shared library: [libQt5Core.so.5]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [/home/developer/proyectos/Odroid/RootFS/usr/lib/arm-linux-gnueabihf/libGLESv2.so]
0x00000001 (NEEDED) Shared library: [/home/developer/proyectos/Odroid/RootFS/usr/lib/arm-linux-gnueabihf/libEGL.so]
0x00000001 (NEEDED) Shared library: [libpng16.so.16]
0x00000001 (NEEDED) Shared library: [libz.so.1]
0x00000001 (NEEDED) Shared library: [libstdc++.so.6]
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x00000001 (NEEDED) Shared library: [libc.so.6]
I've seen something related to this issue in QTBUG-7290
https://forum.qt.io/topic/101590/absolute-paths-to-egl-library-in-libqt5gui-so-since-qt-5-12-1
离线
跟踪了一下,貌似 so 文件缺 SONAME 节点引起:
$ /opt/A133/buildroot/buildroot-20200212-Qt/output/host/bin/aarch64-linux-gnu-readelf -d ./output/build/sunxi-mali-mainline-d691cb93884ca8ac67860502117bbec283dc19aa/r6p2/arm64/fbdev/libGLESv2.so |grep SONAME
$
$
$ /opt/A133/buildroot/buildroot-20200212-Qt/output/host/bin/aarch64-linux-gnu-readelf -d /opt/A133/tina4/package/libs/libgpu/ge8300/fbdev/glibc/lib64/libGLESv2.so |grep SONAME
0x000000000000000e (SONAME) Library soname: [libGLESv2.so.2]
$
$
离线
搞定了,换另外一套带SONAME节点的so文件库就好了。
另外一个解决办法,给这些so文件用patchelf手动打上SONAME也可以解决,但是我没有测试。
离线