Comment 3 for bug 1970057

Revision history for this message
tom stevens (tsteven4) wrote :

This issue appears on jammy because /lib is a symbolic link, and the /lib/x86_64-linux-gnu entry in the loader search path is used to find libQt6Core.
The cmake generated qconfig.cpp contains this line:
#define QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH "../../"
So, prefixFromQtCoreLibraryHelper() computes prefixdir as /lib/x86_64-linux-gnu/../../
and returns /.
Note if /usr/lib/x86_64-linux-gnu had been used to find libQt6Core by the loader, then prefixFromQtCoreLibraryHelper() would have computed prefixdir as /usr/lib/x86_64-linux-gnu/../../, and returned /usr, which would have worked.

Instead of messing with the loader search path, or messing with cmake to compute QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH correctly given the loader search path, the attached patch just resolves any symbolic link so libdir becomes /usr/lib/x86_64-linux-gnu instead of /lib/x86_64-linux-gnu and prefixFromQtCoreLibraryHelper() returns /usr.