Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-40825

QT_LIBDIR gets added before MODULE_LIBS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.1
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              buddenha Oswald Buddenhagen
              rakuco Raphael Kubo da Costa
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes