[gtk+] Add check for -Bsymbolic-functions linker flag



commit e4e477161ae617a35528c0659f00284f4c80c372
Author: Javier Jardón <jjardon gnome org>
Date:   Thu Jul 8 16:18:48 2010 +0200

    Add check for -Bsymbolic-functions linker flag
    
    Based on a Glib patch by Ryan Lortie
    
    https://bugzilla.gnome.org/show_bug.cgi?id=623845

 configure.ac |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e9195ac..5b67a93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1671,10 +1671,30 @@ if test x$gdk_working_wctype = xno; then
   gdk_wc="\$gdk_wc
 #define GDK_HAVE_BROKEN_WCTYPE 1"
 fi
-
-
 ])
 
+dnl
+dnl Check for -Bsymbolic-functions linker flag used to avoid
+dnl intra-library PLT jumps, if available.
+dnl
+AC_ARG_ENABLE(Bsymbolic,
+              [AC_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
+  GTK_LINK_FLAGS=-Wl,-Bsymbolic-functions
+fi
+AC_SUBST(GTK_LINK_FLAGS)
+
 AC_CONFIG_FILES([
 config.h.win32
 gtk-zip.sh



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