Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.2.1
Description
There are scenarios where we want to link to a shared library, but we don't actually use any symbols from it (e.g. with QML modules where the consumer may want to link only to the backing library and not need the associated plugin at all). Some linkers will discard that library as an optimization, since they think it is unused. We want some way of conveniently telling the linker not to discard a library in this situation, but currently there is no easy way to do that. Different linkers use different linker flags, some don't allow you to specify it at per-library level and only at a whole-of-link level (e.g. the MSVC linker).
Reported as a specific use case in the broader upstream CMake issue for linker decorations: https://gitlab.kitware.com/cmake/cmake/-/issues/22812#note_1074118
Attachments
Issue Links
- relates to
-
QTBUG-128568 [REG Qt 6.7.0-> 6.8.0 beta4] QML module linked as library doesn't work anymore
- Closed
-
QTBUG-80863 [cmake] excessive compilation of Import.cpp files for static plugins
- Closed
-
QTBUG-91448 Undefined resource symbols when linking app with a static Qt without qmake and CMake
- Closed
-
QTBUG-110243 Resources are lost when linking static libraries using CMake build system in a separate project
- Closed
-
QTBUG-95149 Fix use case of linking an executable to a shared library QML module backing target
- Reported