summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac7
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk6
2 files changed, 10 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index a917cfbb0bfd..8670deccc89a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2942,8 +2942,11 @@ if test $_os = iOS; then
if test "$ENABLE_LTO" = TRUE; then
lto=-flto
fi
- CC="`xcrun -find clang` -arch $arch -isysroot $sysroot $lto $versionmin"
- CXX="`xcrun -find clang++` -arch $arch -isysroot $sysroot $lto $versionmin"
+ # Just add -fvisibility=hidden to CC and CXX directly so that the 3rd-party libs also
+ # get compiled with it, to avoid ld warnings when linking all that together into one
+ # executable.
+ CC="`xcrun -find clang` -arch $arch -fvisibility=hidden -isysroot $sysroot $lto $versionmin"
+ CXX="`xcrun -find clang++` -arch $arch -fvisibility=hidden -isysroot $sysroot $lto $versionmin"
INSTALL_NAME_TOOL=`xcrun -find install_name_tool`
AR=`xcrun -find ar`
NM=`xcrun -find nm`
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 7cb29836a8a3..c74785402025 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -82,7 +82,11 @@ endif
ifeq ($(HAVE_GCC_VISIBILITY_FEATURE),TRUE)
-gb_VISIBILITY_FLAGS := -DHAVE_GCC_VISIBILITY_FEATURE -fvisibility=hidden
+gb_VISIBILITY_FLAGS := -DHAVE_GCC_VISIBILITY_FEATURE
+# If CC or CXX already include -fvisibility=hidden, don't duplicate it
+ifeq (,$(filter -fvisibility=hidden,$(CC)))
+gb_VISIBILITY_FLAGS += -fvisibility=hidden
+endif
ifneq ($(HAVE_GCC_VISIBILITY_BROKEN),TRUE)
gb_CXXFLAGS_COMMON += -fvisibility-inlines-hidden
endif