From 7f58d1e670470e76077102629efabe91e5c2b9bf Mon Sep 17 00:00:00 2001
From: Shane Wang <shane.wang@intel.com>
Date: Fri, 23 Dec 2011 13:25:43 +0800
Subject: valgrind: upgrade to 3.7.0

This patch is to upgrade valgrind to 3.7.0.
The licenses are changed from "Copyright (C) 2000-2010 Julian Seward. All rights reserved." to "Copyright (C) 2000-2011 Julian Seward. All rights reserved."

Signed-off-by: Shane Wang <shane.wang@intel.com>
---
 .../fix_issue_caused_by_ccache.patch               | 32 -------------
 .../valgrind-3.6.1/fix_unsupporting_kernel_3.patch | 26 -----------
 .../valgrind/valgrind-3.6.1/fixed-perl-path.patch  | 53 ----------------------
 .../valgrind/valgrind-3.7.0/configure-fix.patch    | 23 ++++++++++
 .../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 ++++++++++++++++++++++
 meta/recipes-devtools/valgrind/valgrind_3.6.1.bb   | 28 ------------
 meta/recipes-devtools/valgrind/valgrind_3.7.0.bb   | 29 ++++++++++++
 9 files changed, 163 insertions(+), 139 deletions(-)
 delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.6.1/fix_issue_caused_by_ccache.patch
 delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.6.1/fix_unsupporting_kernel_3.patch
 delete mode 100644 meta/recipes-devtools/valgrind/valgrind-3.6.1/fixed-perl-path.patch
 create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-fix.patch
 create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_issue_caused_by_ccache.patch
 create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/fix_unsupporting_kernel_3.patch
 create mode 100644 meta/recipes-devtools/valgrind/valgrind-3.7.0/fixed-perl-path.patch
 delete mode 100644 meta/recipes-devtools/valgrind/valgrind_3.6.1.bb
 create mode 100644 meta/recipes-devtools/valgrind/valgrind_3.7.0.bb

diff --git a/meta/recipes-devtools/valgrind/valgrind-3.6.1/fix_issue_caused_by_ccache.patch b/meta/recipes-devtools/valgrind/valgrind-3.6.1/fix_issue_caused_by_ccache.patch
deleted file mode 100644
index 4658567b2..000000000
--- a/meta/recipes-devtools/valgrind/valgrind-3.6.1/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 <nitin.a.kamble@intel.com>
-
-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.6.1/fix_unsupporting_kernel_3.patch b/meta/recipes-devtools/valgrind/valgrind-3.6.1/fix_unsupporting_kernel_3.patch
deleted file mode 100644
index 346ffebb3..000000000
--- a/meta/recipes-devtools/valgrind/valgrind-3.6.1/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 <tong.lin@intel.com>
-
-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.6.1/fixed-perl-path.patch b/meta/recipes-devtools/valgrind/valgrind-3.6.1/fixed-perl-path.patch
deleted file mode 100644
index b054d05f7..000000000
--- a/meta/recipes-devtools/valgrind/valgrind-3.6.1/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 <qing.he@intel.com>
-
-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/configure-fix.patch b/meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-fix.patch
new file mode 100644
index 000000000..a3fce84c2
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind-3.7.0/configure-fix.patch
@@ -0,0 +1,23 @@
+To recognize gcc version from poky in configure.in
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+diff -r 91a8df96084a configure.in
+--- a/configure.in	Fri Dec 23 20:57:01 2011 +0800
++++ b/configure.in	Fri Dec 23 20:59:21 2011 +0800
+@@ -104,11 +104,13 @@
+ # 
+ # 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"
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
new file mode 100644
index 000000000..4658567b2
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind-3.7.0/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 <nitin.a.kamble@intel.com>
+
+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
new file mode 100644
index 000000000..346ffebb3
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind-3.7.0/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 <tong.lin@intel.com>
+
+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
new file mode 100644
index 000000000..b054d05f7
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind-3.7.0/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 <qing.he@intel.com>
+
+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.6.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.6.1.bb
deleted file mode 100644
index 021caa8a6..000000000
--- a/meta/recipes-devtools/valgrind/valgrind_3.6.1.bb
+++ /dev/null
@@ -1,28 +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=b4765f122b7672cdf9b2e8fd75a33172 \
-                    file://include/valgrind.h;beginline=1;endline=56;md5=13a71cedba99112334d8596162aec37e \
-                    file://COPYING.DOCS;md5=8fdeb5abdb235a08e76835f8f3260215"
-DEPENDS = "virtual/libx11"
-PR = "r1"
-
-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"
-
-SRC_URI[md5sum] = "2c3aa122498baecc9d69194057ca88f5"
-SRC_URI[sha256sum] = "49bdcc4fbcf060049b5f0dcfd8a187a6e90e0b0e57309f633b64e44430726a0e"
-
-COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
-
-inherit autotools
-
-EXTRA_OECONF = "--enable-tls"
-EXTRA_OEMAKE = "-w"
-PARALLEL_MAKE = ""
-
-FILES_${PN}-dbg += "${libdir}/${PN}/*/.debug/*"
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.7.0.bb b/meta/recipes-devtools/valgrind/valgrind_3.7.0.bb
new file mode 100644
index 000000000..03cdd28af
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind_3.7.0.bb
@@ -0,0 +1,29 @@
+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"
+DEPENDS = "virtual/libx11"
+PR = "r0"
+
+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://configure-fix.patch"
+
+SRC_URI[md5sum] = "a855fda56edf05614f099dca316d1775"
+SRC_URI[sha256sum] = "5d62c0330f1481fe2c593249192fa68ff454c19c34343978cc9ce91aa324cbf6"
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+inherit autotools
+
+EXTRA_OECONF = "--enable-tls"
+EXTRA_OEMAKE = "-w"
+PARALLEL_MAKE = ""
+
+FILES_${PN}-dbg += "${libdir}/${PN}/*/.debug/*"
-- 
cgit v1.2.3