From fcd3a20059d0c629d972ba2577694394b438a100 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 27 Jan 2020 08:56:10 +0100 Subject: 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 function...to 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 --- mkspecs/features/qt_common.prf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mkspecs') 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. -- cgit v1.2.3