diff options
-rw-r--r-- | Makefile-girepository.am | 5 | ||||
-rw-r--r-- | configure.ac | 21 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Makefile-girepository.am b/Makefile-girepository.am index eb55a548..11549d44 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 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 |