[vte] Use -Bsymbolic-functions when available



commit 5f52c7ce5f8151aa1718dc0aab6c116ba595f402
Author: Christian Persch <chpe gnome org>
Date:   Mon Sep 6 13:08:00 2010 +0200

    Use -Bsymbolic-functions when available
    
    Bug #628870.

 configure.in    |   25 +++++++++++++++++++++++++
 src/Makefile.am |   10 +++++++---
 2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/configure.in b/configure.in
index 1814b2c..56e16c7 100644
--- a/configure.in
+++ b/configure.in
@@ -243,6 +243,31 @@ if test "x$DEBUG" != "xno" ; then
 	AC_DEFINE(VTE_DEBUG,1,[Enable debugging messages.])
 fi
 
+##########################################################
+# Check for -Bsymbolic-functions linker flag used to avoid
+# intra-library PLT jumps, if available.
+##########################################################
+
+AC_ARG_ENABLE([Bsymbolic],
+  [AS_HELP_STRING([--disable-Bsymbolic],
+                  [disable linking with -Bsymbolic])],
+  [],[enable_Bsymbolic=yes])
+
+VTE_LDFLAGS=
+if test "$enable_Bsymbolic" != "no"; then
+  FLAG="-Wl,-Bsymbolic-functions"
+  VTE_LD_TRY_FLAG([$FLAG],
+    [VTE_LDFLAGS="$VTE_LDFLAGS $FLAG"],
+    [if test "$enable_Bsymbolic" = "auto"; then
+       AC_MSG_WARN([-Bsymbolic not supported by ld; disabling])
+       enable_Bsymbolic=no
+     else
+       AC_MSG_ERROR([-Bsymbolic requested but not supported by ld])
+     fi])
+fi
+
+AC_SUBST([VTE_LDFLAGS])
+
 ################################################################################
 
 GNOME_COMMON_INIT
diff --git a/src/Makefile.am b/src/Makefile.am
index 78aa575..a377965 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -96,13 +96,17 @@ libvte VTE_LIBRARY_SUFFIX_U@_la_CPPFLAGS = \
  	-DDATADIR='"$(datadir)"' \
 	-DLIBEXECDIR='"$(libexecdir)"' \
 	-DLOCALEDIR='"$(localedir)"' \
-	-DVTE_COMPILATION
-libvte VTE_LIBRARY_SUFFIX_U@_la_CFLAGS = $(VTE_CFLAGS)
+	-DVTE_COMPILATION \
+	$(AM_CPPFLAGS)
+
+libvte VTE_LIBRARY_SUFFIX_U@_la_CFLAGS = $(VTE_CFLAGS) $(AM_CFLAGS)
 libvte VTE_LIBRARY_SUFFIX_U@_la_LIBADD = $(VTE_LIBS)
 libvte VTE_LIBRARY_SUFFIX_U@_la_LDFLAGS = \
+  $(VTE_LDFLAGS) \
 	-version-info $(LT_VERSION_INFO) \
 	-export-symbols-regex "^vte_terminal_.*|^vte_pty_.*|^_vte_pty_.*|^vte_reaper_.*|_vte_debug_.*" \
-	@LIBTOOL_EXPORT_OPTIONS@ @LIBTOOL_FLAGS@
+	@LIBTOOL_EXPORT_OPTIONS@ @LIBTOOL_FLAGS@ \
+	$(AM_LDFLAGS)
 
 
 # Generated sources



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]