summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2012-12-04 12:46:04 -0500
committerColin Walters <walters@verbum.org>2012-12-04 12:46:52 -0500
commitd1a8997ac29764dd160a4cad7b291669ae6f5b36 (patch)
treef499b6b58b62674f0c4ed4156eaf4b0b05599d98
parent076e8857cd60080e64dbc47f85c981b13281fa69 (diff)
downloadpango-d1a8997ac29764dd160a4cad7b291669ae6f5b36.tar.gz
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
-rw-r--r--configure.ac21
1 files changed, 21 insertions, 0 deletions
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 ********************************************************