From de8fe283d69dbdce1ac4d1570be1917a7cf5fab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 12 Aug 2018 19:04:51 +0100 Subject: [PATCH] autotools: stop controlling symbol visibility with -export-symbols-regex Instead, use -fvisibility=hidden and explicit exports via GST_EXPORT. This should result in consistent behaviour for the autotools and Meson builds where this is done already, and will allow us to drop the win32 .def files. --- configure.ac | 11 ++++++++--- gst/printf/Makefile.am | 2 +- libs/gst/check/gstcheck.c | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 14ab0515d1..79a2b8c8fc 100644 --- a/configure.ac +++ b/configure.ac @@ -890,6 +890,11 @@ AC_ARG_WITH([memory-alignment], ] ) +dnl Symbol visibility +VISIBILITY_CFLAGS="" +AS_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"]) +AC_SUBST(VISIBILITY_CFLAGS) + dnl Check for -Bsymbolic-functions linker flag used to avoid dnl intra-library PLT jumps, if available. AC_ARG_ENABLE(Bsymbolic, @@ -987,7 +992,7 @@ dnl will need the GStreamer source and generated headers dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols dnl from LibXML except for in the core library GST_ALL_CXXFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(ERROR_CXXFLAGS)" -GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $EXTRA_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS)" +GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $EXTRA_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS) \$(VISIBILITY_CFLAGS)" dnl FIXME: check if LTLIBINTL is needed everywhere dnl I presume it is given that it contains the symbols that _() stuff maps to @@ -1008,7 +1013,7 @@ AC_SUBST(GST_ALL_LDFLAGS) dnl GST_LIB_LDFLAGS dnl linker flags shared by all libraries dnl LDFLAGS modifier defining exported symbols from built libraries -GST_LIB_LDFLAGS="-export-symbols-regex \^[_]?\(gst_\|Gst\|GST_\).*" +GST_LIB_LDFLAGS="" AC_SUBST(GST_LIB_LDFLAGS) dnl GST_OBJ_* @@ -1023,7 +1028,7 @@ AC_SUBST(GST_OBJ_LIBS) dnl GST_PLUGIN_LDFLAGS dnl LDFLAGS for plugins; includes GST_ALL_LDFLAGS -GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS" +GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS" AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS") dnl plugin scanner locations diff --git a/gst/printf/Makefile.am b/gst/printf/Makefile.am index f62b448007..b7307459d3 100644 --- a/gst/printf/Makefile.am +++ b/gst/printf/Makefile.am @@ -14,7 +14,7 @@ AM_CPPFLAGS += $(PRINTF_EXTRA_CFLAGS) noinst_LTLIBRARIES = libgstprintf.la -libgstprintf_la_CFLAGS = $(EXTRA_CFLAGS) +libgstprintf_la_CFLAGS = $(EXTRA_CFLAGS) $(VISIBILITY_CFLAGS) libgstprintf_la_SOURCES = \ asnprintf.c \ printf-args.c \ diff --git a/libs/gst/check/gstcheck.c b/libs/gst/check/gstcheck.c index 963d0c457c..d24fd4a4f9 100644 --- a/libs/gst/check/gstcheck.c +++ b/libs/gst/check/gstcheck.c @@ -1261,7 +1261,7 @@ gst_check_object_destroyed_on_unref (gpointer object_to_unref) /* For ABI compatibility with GStreamer < 1.5 */ /* *INDENT-OFF* */ -void +GST_CHECK_API void _fail_unless (int result, const char *file, int line, const char *expr, ...) G_GNUC_PRINTF (4, 5); /* *INDENT-ON* */