]> code.ossystems Code Review - openembedded-core.git/commitdiff
valgrind: import Debian link_tool patch for MIPS
authorAndre McCurdy <armccurdy@gmail.com>
Wed, 9 Dec 2015 18:52:48 +0000 (10:52 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 12 Dec 2015 23:31:43 +0000 (23:31 +0000)
Without this patch, valgrind 3.10.1 fails to run on MIPS:

 | root@bcm97425vms:~# valgrind /bin/ls
 | valgrind: mmap(0x400000, 700416) failed in UME with error 22 (Invalid argument).
 | valgrind: this can be caused by executables with very large text, data or bss segments.

Original Debian bug report:

  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777704

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch [new file with mode: 0644]
meta/recipes-devtools/valgrind/valgrind_3.10.1.bb

diff --git a/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch b/meta/recipes-devtools/valgrind/valgrind/11_mips-link-tool.patch
new file mode 100644 (file)
index 0000000..ecb33b8
--- /dev/null
@@ -0,0 +1,37 @@
+Debian fix for MIPS: mmap(0x400000, 32768) failed in UME with error 22 (Invalid argument)
+
+  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=777704
+
+Upstream-Status: Pending
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+
+Description: Disable the MIPS linker workarounds when using -Ttext-section
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/777704
+Author: James Cowgill <james410@cowgill.org.uk>
+Last-Update: 2015-04-25
+
+--- a/coregrind/link_tool_exe_linux.in
++++ b/coregrind/link_tool_exe_linux.in
+@@ -76,12 +76,13 @@
+ my $arch = substr($x, 0, index($x, "'"));
+ my $extra_args;
+-if (($arch eq 'mips') || ($arch eq 'mipsel')
+-    || ($arch eq 'mipsisa32r2el')) {
+-   $extra_args = "-static -Wl,--section-start=.reginfo=$ala";
+-} elsif (($arch eq 'mips64') || ($arch eq 'mips64el') ||
+-         ($arch eq 'mipsisa64el')) {
+-   $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala";
++if ($arch =~ /^mips/ && "@FLAG_T_TEXT@" eq '-Ttext') {
++   # We only need to use the special mips options when using -Ttext
++   if ($arch =~ /^mips(64|isa64)/) {
++      $extra_args = "-static -Wl,--section-start=.MIPS.options=$ala";
++   } else {
++      $extra_args = "-static -Wl,--section-start=.reginfo=$ala";
++   }
+ } else {
+    $extra_args = "-static -Wl,@FLAG_T_TEXT@=$ala";
+ }
index 86ba979ea878b20817e870494a912a172f80fa24..c386a19e884923be1d29fd79327cdef29e583b78 100644 (file)
@@ -26,6 +26,7 @@ SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
            file://pass-maltivec-only-if-it-supported.patch \
            file://run-ptest \
            file://0001-valgrind-Enable-rt_sigpending-syscall-on-ppc64-linux.patch \
+           file://11_mips-link-tool.patch \
           "
 
 SRC_URI[md5sum] = "60ddae962bc79e7c95cfc4667245707f"