diff options
author | Colin Walters <walters@verbum.org> | 2012-12-01 14:49:49 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-12-05 14:05:17 -0500 |
commit | 68a4a3eea119704817f540efa803e2197fe52838 (patch) | |
tree | a2e0625e7f1c36bd5874499ddb533248e7937347 /configure.ac | |
parent | e6a55a30004feeed5ee05296aac85731b236bfa4 (diff) | |
download | gobject-introspection-68a4a3eea119704817f540efa803e2197fe52838.tar.gz |
build: Use -Bsymbolic-functions by default if available
While we have much larger performance problems right now, 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=689456
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 74a44de6..b1e8ea9f 100644 --- a/configure.ac +++ b/configure.ac @@ -287,7 +287,28 @@ AM_CONDITIONAL(WITH_GLIBSRC, test x"$GLIBSRC" != x) AC_SUBST(GLIBSRC) AC_MSG_RESULT([$GLIBSRC]) +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 + EXTRA_LINK_FLAGS=-Wl,-Bsymbolic-functions +fi +AC_SUBST(EXTRA_LINK_FLAGS) AC_CONFIG_FILES([ Makefile |