I cross compile Qt for a custom device (TI AM335x). It uses eglfs as a platform, and therefore needs to link to libEGL
, libGLESv2
, etc.
The configuration step apparently has been changed in Qt 5.12.1, such that libraries found at configuration time are stored with absolute paths. See Issue #72903.
https://bugreports.qt.io/browse/QTBUG-72903
Now I have the problem that Qt shared objects which link to opengl libraries have absolute paths as dependencies in them.
Here is the output from readelf -d libQt5Gui.so
0x00000001 (NEEDED) Shared library: [libQt5Core.so.5]
0x00000001 (NEEDED) Shared library: [libz.so.1]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [/home/work/sdk/sysroot/usr/lib/libEGL.so]
0x00000001 (NEEDED) Shared library: [/home/work/sdk/sysroot/usr/lib/libIMGegl.so]
0x00000001 (NEEDED) Shared library: [/home/work/sdk/sysroot/usr/lib/libsrv_um.so]
0x00000001 (NEEDED) Shared library: [/home/work/sdk/sysroot/usr/lib/libGLESv2.so]
0x00000001 (NEEDED) Shared library: [/home/work/sdk/sysroot/usr/lib/libGLES_CM.so]
0x00000001 (NEEDED) Shared library: [/home/work/sdk/sysroot/usr/lib/libusc.so]
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]
0x0000000e (SONAME) Library soname: [libQt5Gui.so.5]
The relevant part in my mkspecs/qmake.conf
file is as follows
QMAKE_LIBDIR_OPENGL_ES2 = $$[QT_SYSROOT]/usr/lib
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_INCDIR_EGL = $$[QT_SYSROOT]/usr/include
QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
QMAKE_LIBS_OPENGL_ES2 = -lEGL -lIMGegl -lsrv_um -lGLESv2 -lGLES_CM -lusc
QMAKE_LIBS_EGL = $${QMAKE_LIBS_OPENGL_ES2}
When I install the shared objects on the target device, the libraries are not found, because the path does not exist there.
From the linked issue above, It is not clear to me how I can fix this issue. Does anybody know how to resolve this?
Thanks for reading. Any suggestions are much appreciated.