From db77e2e187843e380fe5fd515484e85c23d735da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 24 May 2018 17:31:04 +0200 Subject: [PATCH] clutter: Assume compiler supports visibility flag and attributes Unconditionally pass -fvisibility=hidden to compiler and define _CLUTTER_EXTERN to __attribute__((visibility("default"))) extern. --- clutter/clutter/Makefile.am | 2 +- clutter/clutter/clutter-macros.h | 4 +--- clutter/configure.ac | 20 -------------------- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/clutter/clutter/Makefile.am b/clutter/clutter/Makefile.am index 0c2353299..9bfc87458 100644 --- a/clutter/clutter/Makefile.am +++ b/clutter/clutter/Makefile.am @@ -14,6 +14,7 @@ AM_CPPFLAGS = \ -DCLUTTER_COMPILATION=1 \ -DCOGL_DISABLE_DEPRECATION_WARNINGS \ -DG_LOG_DOMAIN=\"Clutter\" \ + -fvisibility=hidden \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ -I$(top_builddir) \ @@ -23,7 +24,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/../cogl/cogl \ $(CLUTTER_DEPRECATED_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ - $(CLUTTER_HIDDEN_VISIBILITY_CFLAGS) \ $(NULL) AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS) diff --git a/clutter/clutter/clutter-macros.h b/clutter/clutter/clutter-macros.h index 705d8b906..8a6702194 100644 --- a/clutter/clutter/clutter-macros.h +++ b/clutter/clutter/clutter-macros.h @@ -90,9 +90,7 @@ #define CLUTTER_PRIVATE_FIELD(x) clutter_private_ ## x #endif -#ifndef _CLUTTER_EXTERN -#define _CLUTTER_EXTERN extern -#endif +#define _CLUTTER_EXTERN __attribute__((visibility("default"))) extern #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || \ __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4) diff --git a/clutter/configure.ac b/clutter/configure.ac index 772e3c6dc..84beb35b4 100644 --- a/clutter/configure.ac +++ b/clutter/configure.ac @@ -101,26 +101,6 @@ AC_ARG_ENABLE([Bsymbolic], AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions]) AC_SUBST(CLUTTER_LINK_FLAGS) -# Check for the visibility flags -CLUTTER_HIDDEN_VISIBILITY_CFLAGS="" -dnl on other compilers, check if we can do -fvisibility=hidden -SAVED_CFLAGS="${CFLAGS}" -CFLAGS="-fvisibility=hidden" -AC_MSG_CHECKING([for -fvisibility=hidden compiler flag]) -AC_TRY_COMPILE([], [return 0], - AC_MSG_RESULT(yes) - enable_fvisibility_hidden=yes, - AC_MSG_RESULT(no) - enable_fvisibility_hidden=no) -CFLAGS="${SAVED_CFLAGS}" - -AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [ - AC_DEFINE([_CLUTTER_EXTERN], [__attribute__((visibility("default"))) extern], - [defines how to decorate public symbols while building]) - CLUTTER_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden" -]) -AC_SUBST(CLUTTER_HIDDEN_VISIBILITY_CFLAGS) - AC_CACHE_SAVE dnl ========================================================================