From d1a8997ac29764dd160a4cad7b291669ae6f5b36 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 4 Dec 2012 12:46:04 -0500 Subject: build: Use -Bsymbolic-functions by default if available Using -Bsymbolic-functions to avoid internal PLT indirection is an easy win. This is the same code that both GLib and GTK+ have. https://bugzilla.gnome.org/show_bug.cgi?id=689648 --- configure.ac | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/configure.ac b/configure.ac index 540603ad..1bb17164 100644 --- a/configure.ac +++ b/configure.ac @@ -653,6 +653,27 @@ fi AC_SUBST(LIBRARY_LIBTOOL_OPTIONS) AC_SUBST(MODULE_LIBTOOL_OPTIONS) +dnl +dnl Check for -Bsymbolic-functions linker flag used to avoid +dnl intra-library PLT jumps, if available. +dnl +AC_ARG_ENABLE(Bsymbolic, + [AS_HELP_STRING([--disable-Bsymbolic], + [avoid linking with -Bsymbolic])],, + [SAVED_LDFLAGS="${LDFLAGS}" + AC_MSG_CHECKING([for -Bsymbolic-functions linker flag]) + LDFLAGS=-Wl,-Bsymbolic-functions + AC_TRY_LINK([], [int main (void) { return 0; }], + AC_MSG_RESULT(yes) + enable_Bsymbolic=yes, + AC_MSG_RESULT(no) + enable_Bsymbolic=no) + LDFLAGS="${SAVED_LDFLAGS}"]) + +if test "x${enable_Bsymbolic}" = "xyes"; then + LIBRARY_LIBTOOL_OPTIONS="$LIBRARY_LIBTOOL_OPTIONS -Wl,-Bsymbolic-functions" +fi + dnl ******************************************************** dnl * See whether we need to load our modules as .la files * dnl ******************************************************** -- cgit v1.2.1