[Interest] Where does libGL get changed to absolute and how to stop?

Marius Kittler mkittler at suse.de
Sun Nov 17 17:42:57 CET 2019


Am Freitag, 15. November 2019, 20:07:59 CET schrieb John Cary:
> On 11/15/19 10:05 AM, Marius Kittler wrote:
> > As far as I know this is done within `defineTest(qtConfResolveLibs)` in
> > `qtbase/mkspecs/features/qt_configure.prf`. Not sure how to disable this
> > except from patching the function. I also needed to patch it for my
> > mingw-w64 builds.
> 
> Could you share your patch?
> 

My patch doesn't revert the library resolving. I've just modified it so my 
static builds don't link against shared libraries: https://github.com/
Martchus/qtbase/commit/51a0ac0ff3a726f88af9e8cd472779b33117d304
That's likely not useful for you.

> > Considering the code it seems to take `-L` flags into account. So maybe
> > you
> > can workaround the problem by using `-L` . Or just specify the full patch
> > yourself. (I assume your problem is that the library is resolved to the
> > wrong full path but using full paths in general would work.)
> 
> I put in absolute paths for QMAKE_LIBS_OPENGL, and then at the end of
> configuration,
> my debug statements print out the correct value.  However, this
> generates a file,
>    qtbase/src/gui/qtgui-config.pri
> in which I find
>    QMAKE_LIBS_OPENGL = /lib64/libGL.so
> and the build creates a largely redundant
>    qtbase/mkspecs/modules-inst/qt_lib_gui_private.pri
> also containing the wrong information, and the build
> still links in the system /lib64/libGL.so.
> 
> So then I comment out that line in qtbase/src/gui/qtgui-config.pri
> before starting the build.  The second file,
> is now correct, and the build proceeds correctly.
> 
> So it seems that it comes down to an incorrectly generated
> qtbase/src/gui/qtgui-config.pri, which I can fix post-facto, but I think
> there
> must be a better fix.  Perhaps your patch?

Maybe the value is overridden by the mkspec, e.g. by the assignment in 
`qtbase/mkspecs/common/linux.conf` (or whatever file is relevant for your 
platform). So you could try to patch this file to your needs. Otherwise I doubt 
I can help you much further. Sometimes I also just give up and apply some 
`sed` commands on the generated files. (The `qmake_all` target is useful for 
that.)




More information about the Interest mailing list