From 3b3b36a60749ea5c3b166bb1c8f3f6dda8ce6fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Mon, 28 Mar 2022 17:21:44 +0200 Subject: [PATCH] qt: Set default visibility of all symbols to hidden * configure.ac: Add -fvisibility=hidden to GPGME_QT_CFLAGS if gcc supports the flag. -- With this change all defined symbols are hidden by default, so that they are not exported anymore. All symbols that are part of the ABI and that shall still be exported are already marked as having default visibility. GnuPG-bug-id: 5906 --- configure.ac | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configure.ac b/configure.ac index 78824962..8e66c7a0 100644 --- a/configure.ac +++ b/configure.ac @@ -402,6 +402,16 @@ if test "$found" = "1"; then fi fi fi + +# Check if compiler supports visibility attribute (if qt is enabled) +LIST_MEMBER("qt", $enabled_languages) +if test "$found" = "1"; then + AX_GCC_FUNC_ATTRIBUTE(visibility) + if test "$ax_cv_have_func_attribute_visibility" = "yes"; then + GPGME_QT_CFLAGS="$GPGME_QT_CFLAGS -fvisibility=hidden" + fi +fi + AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) if test -n "$GRAPHVIZ"; then