Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.11
-
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
- duplicates
-
QTBUG-61260 building with asan on Linux fails due to missing symbols
-
- Closed
-