Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.1
-
None
-
FreeBSD 11, Qt 5.3.1
-
6dcd944deeed28bdd001eea5289d04116c9d23f4
Description
Commits 0fc4f2b4 ("qtAddModule(): put search paths directly into LIBS{,_PRIVATE}") and e38af234 ("dispose of QMAKE_LIBDIR_FLAGS, "demote" QMAKE_FRAMEWORKPATH_FLAGS") have caused a regression compared to Qt4 when an mkspec sets QMAKE_LIBDIR to a directory where Qt's libraries are installed. unsupported/freebsd-clang/qmake.conf, for example, sets QMAKE_LIBDIR to /usr/local/lib.
If one has an older version of Qt5 installed in /usr/local/lib and builds a more recent one, this may happen:
clang++ -Wl,--no-undefined -Wl,-O1 -pthread -Wl,-rpath,/usr/local/lib -shared -o libqjpeg.so .obj/qjpeghandler.o .obj/main.o .obj/moc_main.o -L/usr/local/lib -ljpeg -L/path/to/my/build/dir/lib -lQt5Gui -lQt5Core -lGL .obj/qjpeghandler.o: In function `write_jpeg_image(QImage const&, QIODevice*, int, QString const&)': ../../../gui/image/qjpeghandler.cpp:(.text+0x24f6): undefined reference to `QImage::convertToFormat_inplace(QImage::Format, QFlags<Qt::ImageConversionFlag>)' ../../../gui/image/qjpeghandler.cpp:(.text+0x253e): undefined reference to `QImage::convertToFormat_helper(QImage::Format, QFlags<Qt::ImageConversionFlag>) const'
/path/to/my/build/dir/lib/libQt5Gui.so should be preferred over /usr/local/lib/libQt5Gui.so.
The solution I could think of so far involves prepending MODULE_LIBS instead of appending it in qt_functions.prf's qtAddModule and appending QMAKE_LIBDIR/QMAKE_LIBDIR_FLAGS to QMAKE_LIBS instead of prepending in qmake's Makefile generator, but I'm obviously not sure if this is stupid and will break half of qmake's use cases Should I send a patch nonetheless?
Attachments
Issue Links
- relates to
-
QTBUG-50921 independent handling of LIBS and LIBS_PRIVATE blows up
- Closed
-
QTBUG-42870 CLONE - WebKit build failure - FrameLoader.cpp - member access into incomplete type 'WebCore::Archive'
- Closed
-
QTBUG-6351 wrong order of includes & libraries from configure -I & -L
- Closed
- replaces
-
QTBUG-34902 Build fails on macports due to "system" path in .pc files
- Closed
For Gerrit Dashboard: QTBUG-40825 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
93271,1 | Pass Qt's build directories to the linker before others. | 5.3 | qt/qtbase | Status: ABANDONED | -2 | 0 |
194829,2 | make mkspecs not mess up library and include search paths | 5.9 | qt/qtbase | Status: MERGED | +2 | 0 |