[valgrind] Fix -Ttext-segment configure check.
Mark Wielaard
mjw at fedoraproject.org
Thu Apr 18 08:53:54 UTC 2013
commit 00efda50202f1ba1178be798ef338d8dc813c75b
Author: Mark Wielaard <mjw at redhat.com>
Date: Wed Apr 17 21:02:19 2013 +0200
Fix -Ttext-segment configure check.
Explicitly test together with -static -nodefaultlibs -nostartfiles to mimic
what the tools linking script does. At least on s390 the test might fail fo
a non-static AC_LINK, while it does work when using those other flags too.
valgrind-3.8.1-text-segment.patch | 51 +++++++++++++++++++++++++++++++++++++
1 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/valgrind-3.8.1-text-segment.patch b/valgrind-3.8.1-text-segment.patch
index 8d33d47..40a83ef 100644
--- a/valgrind-3.8.1-text-segment.patch
+++ b/valgrind-3.8.1-text-segment.patch
@@ -876,3 +876,54 @@ diff -ur valgrind-3.8.1.orig/tests/Makefile.in valgrind-3.8.1/tests/Makefile.in
FLAG_UNLIMITED_INLINE_UNIT_GROWTH = @FLAG_UNLIMITED_INLINE_UNIT_GROWTH@
FLAG_W_EXTRA = @FLAG_W_EXTRA@
FLAG_W_NO_EMPTY_BODY = @FLAG_W_NO_EMPTY_BODY@
+
+commit 0e6f91f20c180a37e32a7688b93c94f73aede0b6
+Author: Mark Wielaard <mjw at redhat.com>
+Date: Wed Apr 17 20:30:10 2013 +0200
+
+ Fix -Ttext-segment configure check.
+
+ Explicitly test together with -static -nodefaultlibs -nostartfiles to mimic
+ what the tools linking script does. At least on s390 the test might fail for
+ a non-static AC_LINK, while it does work when using those other flags too.
+
+diff --git a/configure.in b/configure.in
+index 424f8e6..9a1db0c 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1718,10 +1718,10 @@ CFLAGS=$safe_CFLAGS
+ AC_MSG_CHECKING([if the linker accepts -Wl,-Ttext-segment])
+
+ safe_CFLAGS=$CFLAGS
+-CFLAGS="-Wl,-Ttext-segment=$valt_load_address_pri_norml"
++CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml"
+
+ AC_LINK_IFELSE(
+-[AC_LANG_PROGRAM([ ], [return 0;])],
++[AC_LANG_SOURCE([int _start () { return 0; }])],
+ [
+ linker_using_t_text="no"
+ AC_SUBST([FLAG_T_TEXT], ["-Ttext-segment"])
+--- valgrind-3.8.1/configure.orig2 2013-04-17 20:37:38.431443701 +0200
++++ valgrind-3.8.1/configure 2013-04-17 20:38:19.103686995 +0200
+@@ -7932,18 +7932,11 @@
+ $as_echo_n "checking if the linker accepts -Wl,-Ttext-segment... " >&6; }
+
+ safe_CFLAGS=$CFLAGS
+-CFLAGS="-Wl,-Ttext-segment=$valt_load_address_pri_norml"
++CFLAGS="-static -nodefaultlibs -nostartfiles -Wl,-Ttext-segment=$valt_load_address_pri_norml"
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+-
+-int
+-main ()
+-{
+-return 0;
+- ;
+- return 0;
+-}
++int _start () { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+
More information about the scm-commits
mailing list