From df0d23c2bedafd534c5909a65afaf3373d7bc33e Mon Sep 17 00:00:00 2001 From: Radu Moisan Date: Tue, 22 Jan 2013 17:29:15 +0200 Subject: valgrind: update to 3.8.1 Changed license copyright notice 2011->2012 remove unnecessary patches built for x86, 86-64, ppc Signed-off-by: Radu Moisan Signed-off-by: Saul Wold --- ...upport-for-PPC-instructions-mfatbu-mfatbl.patch | 96 ---------------------- .../valgrind/valgrind-3.7.0/configure-fix.patch | 40 --------- .../configure-with-newer-glibc.patch | 40 --------- .../valgrind-3.7.0/fix_for_automake_1.11.2.patch | 45 ---------- .../fix_issue_caused_by_ccache.patch | 32 -------- .../valgrind-3.7.0/fix_unsupporting_kernel_3.patch | 26 ------ .../valgrind/valgrind-3.7.0/fixed-perl-path.patch | 53 ------------ ...ind-3.7.0-fix-error-of-reading-debug-info.patch | 33 -------- ...upport-for-PPC-instructions-mfatbu-mfatbl.patch | 96 ++++++++++++++++++++++ .../configure-with-newer-glibc.patch | 41 +++++++++ .../fix_issue_caused_by_ccache.patch | 32 ++++++++ .../valgrind-3.8.1/fix_unsupporting_kernel_3.patch | 26 ++++++ .../valgrind/valgrind-3.8.1/fixed-perl-path.patch | 53 ++++++++++++ meta/recipes-devtools/valgrind/valgrind_3.7.0.bb | 47 ----------- meta/recipes-devtools/valgrind/valgrind_3.8.1.bb | 42 ++++++++++ 15 files changed, 290 insertions(+), 412 deletions(-) delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-fix.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-with-newer-glibc.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_for_automake_1.11.2.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_issue_caused_by_ccache.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_unsupporting_kernel_3.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/fixed-perl-path.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/valgrind-3.7.0-fix-error-of-reading-debug-info.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.8.1/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.8.1/configure-with-newer-glibc.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.8.1/fix_issue_caused_by_ccache.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.8.1/fix_unsupporting_kernel_3.patch create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.8.1/fixed-perl-path.patch delete mode 100644 meta/recipes-devtools/valgrind/valgrind_3.7.0.bb create mode 100644 meta/recipes-devtools/valgrind/valgrind_3.8.1.bb (limited to 'meta/recipes-devtools') diff --git a/meta/recipes-devtools/valgrind/valgrind-3.7.0/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch deleted file mode 100644 index 07774f38a9..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind-3.7.0/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 0bf4b0ac18d1ea41b32ad781d214b295ca1998f3 Mon Sep 17 00:00:00 2001 -From: Aneesh Bansal -Date: Mon, 21 Nov 2011 17:31:39 +0530 -Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl. - -Upstream-Status: Pending - -Signed-off-by: Aneesh Bansal ---- -Currently Valgrind 3.7.0 does not have support for PPC instructions mfatbu and mfatbl. When we run a USDPAA application with VALGRIND, the following error is given by valgrind : -dis_proc_ctl(ppc)(mfspr,SPR)(0x20F) -disInstr(ppc): unhandled instruction: 0x7C0F82A6 - - - VEX/priv/guest_ppc_defs.h | 2 ++ - VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++ - VEX/priv/guest_ppc_toIR.c | 22 ++++++++++++++++++++++ - 3 files changed, 42 insertions(+), 0 deletions(-) - -diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h -index dd3c62e..11a34aa 100644 ---- a/VEX/priv/guest_ppc_defs.h -+++ b/VEX/priv/guest_ppc_defs.h -@@ -146,6 +146,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt ); - - extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void ); - -+extern UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt ); -+ - extern void ppc32g_dirtyhelper_LVS ( VexGuestPPC32State* gst, - UInt vD_idx, UInt sh, - UInt shift_right ); -diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c -index 11aa428..b49ea3f 100644 ---- a/VEX/priv/guest_ppc_helpers.c -+++ b/VEX/priv/guest_ppc_helpers.c -@@ -119,6 +119,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void ) - # endif - } - -+/* CALLED FROM GENERATED CODE */ -+/* DIRTY HELPER (non-referentially transparent) */ -+UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt r527 ) -+{ -+# if defined(__powerpc__) || defined(_AIX) -+ UInt spr; -+ if (r527) { -+ __asm__ __volatile__("mfspr %0,527" : "=b"(spr)); -+ } else { -+ __asm__ __volatile__("mfspr %0,526" : "=b"(spr)); -+ } -+ return spr; -+# else -+ return 0; -+# endif -+} -+ -+ - - /* CALLED FROM GENERATED CODE */ - /* DIRTY HELPER (reads guest state, writes guest mem) */ -diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c -index f8d220d..37c8974 100644 ---- a/VEX/priv/guest_ppc_toIR.c -+++ b/VEX/priv/guest_ppc_toIR.c -@@ -5657,6 +5657,28 @@ static Bool dis_proc_ctl ( VexAbiInfo* vbi, UInt theInstr ) - break; - } - -+ -+ case 526 /* 0x20E */: -+ case 527 /* 0x20F */: { -+ UInt arg = SPR==526 ? 0 : 1; -+ IRTemp val = newTemp(Ity_I32); -+ IRExpr** args = mkIRExprVec_1( mkU32(arg) ); -+ IRDirty* d = unsafeIRDirty_1_N( -+ val, -+ 0/*regparms*/, -+ "ppc32g_dirtyhelper_MFSPR_526_527", -+ fnptr_to_fnentry -+ (vbi, &ppc32g_dirtyhelper_MFSPR_526_527), -+ args -+ ); -+ /* execute the dirty call, dumping the result in val. */ -+ stmt( IRStmt_Dirty(d) ); -+ putIReg( rD_addr, -+ mkWidenFrom32(ty, mkexpr(val), False/*unsigned*/) ); -+ DIP("mfspr r%u,%u", rD_addr, (UInt)SPR); -+ break; -+ } -+ - default: - vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR); - return False; --- -1.7.0.4 diff --git a/meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-fix.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-fix.patch deleted file mode 100644 index 1f4bd7ef40..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-fix.patch +++ /dev/null @@ -1,40 +0,0 @@ -To recognize gcc version from poky in configure.in -Added GLIBC 2.15 stanza to supported GLIBCs - -Upstream-Status: Inappropriate [configuration] - -Signed-off-by: Shane Wang -Signed-off-by: Saul Wold - -Index: valgrind-3.7.0/configure.in -=================================================================== ---- valgrind-3.7.0.orig/configure.in -+++ valgrind-3.7.0/configure.in -@@ -104,11 +104,13 @@ AC_MSG_CHECKING([for a supported version - # - # i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) - # i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) -+# ARCH-VENDOR-OS-gcc (GCC) VERSION Copyright - # - [gcc_version=`${CC} --version \ - | head -n 1 \ - | $SED 's/i686-apple-darwin10//' \ - | $SED 's/i686-apple-darwin11//' \ -+ | $SED 's/.*GCC[^0-9]*//' \ - | $SED 's/^[^0-9]*\([0-9.]*\).*$/\1/'`] - - is_clang="notclang" -@@ -779,6 +781,13 @@ case "${GLIBC_VERSION}" in - DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" - DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; -+ 2.15) -+ AC_MSG_RESULT(2.15 family) -+ AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x]) -+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ ;; - darwin) - AC_MSG_RESULT(Darwin) - AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) diff --git a/meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-with-newer-glibc.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-with-newer-glibc.patch deleted file mode 100644 index b369de8901..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-with-newer-glibc.patch +++ /dev/null @@ -1,40 +0,0 @@ -Add case for glibc 2.16 and correct error message to denote support until 2.16 - -Signed-off-by: Khem Raj -Signed-off-by: Saul Wold - -Upstream-Status: Pending -Index: valgrind-3.7.0/configure.in -=================================================================== ---- valgrind-3.7.0.orig/configure.in -+++ valgrind-3.7.0/configure.in -@@ -788,6 +788,20 @@ case "${GLIBC_VERSION}" in - DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" - DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" - ;; -+ 2.16) -+ AC_MSG_RESULT(2.16 family) -+ AC_DEFINE([GLIBC_2_16], 1, [Define to 1 if you're using glibc 2.16.x]) -+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ ;; -+ 2.17) -+ AC_MSG_RESULT(2.17 family) -+ AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x]) -+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" -+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" -+ ;; - darwin) - AC_MSG_RESULT(Darwin) - AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) -@@ -801,7 +815,7 @@ case "${GLIBC_VERSION}" in - - *) - AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) -- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.14]) -+ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.17]) - AC_MSG_ERROR([or Darwin libc]) - ;; - esac diff --git a/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_for_automake_1.11.2.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_for_automake_1.11.2.patch deleted file mode 100644 index 866facfeb2..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_for_automake_1.11.2.patch +++ /dev/null @@ -1,45 +0,0 @@ -Upstream-Status: Pending - -automake version 1.11.2 has made use of dir variables more strict. -the use of pkglibdir with DATA var results in automake errors. - -This commits uses pkgdatadir var instead of pkglibdir to avoid -the strict check errors. - -RP 2012/1/4 - -Index: valgrind-3.7.0/Makefile.am -=================================================================== ---- valgrind-3.7.0.orig/Makefile.am 2012-01-04 15:55:07.034044860 +0000 -+++ valgrind-3.7.0/Makefile.am 2012-01-04 15:55:55.034035120 +0000 -@@ -61,7 +61,7 @@ - # default.supp, as it is built from the base .supp files at compile-time. - dist_noinst_DATA = $(SUPP_FILES) - --pkglib_DATA = default.supp -+pkgdata_DATA = default.supp - - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = valgrind.pc -Index: valgrind-3.7.0/coregrind/Makefile.am -=================================================================== ---- valgrind-3.7.0.orig/coregrind/Makefile.am 2012-01-04 15:55:02.090043851 +0000 -+++ valgrind-3.7.0/coregrind/Makefile.am 2012-01-04 15:55:30.270044097 +0000 -@@ -495,7 +495,7 @@ - m_gdbserver/powerpc-altivec64l.xml - - # so as to make sure these get copied into the install tree --pkglib_DATA = $(GDBSERVER_XML_FILES) -+pkgdata_DATA = $(GDBSERVER_XML_FILES) - - # so as to make sure these get copied into the tarball - EXTRA_DIST += $(GDBSERVER_XML_FILES) -@@ -506,7 +506,7 @@ - - all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS - mkdir -p $(inplacedir); \ -- for f in $(pkglib_DATA); do \ -+ for f in $(pkgdata_DATA); do \ - rm -f $(inplacedir)/$$f; \ - ln -f -s ../$(subdir)/$$f $(inplacedir); \ - done diff --git a/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_issue_caused_by_ccache.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_issue_caused_by_ccache.patch deleted file mode 100644 index 4658567b21..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_issue_caused_by_ccache.patch +++ /dev/null @@ -1,32 +0,0 @@ -The script does not expect use of ccache, hence fix it to recognise it. - -2010/08/17 -Nitin A Kamble - -Upstream-Status: Inappropriate [configuration] - -Index: valgrind-3.5.0/coregrind/link_tool_exe_linux.in -=================================================================== ---- valgrind-3.5.0.orig/coregrind/link_tool_exe_linux.in -+++ valgrind-3.5.0/coregrind/link_tool_exe_linux.in -@@ -62,6 +62,11 @@ die "Bogus alt-load address" - - # The cc invokation to do the final link - my $cc = $ARGV[1]; -+my $next = 2; -+if ("$cc" eq "ccache") { -+ $cc = "$cc $ARGV[2]"; -+ $next = 3; -+} - - # and the 'restargs' are argv[2 ..] - -@@ -71,7 +76,7 @@ my $cc = $ARGV[1]; - my $cmd="$cc -static -Wl,-Ttext=$ala"; - - # Add the rest of the parameters --foreach my $n (2 .. $#ARGV) { -+foreach my $n ($next .. $#ARGV) { - $cmd = "$cmd $ARGV[$n]"; - } - diff --git a/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_unsupporting_kernel_3.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_unsupporting_kernel_3.patch deleted file mode 100644 index 346ffebb3d..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_unsupporting_kernel_3.patch +++ /dev/null @@ -1,26 +0,0 @@ -valgrind: Add 3.x statements to "case" for supporting the kernel 3.x - -Signed-off-by: Lin Tong - -Upstream-Status: Pending - -diff --git a/configure.in b/configure.in -index 3878619..1cb7dc7 100644 ---- a/configure.in -+++ b/configure.in -@@ -229,10 +229,14 @@ case "${host_os}" in - AC_MSG_RESULT([2.4 family (${kernel})]) - AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) - ;; -+ 3.*) -+ AC_MSG_RESULT([3 family (${kernel})]) -+ AC_DEFINE([KERNEL_3], 1, [Define to 1 if you're using Linux 3.x]) -+ ;; - - *) - AC_MSG_RESULT([unsupported (${kernel})]) -- AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6]) -+ AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6, 3.x]) - ;; - esac - diff --git a/meta/recipes-devtools/valgrind/valgrind-3.7.0/fixed-perl-path.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/fixed-perl-path.patch deleted file mode 100644 index b054d05f7f..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind-3.7.0/fixed-perl-path.patch +++ /dev/null @@ -1,53 +0,0 @@ -this is a temporary patch to workaround cross compilation. -otherwise @PERL@ will be replaced to perl-native binary, -this creates unusable scripts and fails FILERDEPENDS mechanism -(esp. rpm) - -a better fix would need: - 1. configure.ac should differentiate PERL and HOSTPERL - 2. optionally remove ${STAGING_DIR} in #! line before do_install - -8/31/2010 - created by Qing He - -Upstream-Status: Inappropriate [configuration] - -diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in -index 9dc9565..cc4ef05 100644 ---- a/cachegrind/cg_annotate.in -+++ b/cachegrind/cg_annotate.in -@@ -1,4 +1,4 @@ --#! @PERL@ -+#! /usr/bin/perl - - ##--------------------------------------------------------------------## - ##--- Cachegrind's annotator. cg_annotate.in ---## -diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in -index 951066e..84c2dde 100644 ---- a/cachegrind/cg_diff.in -+++ b/cachegrind/cg_diff.in -@@ -1,4 +1,4 @@ --#! @PERL@ -+#! /usr/bin/perl - - ##--------------------------------------------------------------------## - ##--- Cachegrind's differencer. cg_diff.in ---## -diff --git a/massif/ms_print.in b/massif/ms_print.in -index e6ffdbf..fb45906 100755 ---- a/massif/ms_print.in -+++ b/massif/ms_print.in -@@ -1,4 +1,4 @@ --#! @PERL@ -+#! /usr/bin/perl - - ##--------------------------------------------------------------------## - ##--- Massif's results printer ms_print.in ---## -diff --git a/perf/vg_perf.in b/perf/vg_perf.in -index 2188a31..83ad024 100644 ---- a/perf/vg_perf.in -+++ b/perf/vg_perf.in -@@ -1,4 +1,4 @@ --#! @PERL@ -+#! /usr/bin/perl - ##--------------------------------------------------------------------## - ##--- Valgrind performance testing script vg_perf ---## - ##--------------------------------------------------------------------## diff --git a/meta/recipes-devtools/valgrind/valgrind-3.7.0/valgrind-3.7.0-fix-error-of-reading-debug-info.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/valgrind-3.7.0-fix-error-of-reading-debug-info.patch deleted file mode 100644 index b1626f0b0f..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind-3.7.0/valgrind-3.7.0-fix-error-of-reading-debug-info.patch +++ /dev/null @@ -1,33 +0,0 @@ -Upstream-Status: Pending - -fix debug info reading error when do memcheck on ppc targets - following is the error message: - --2263-- WARNING: Serious error when reading debug info - --2263-- When reading debug info from /lib/ld-2.13.so: - --2263-- Can't make sense of .got section mapping - --2263-- WARNING: Serious error when reading debug info - --2263-- When reading debug info from /home/root/lzh: - --2263-- Can't make sense of .data section mapping - --2263-- WARNING: Serious error when reading debug info - --2263-- When reading debug info from /usr/lib/valgrind/vgpreload_core-ppc32-linux.so: - --2263-- Can't make sense of .data section mapping - --2263-- WARNING: Serious error when reading debug info - --2263-- When reading debug info from /usr/lib/valgrind/vgpreload_memcheck-ppc32-linux.so: - --2263-- Can't make sense of .data section mapping - --2263-- WARNING: Serious error when reading debug info - --2263-- When reading debug info from /lib/libc-2.13.so: - --2263-- Can't make sense of .data section mapping - -Signed-off-by: Zhenhua Luo - ---- a/coregrind/m_debuginfo/readelf.c 2012-09-11 21:45:36.696462313 -0500 -+++ b/coregrind/m_debuginfo/readelf.c 2012-09-11 21:45:49.913463615 -0500 -@@ -1539,7 +1539,7 @@ - && phdr->p_offset < di->fsm.rw_map_foff + di->fsm.rw_map_size - && phdr->p_offset + phdr->p_filesz - <= di->fsm.rw_map_foff + di->fsm.rw_map_size -- && (phdr->p_flags & (PF_R | PF_W | PF_X)) == (PF_R | PF_W)) { -+ && (phdr->p_flags & (PF_R | PF_W | PF_X)) >= (PF_R | PF_W)) { - if (n_rw == N_RX_RW_AREAS) { - ML_(symerr)(di, True, - "N_RX_RW_AREAS is too low; " diff --git a/meta/recipes-devtools/valgrind/valgrind-3.8.1/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch b/meta/recipes-devtools/valgrind/valgrind-3.8.1/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch new file mode 100644 index 0000000000..07774f38a9 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind-3.8.1/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch @@ -0,0 +1,96 @@ +From 0bf4b0ac18d1ea41b32ad781d214b295ca1998f3 Mon Sep 17 00:00:00 2001 +From: Aneesh Bansal +Date: Mon, 21 Nov 2011 17:31:39 +0530 +Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl. + +Upstream-Status: Pending + +Signed-off-by: Aneesh Bansal +--- +Currently Valgrind 3.7.0 does not have support for PPC instructions mfatbu and mfatbl. When we run a USDPAA application with VALGRIND, the following error is given by valgrind : +dis_proc_ctl(ppc)(mfspr,SPR)(0x20F) +disInstr(ppc): unhandled instruction: 0x7C0F82A6 + + + VEX/priv/guest_ppc_defs.h | 2 ++ + VEX/priv/guest_ppc_helpers.c | 18 ++++++++++++++++++ + VEX/priv/guest_ppc_toIR.c | 22 ++++++++++++++++++++++ + 3 files changed, 42 insertions(+), 0 deletions(-) + +diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h +index dd3c62e..11a34aa 100644 +--- a/VEX/priv/guest_ppc_defs.h ++++ b/VEX/priv/guest_ppc_defs.h +@@ -146,6 +146,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt ); + + extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void ); + ++extern UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt ); ++ + extern void ppc32g_dirtyhelper_LVS ( VexGuestPPC32State* gst, + UInt vD_idx, UInt sh, + UInt shift_right ); +diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c +index 11aa428..b49ea3f 100644 +--- a/VEX/priv/guest_ppc_helpers.c ++++ b/VEX/priv/guest_ppc_helpers.c +@@ -119,6 +119,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void ) + # endif + } + ++/* CALLED FROM GENERATED CODE */ ++/* DIRTY HELPER (non-referentially transparent) */ ++UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt r527 ) ++{ ++# if defined(__powerpc__) || defined(_AIX) ++ UInt spr; ++ if (r527) { ++ __asm__ __volatile__("mfspr %0,527" : "=b"(spr)); ++ } else { ++ __asm__ __volatile__("mfspr %0,526" : "=b"(spr)); ++ } ++ return spr; ++# else ++ return 0; ++# endif ++} ++ ++ + + /* CALLED FROM GENERATED CODE */ + /* DIRTY HELPER (reads guest state, writes guest mem) */ +diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c +index f8d220d..37c8974 100644 +--- a/VEX/priv/guest_ppc_toIR.c ++++ b/VEX/priv/guest_ppc_toIR.c +@@ -5657,6 +5657,28 @@ static Bool dis_proc_ctl ( VexAbiInfo* vbi, UInt theInstr ) + break; + } + ++ ++ case 526 /* 0x20E */: ++ case 527 /* 0x20F */: { ++ UInt arg = SPR==526 ? 0 : 1; ++ IRTemp val = newTemp(Ity_I32); ++ IRExpr** args = mkIRExprVec_1( mkU32(arg) ); ++ IRDirty* d = unsafeIRDirty_1_N( ++ val, ++ 0/*regparms*/, ++ "ppc32g_dirtyhelper_MFSPR_526_527", ++ fnptr_to_fnentry ++ (vbi, &ppc32g_dirtyhelper_MFSPR_526_527), ++ args ++ ); ++ /* execute the dirty call, dumping the result in val. */ ++ stmt( IRStmt_Dirty(d) ); ++ putIReg( rD_addr, ++ mkWidenFrom32(ty, mkexpr(val), False/*unsigned*/) ); ++ DIP("mfspr r%u,%u", rD_addr, (UInt)SPR); ++ break; ++ } ++ + default: + vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR); + return False; +-- +1.7.0.4 diff --git a/meta/recipes-devtools/valgrind/valgrind-3.8.1/configure-with-newer-glibc.patch b/meta/recipes-devtools/valgrind/valgrind-3.8.1/configure-with-newer-glibc.patch new file mode 100644 index 0000000000..d3cea234cb --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind-3.8.1/configure-with-newer-glibc.patch @@ -0,0 +1,41 @@ +Add case for glibc 2.16 and correct error message to denote support until 2.16 + +Signed-off-by: Khem Raj +Signed-off-by: Saul Wold +Signed-off-by: Radu Moisan + +Upstream-Status: Pending +Index: valgrind-3.8.1/configure.in +=================================================================== +--- valgrind-3.8.1.orig/configure.in ++++ valgrind-3.8.1/configure.in +@@ -910,6 +910,20 @@ case "${GLIBC_VERSION}" in + DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" + ;; ++ 2.16) ++ AC_MSG_RESULT(2.16 family) ++ AC_DEFINE([GLIBC_2_16], 1, [Define to 1 if you're using glibc 2.16.x]) ++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" ++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" ++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ++ ;; ++ 2.17) ++ AC_MSG_RESULT(2.17 family) ++ AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x]) ++ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" ++ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" ++ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ++ ;; + darwin) + AC_MSG_RESULT(Darwin) + AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin]) +@@ -923,7 +937,7 @@ case "${GLIBC_VERSION}" in + + *) + AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) +- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.16]) ++ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.17]) + AC_MSG_ERROR([or Darwin libc]) + ;; + esac diff --git a/meta/recipes-devtools/valgrind/valgrind-3.8.1/fix_issue_caused_by_ccache.patch b/meta/recipes-devtools/valgrind/valgrind-3.8.1/fix_issue_caused_by_ccache.patch new file mode 100644 index 0000000000..4658567b21 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind-3.8.1/fix_issue_caused_by_ccache.patch @@ -0,0 +1,32 @@ +The script does not expect use of ccache, hence fix it to recognise it. + +2010/08/17 +Nitin A Kamble + +Upstream-Status: Inappropriate [configuration] + +Index: valgrind-3.5.0/coregrind/link_tool_exe_linux.in +=================================================================== +--- valgrind-3.5.0.orig/coregrind/link_tool_exe_linux.in ++++ valgrind-3.5.0/coregrind/link_tool_exe_linux.in +@@ -62,6 +62,11 @@ die "Bogus alt-load address" + + # The cc invokation to do the final link + my $cc = $ARGV[1]; ++my $next = 2; ++if ("$cc" eq "ccache") { ++ $cc = "$cc $ARGV[2]"; ++ $next = 3; ++} + + # and the 'restargs' are argv[2 ..] + +@@ -71,7 +76,7 @@ my $cc = $ARGV[1]; + my $cmd="$cc -static -Wl,-Ttext=$ala"; + + # Add the rest of the parameters +-foreach my $n (2 .. $#ARGV) { ++foreach my $n ($next .. $#ARGV) { + $cmd = "$cmd $ARGV[$n]"; + } + diff --git a/meta/recipes-devtools/valgrind/valgrind-3.8.1/fix_unsupporting_kernel_3.patch b/meta/recipes-devtools/valgrind/valgrind-3.8.1/fix_unsupporting_kernel_3.patch new file mode 100644 index 0000000000..346ffebb3d --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind-3.8.1/fix_unsupporting_kernel_3.patch @@ -0,0 +1,26 @@ +valgrind: Add 3.x statements to "case" for supporting the kernel 3.x + +Signed-off-by: Lin Tong + +Upstream-Status: Pending + +diff --git a/configure.in b/configure.in +index 3878619..1cb7dc7 100644 +--- a/configure.in ++++ b/configure.in +@@ -229,10 +229,14 @@ case "${host_os}" in + AC_MSG_RESULT([2.4 family (${kernel})]) + AC_DEFINE([KERNEL_2_4], 1, [Define to 1 if you're using Linux 2.4.x]) + ;; ++ 3.*) ++ AC_MSG_RESULT([3 family (${kernel})]) ++ AC_DEFINE([KERNEL_3], 1, [Define to 1 if you're using Linux 3.x]) ++ ;; + + *) + AC_MSG_RESULT([unsupported (${kernel})]) +- AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6]) ++ AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6, 3.x]) + ;; + esac + diff --git a/meta/recipes-devtools/valgrind/valgrind-3.8.1/fixed-perl-path.patch b/meta/recipes-devtools/valgrind/valgrind-3.8.1/fixed-perl-path.patch new file mode 100644 index 0000000000..b054d05f7f --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind-3.8.1/fixed-perl-path.patch @@ -0,0 +1,53 @@ +this is a temporary patch to workaround cross compilation. +otherwise @PERL@ will be replaced to perl-native binary, +this creates unusable scripts and fails FILERDEPENDS mechanism +(esp. rpm) + +a better fix would need: + 1. configure.ac should differentiate PERL and HOSTPERL + 2. optionally remove ${STAGING_DIR} in #! line before do_install + +8/31/2010 - created by Qing He + +Upstream-Status: Inappropriate [configuration] + +diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in +index 9dc9565..cc4ef05 100644 +--- a/cachegrind/cg_annotate.in ++++ b/cachegrind/cg_annotate.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/perl + + ##--------------------------------------------------------------------## + ##--- Cachegrind's annotator. cg_annotate.in ---## +diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in +index 951066e..84c2dde 100644 +--- a/cachegrind/cg_diff.in ++++ b/cachegrind/cg_diff.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/perl + + ##--------------------------------------------------------------------## + ##--- Cachegrind's differencer. cg_diff.in ---## +diff --git a/massif/ms_print.in b/massif/ms_print.in +index e6ffdbf..fb45906 100755 +--- a/massif/ms_print.in ++++ b/massif/ms_print.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/perl + + ##--------------------------------------------------------------------## + ##--- Massif's results printer ms_print.in ---## +diff --git a/perf/vg_perf.in b/perf/vg_perf.in +index 2188a31..83ad024 100644 +--- a/perf/vg_perf.in ++++ b/perf/vg_perf.in +@@ -1,4 +1,4 @@ +-#! @PERL@ ++#! /usr/bin/perl + ##--------------------------------------------------------------------## + ##--- Valgrind performance testing script vg_perf ---## + ##--------------------------------------------------------------------## diff --git a/meta/recipes-devtools/valgrind/valgrind_3.7.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.7.0.bb deleted file mode 100644 index 690652a9a8..0000000000 --- a/meta/recipes-devtools/valgrind/valgrind_3.7.0.bb +++ /dev/null @@ -1,47 +0,0 @@ -DESCRIPTION = "Valgrind memory debugger" -HOMEPAGE = "http://valgrind.org/" -BUGTRACKER = "http://valgrind.org/support/bug_reports.html" -LICENSE = "GPLv2 & GPLv2+ & BSD" -LIC_FILES_CHKSUM = "file://COPYING;md5=c46082167a314d785d012a244748d803 \ - file://include/pub_tool_basics.h;beginline=1;endline=29;md5=0ef036a7ddce4cdc738d65d63b3e8153 \ - file://include/valgrind.h;beginline=1;endline=56;md5=aee56014c1dd64260a59fd4df38752f6 \ - file://COPYING.DOCS;md5=8fdeb5abdb235a08e76835f8f3260215" - -X11DEPENDS = "virtual/libx11" -DEPENDS = "${@base_contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)}" -PR = "r8" - -SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \ - file://fix_issue_caused_by_ccache.patch \ - file://fix_unsupporting_kernel_3.patch \ - file://fixed-perl-path.patch \ - file://fix_for_automake_1.11.2.patch \ - file://configure-fix.patch \ - file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \ - file://configure-with-newer-glibc.patch \ - " - -SRC_URI_append_powerpc = " file://valgrind-3.7.0-fix-error-of-reading-debug-info.patch" -SRC_URI_append_powerpc64 = " file://valgrind-3.7.0-fix-error-of-reading-debug-info.patch" - -SRC_URI[md5sum] = "a855fda56edf05614f099dca316d1775" -SRC_URI[sha256sum] = "5d62c0330f1481fe2c593249192fa68ff454c19c34343978cc9ce91aa324cbf6" - -COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64).*-linux' -COMPATIBLE_HOST_armv7a = 'arm.*-linux' - -inherit autotools - -EXTRA_OECONF = "--enable-tls --without-mpicc" -EXTRA_OECONF_armv7a = "--enable-tls -host=armv7-none-linux-gnueabi --without-mpicc" -EXTRA_OEMAKE = "-w" -PARALLEL_MAKE = "" - -do_install_append () { - install -m 644 ${S}/default.supp ${D}/${libdir}/valgrind/ -} - -FILES_${PN}-dbg += "${libdir}/${PN}/*/.debug/*" -RRECOMMENDS_${PN}_powerpc += "${TCLIBC}-dbg" -RRECOMMENDS_${PN}_powerpc64 += "${TCLIBC}-dbg" -RRECOMMENDS_${PN}_armv7a += "${TCLIBC}-dbg" diff --git a/meta/recipes-devtools/valgrind/valgrind_3.8.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.8.1.bb new file mode 100644 index 0000000000..75c3e73731 --- /dev/null +++ b/meta/recipes-devtools/valgrind/valgrind_3.8.1.bb @@ -0,0 +1,42 @@ +DESCRIPTION = "Valgrind memory debugger" +HOMEPAGE = "http://valgrind.org/" +BUGTRACKER = "http://valgrind.org/support/bug_reports.html" +LICENSE = "GPLv2 & GPLv2+ & BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=c46082167a314d785d012a244748d803 \ + file://include/pub_tool_basics.h;beginline=1;endline=29;md5=6b18ba0139d10678ce3a9969f68e4c6d \ + file://include/valgrind.h;beginline=1;endline=56;md5=b6bb5ab625a759823e17197ec3e2ee83 \ + file://COPYING.DOCS;md5=8fdeb5abdb235a08e76835f8f3260215" + +X11DEPENDS = "virtual/libx11" +DEPENDS = "${@base_contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)}" +PR = "r8" + +SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \ + file://fix_issue_caused_by_ccache.patch \ + file://fix_unsupporting_kernel_3.patch \ + file://fixed-perl-path.patch \ + file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \ + file://configure-with-newer-glibc.patch \ + " + +SRC_URI[md5sum] = "288758010b271119a0ffc0183f1d6e38" +SRC_URI[sha256sum] = "473be00576bed311a662b277a2bfbe97d9cca4058e68619a0e420c9fc19958db" + +COMPATIBLE_HOST = '(i.86|x86_64|powerpc|powerpc64).*-linux' +COMPATIBLE_HOST_armv7a = 'arm.*-linux' + +inherit autotools + +EXTRA_OECONF = "--enable-tls --without-mpicc" +EXTRA_OECONF_armv7a = "--enable-tls -host=armv7-none-linux-gnueabi --without-mpicc" +EXTRA_OEMAKE = "-w" +PARALLEL_MAKE = "" + +do_install_append () { + install -m 644 ${S}/default.supp ${D}/${libdir}/valgrind/ +} + +FILES_${PN}-dbg += "${libdir}/${PN}/*/.debug/*" +RRECOMMENDS_${PN}_powerpc += "${TCLIBC}-dbg" +RRECOMMENDS_${PN}_powerpc64 += "${TCLIBC}-dbg" +RRECOMMENDS_${PN}_armv7a += "${TCLIBC}-dbg" -- cgit v1.2.3