Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.1, 6.3
-
None
Description
When configuring Qt with -sanitize address, we use ECMEnableSanitizers.cmake to add sanitizer support.
It runs
link_libraries(asan)
which adds an -lasan flag to all built Qt libs.
Accidentally, that adds those flags to the prl files too.
lib/libQt6Core.prl 5:QMAKE_PRL_LIBS = -lasan -lpthread 6:QMAKE_PRL_LIBS_FOR_CMAKE = -lasan;-lpthread
Those -lasan link flags get added to apps when they are built with qmake and link against Qt6Core.
But qmake has it's own sanitizer.prf that handles sanitizer flags that need to be added.
As such, we should NOT record those -lasan flags in the .prl files of modules. It could lead to issues with linking the wrong library. And usually fsanitize-address takes care of linking the proper libs.
Attachments
Issue Links
- relates to
-
QTBUG-96859 "ASan runtime does not come first in initial library list" when running empty console application built with qmake
- Reported
-
QTBUG-97933 Building Qt with gcc and ASan fails with ASan linking error
- Closed
- resulted from
-
QTBUG-87989 "ASan runtime does not come first in initial library list" when building Qt Quick application with Qt configured with -sanitize address
- Closed
-
QTBUG-92083 Building console project fails with linker errors
- Closed