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.
This commit is contained in:
Tim-Philipp Müller 2018-08-12 19:04:51 +01:00
parent 88bd7c61a7
commit de8fe283d6
3 changed files with 10 additions and 5 deletions

View file

@ -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

View file

@ -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 \

View file

@ -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* */