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

sanitize configure feature breaks QtCore linking

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.7, 5.10
    • 5.11
    • Build System
    • None
    • b2d2b655e58d5337765c26dafa836b12e019c6a4 5a8b2e1bb0ee9e02146cbbaa927a3c73ec8c1082

    Description

      When passing --sanitize=address to configure (Linux, gcc), the linking of QtCore fails due to a missing -ldl. This is caused by the configure check for libdl first trying to compile config.tests/libdl/main.cpp without -ldl, which usually fails and results in a subsequent attempt of using -ldl. Once that works we store the result in QMAKE_LIBS_LIBDL=-ldl and the use via QMAKE_USE_PRIVATE += libdl activates the use at QtCore link time. However the use of -fsanitize implies linkage against libasan and implicit linkage against libdl. As we pass -fsanitize to gcc when compiling the libdl config test, the test succeeds without -ldl and QMAKE_LIBS_LIBD remains empty.

      We should probably somehow exclude the sanitize feature from the features applied when running the configure test.

      A temporary workaround if anyone runs into the issue is to edit src/corelib/qtcore-config.pri and make sure that the QMAKE_LIBS_LDL variable has -ldl in there. Afterwards just re-run make and it will compile.

      Attachments

        Issue Links

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

          Activity

            People

              taipan BogDan Vatra
              shausman Simon Hausmann
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes