path: root/mkspecs
diff options
authorJoerg Bornemann <>2020-01-27 08:56:10 +0100
committerJoerg Bornemann <>2020-01-28 07:52:58 +0100
commitfcd3a20059d0c629d972ba2577694394b438a100 (patch)
tree2ed07c006c37af6a659d51e98cd40c46bd08c530 /mkspecs
parentb0c804f345a383d2813f4709632baa43a4275646 (diff)
macOS build: Fix 'direct access in function...' warning
For every executable that uses a static Qt library (e.g. rcc using libQt5Bootstrap.a) we got a warning: 'direct access in global weak symbol'. This was because we've built all libraries with -fvisibility=hidden -fvisibility-inlines-hidden but not the executables linking against them. On macOS however, all translation units must have the same visibility setting. We're now setting the same visibilty for libs and executables on darwin. Fixes: QTBUG-81297 Change-Id: I2668e9385caa7f0ce78bf3727b4e5322bc4a294f Reviewed-by: Alexandru Croitor <>
Diffstat (limited to 'mkspecs')
1 files changed, 3 insertions, 1 deletions
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index c24f2c6062..02460a2e0c 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -23,7 +23,6 @@ qtConfig(c11): CONFIG += c11
qtConfig(stack-protector-strong): CONFIG += stack_protector_strong
contains(TEMPLATE, .*lib) {
# module and plugins
- if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols
unix:qtConfig(reduce_relocations): CONFIG += bsymbolic_functions
qtConfig(separate_debug_info): CONFIG += separate_debug_info
@@ -58,6 +57,9 @@ contains(TEMPLATE, .*lib) {
QMAKE_PRL_INSTALL_REPLACE += qtlibdir_replace
+contains(TEMPLATE, .*lib)|darwin {
+ if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols
# The remainder of this file must not apply to host tools/libraries,
# as the host compiler's version and capabilities are not checked.