diff options
author | Michał Łoś <michal.los@siili.com> | 2023-09-13 19:14:57 +0200 |
---|---|---|
committer | Michał Łoś <michal.los@siili.com> | 2023-10-13 04:26:15 +0200 |
commit | 9e93781b9cafbed145f536f011fe6fd6955029da (patch) | |
tree | 7bd392c4226729569fba7587f94e25ff2f3c3445 | |
parent | 94a3914d3da3bbeb4da9c4d231e3666ae910f287 (diff) |
Remove --no-undefined for VxWorks Qt shared libs
Build system adds this flag to any module that it uses when built as a
shared library and not WASM.
VxWorks is specific in regards to type of applications:
- static application, which do not use any dynamic libraries
- dynamic application, which uses shared libraries, and as such needs
to link against libdl.a
The latter is the only source of symbols related to dynamic loading and
thread local storage. This is an architectural decision, as application
is required to embed loading tools in itself (as opposed to Unix/Linux,
which contains dynamic loader which provides these symbols separately).
libdl.a is standard static library on VxWorks, compiled without PIC, and
as such can't be linked into shared library.
This results in compilation errors when building dynamic libraries which
use `thread_local`-related symbols, since these symbols will be
fulfilled at runtime (contained in executable which requires shared lib)
and are not available during linking.
Don't add `-Wl,--no-undefined` flag on VxWorks for Qt shared lib builds.
Task-number: QTBUG-115777
Change-Id: I47e5d68afcba2c3b4203e4c0beded2e18ea2563b
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
-rw-r--r-- | cmake/QtFlagHandlingHelpers.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake index c0169a672f..28231cb564 100644 --- a/cmake/QtFlagHandlingHelpers.cmake +++ b/cmake/QtFlagHandlingHelpers.cmake @@ -138,6 +138,12 @@ function(qt_internal_add_link_flags_no_undefined target) if (NOT QT_BUILD_SHARED_LIBS OR WASM) return() endif() + if (VXWORKS) + # VxWorks requires thread_local-related symbols to be found at + # runtime, resulting in linker error when no-undefined flag is + # set and thread_local is used + return() + endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # ld64 defaults to -undefined,error, and in Xcode 15 # passing this option is deprecated, causing a warning. |