[gobject-introspection] build: Use -Bsymbolic-functions by default if available
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] build: Use -Bsymbolic-functions by default if available
- Date: Wed, 5 Dec 2012 19:06:37 +0000 (UTC)
commit 68a4a3eea119704817f540efa803e2197fe52838
Author: Colin Walters <walters verbum org>
Date: Sat Dec 1 14:49:49 2012 -0500
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
Makefile-girepository.am | 5 ++++-
configure.ac | 21 +++++++++++++++++++++
2 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/Makefile-girepository.am b/Makefile-girepository.am
index eb55a54..11549d4 100644
--- a/Makefile-girepository.am
+++ b/Makefile-girepository.am
@@ -72,7 +72,10 @@ libgirepository_1_0_la_SOURCES = \
libgirepository_1_0_la_CPPFLAGS = $(GIREPO_CFLAGS) -I$(top_srcdir)/girepository -DG_IREPOSITORY_COMPILATION
libgirepository_1_0_la_LIBADD = libgirepository-gthash.la $(GIREPO_LIBS)
-libgirepository_1_0_la_LDFLAGS = -no-undefined -version-number 1:0:0 -export-symbols $(srcdir)/girepository/girepository.symbols
+libgirepository_1_0_la_LDFLAGS = \
+ $(EXTRA_LINK_FLAGS) \
+ -no-undefined -version-number 1:0:0 \
+ -export-symbols $(srcdir)/girepository/girepository.symbols
gdumpdir = $(datadir)/gobject-introspection-1.0/
gdump_DATA = girepository/gdump.c
diff --git a/configure.ac b/configure.ac
index 74a44de..b1e8ea9 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]