[kernel] r15969 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Fri Jul 9 04:20:47 UTC 2010


Author: benh
Date: Fri Jul  9 04:20:35 2010
New Revision: 15969

Log:
perf: Replace my patches with upstream patches

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-Use-default-compiler-mode-by-default.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Add-V-2-option-to-help-debug-config-issue.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Add-make-DEBUG-1-to-remove-the-O6-cflag.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Check-if-dev-null-can-be-used-as-the-o-gc.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Display-better-error-messages-on-missing-.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Move-QUIET_STDERR-def-to-before-first-use.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Suggest-static-libraries-as-well.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Support-static-build.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Test-fstack-protector-all-compiler-option.patch
Deleted:
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-Dont-hide-errors-from-libelf-test.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-Dont-use-dev-null-as-output-for-libelf-test.patch
   dists/sid/linux-2.6/debian/patches/bugfix/all/perf-Use-sane-default-CFLAGS.patch
Modified:
   dists/sid/linux-2.6/debian/patches/series/17
   dists/sid/linux-2.6/debian/rules.real

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-Use-default-compiler-mode-by-default.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-Use-default-compiler-mode-by-default.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,71 @@
+From 99f941ef7d653a9a7a163b9b83863c55556033ea Mon Sep 17 00:00:00 2001
+From: Michael S. Tsirkin <mst at redhat.com>
+Date: Sun, 22 Nov 2009 14:13:35 +0200
+Subject: [PATCH 7/9] perf: Use default compiler mode by default
+
+commit 81516c5fc83a13a1d12f466aa7e14f5fd62a63ce upstream.
+
+gcc with no flags typically is a sane default for systems to
+use, and looking at the running kernel is probably broken for
+cross-builds anyway, so let's not do this.  Add EXTRA_CFLAGS so
+that users can override default gcc mode if they want to.
+
+Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
+Acked-by: Arjan van de Ven <arjan at infradead.org>
+Cc: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Paul Mackerras <paulus at samba.org>
+Cc: Frederic Weisbecker <fweisbec at gmail.com>
+Cc: Arnaldo Carvalho de Melo <acme at redhat.com>
+LKML-Reference: <20091122121335.GA24254 at redhat.com>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |   18 +++---------------
+ 1 files changed, 3 insertions(+), 15 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 0a14f98..1b2f98f 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -148,6 +148,8 @@ all::
+ # broken, or spawning external process is slower than built-in grep perf has).
+ #
+ # Define LDFLAGS=-static to build a static binary.
++#
++# Define EXTRA_CFLAGS=-m64 or EXTRA_CFLAGS=-m32 as appropriate for cross-builds.
+ 
+ PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
+ 	@$(SHELL_PATH) util/PERF-VERSION-GEN
+@@ -160,20 +162,6 @@ uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not')
+ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
+ uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not')
+ 
+-#
+-# Add -m32 for cross-builds:
+-#
+-ifdef NO_64BIT
+-  MBITS := -m32
+-else
+-  #
+-  # If we're on a 64-bit kernel, use -m64:
+-  #
+-  ifneq ($(patsubst %64,%,$(uname_M)),$(uname_M))
+-    MBITS := -m64
+-  endif
+-endif
+-
+ # CFLAGS and LDFLAGS are for the users to override from the command line.
+ 
+ #
+@@ -210,7 +198,7 @@ ifndef PERF_DEBUG
+   CFLAGS_OPTIMIZE = -O6
+ endif
+ 
+-CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
++CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
+ EXTLIBS = -lpthread -lrt -lelf -lm
+ ALL_CFLAGS = $(CFLAGS)
+ ALL_LDFLAGS = $(LDFLAGS)
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Add-V-2-option-to-help-debug-config-issue.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Add-V-2-option-to-help-debug-config-issue.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,98 @@
+From 705d73a542804f85730476a29b132c6e756213b4 Mon Sep 17 00:00:00 2001
+From: Michael S. Tsirkin <mst at redhat.com>
+Date: Sun, 22 Nov 2009 13:27:27 +0200
+Subject: [PATCH 5/9] perf tools: Add V=2 option to help debug config issues
+
+commit 7baed9af4bf0d7850045e36d19a43a2c76872b62 upstream.
+
+Make standard error show up on console when V=2 is set.
+
+Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
+Cc: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Paul Mackerras <paulus at samba.org>
+Cc: Frederic Weisbecker <fweisbec at gmail.com>
+Cc: Arnaldo Carvalho de Melo <acme at redhat.com>
+LKML-Reference: <20091122112726.GC13644 at redhat.com>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |   22 ++++++++++++++--------
+ 1 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 7313b25..8729ee3 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -2,6 +2,7 @@
+ all::
+ 
+ # Define V=1 to have a more verbose compile.
++# Define V=2 to have an even more verbose compile.
+ #
+ # Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
+ # or vsnprintf() return -1 instead of number of characters which would
+@@ -263,7 +264,7 @@ PTHREAD_LIBS = -lpthread
+ # explicitly what architecture to check for. Fix this up for yours..
+ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
+ 
+-ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null >/dev/null 2>&1 && echo y"), y)
++ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y)
+   CFLAGS := $(CFLAGS) -fstack-protector-all
+ endif
+ 
+@@ -408,6 +409,11 @@ BUILTIN_OBJS += builtin-trace.o
+ 
+ PERFLIBS = $(LIB_FILE)
+ 
++ifeq ($(V), 2)
++	QUIET_STDERR = ">/dev/null"
++else
++	QUIET_STDERR = ">/dev/null 2>&1"
++endif
+ #
+ # Platform specific tweaks
+ #
+@@ -435,12 +441,12 @@ ifeq ($(uname_S),Darwin)
+ 	PTHREAD_LIBS =
+ endif
+ 
+-ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
++ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+ 	msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
+ endif
+ 
+-ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
+-	ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
++ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
++	ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+ 		BASIC_CFLAGS += -DLIBELF_NO_MMAP
+ 	endif
+ else
+@@ -450,20 +456,20 @@ endif
+ ifdef NO_DEMANGLE
+ 	BASIC_CFLAGS += -DNO_DEMANGLE
+ else
+-	has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd > /dev/null 2>&1 && echo y")
++	has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")
+ 
+ 	ifeq ($(has_bfd),y)
+ 		EXTLIBS += -lbfd
+ 	else
+-		has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty > /dev/null 2>&1 && echo y")
++		has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")
+ 		ifeq ($(has_bfd_iberty),y)
+ 			EXTLIBS += -lbfd -liberty
+ 		else
+-			has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
++			has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")
+ 			ifeq ($(has_bfd_iberty_z),y)
+ 				EXTLIBS += -lbfd -liberty -lz
+ 			else
+-				has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty > /dev/null 2>&1 && echo y")
++				has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")
+ 				ifeq ($(has_cplus_demangle),y)
+ 					EXTLIBS += -liberty
+ 					BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Add-make-DEBUG-1-to-remove-the-O6-cflag.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Add-make-DEBUG-1-to-remove-the-O6-cflag.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,47 @@
+From f629c4d7a9394fc5de9aa756216474f4849ddcd3 Mon Sep 17 00:00:00 2001
+From: Steven Rostedt <srostedt at redhat.com>
+Date: Tue, 20 Oct 2009 19:19:34 -0400
+Subject: [PATCH 2/9] perf tools: Add 'make DEBUG=1' to remove the -O6 cflag
+
+commit 60d526f7fa6246b8e32d5b45610d625a5608d988 upstream.
+
+When using gdb to debug perf, it is practically impossible to
+use when perf is compiled with -O6. For developers, this patch
+adds the DEBUG feature to the make command line so that a
+developer can easily remove the optimization flag.
+
+LKML-Reference: <1255590330.8392.446.camel at twins>
+Signed-off-by: Steven Rostedt <rostedt at goodmis.org>
+Cc: Peter Zijlstra <peterz at infradead.org>
+Cc: Frederic Weisbecker <fweisbec at gmail.com>
+Cc: Arnaldo Carvalho de Melo <acme at redhat.com>
+LKML-Reference: <20091020232033.984323261 at goodmis.org>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |    9 ++++++++-
+ 1 files changed, 8 insertions(+), 1 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 3a018b5..2528a60 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -200,7 +200,14 @@ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wold-style-definition
+ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wstrict-prototypes
+ EXTRA_WARNINGS := $(EXTRA_WARNINGS) -Wdeclaration-after-statement
+ 
+-CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror -O6 -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
++ifeq ("$(origin DEBUG)", "command line")
++  PERF_DEBUG = $(DEBUG)
++endif
++ifndef PERF_DEBUG
++  CFLAGS_OPTIMIZE = -O6
++endif
++
++CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
+ LDFLAGS = -lpthread -lrt -lelf -lm
+ ALL_CFLAGS = $(CFLAGS)
+ ALL_LDFLAGS = $(LDFLAGS)
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Check-if-dev-null-can-be-used-as-the-o-gc.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Check-if-dev-null-can-be-used-as-the-o-gc.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,128 @@
+From 8cbf87d7264718fa672bacc12a6ab37faa777014 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme at redhat.com>
+Date: Tue, 12 Jan 2010 08:58:30 -0200
+Subject: [PATCH 9/9] perf tools: Check if /dev/null can be used as the -o gcc argument
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit 1703f2c321a8a531c393e137a82602e16c6061cb upstream.
+
+At least on Debian PARISC64, using:
+
+acme at parisc:~/git/linux-2.6-tip$ gcc -v
+Using built-in specs.
+Target: hppa-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian
+4.3.4-6' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
+--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
+--enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --disable-libssp --enable-checking=release --build=hppa-linux-gnu --host=hppa-linux-gnu --target=hppa-linux-gnu Thread model: posix gcc version 4.3.4 (Debian 4.3.4-6)
+
+there are issues about using 'gcc -o /dev/null':
+
+/usr/bin/ld: final link failed: File truncated
+collect2: ld returned 1 exit status
+
+So we test that and use /dev/null in environments where it
+works, while using an .INTERMEDIATE file on those where it can't
+be used, so that the .perf.dev.null file can be used instead and
+then deleted when make exits.
+
+Researched-with: Kyle McMartin <kyle at mcmartin.ca>
+Researched-with: Mauro Carvalho Chehab <mchehab at redhat.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme at redhat.com>
+Cc: Frédéric Weisbecker <fweisbec at gmail.com>
+Cc: Mike Galbraith <efault at gmx.de>
+Cc: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Paul Mackerras <paulus at samba.org>
+LKML-Reference: <1263293910-8484-2-git-send-email-acme at infradead.org>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |   29 ++++++++++++++++++++---------
+ 1 files changed, 20 insertions(+), 9 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 848b4c6..04f8ee5 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -258,7 +258,13 @@ else
+ 	QUIET_STDERR = ">/dev/null 2>&1"
+ endif
+ 
+-ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y)
++BITBUCKET = "/dev/null"
++
++ifneq ($(shell sh -c "(echo '\#include <stdio.h>'; echo 'int main(void) { return puts(\"hi\"); }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) "$(QUIET_STDERR)" && echo y"), y)
++	BITBUCKET = .perf.dev.null
++endif
++
++ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o $(BITBUCKET) "$(QUIET_STDERR)" && echo y"), y)
+   CFLAGS := $(CFLAGS) -fstack-protector-all
+ endif
+ 
+@@ -430,12 +436,12 @@ ifeq ($(uname_S),Darwin)
+ 	PTHREAD_LIBS =
+ endif
+ 
+-ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
++ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+ 	msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
+ endif
+ 
+-ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+-	ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
++ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
++	ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+ 		BASIC_CFLAGS += -DLIBELF_NO_MMAP
+ 	endif
+ else
+@@ -445,20 +451,20 @@ endif
+ ifdef NO_DEMANGLE
+ 	BASIC_CFLAGS += -DNO_DEMANGLE
+ else
+-	has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")
++	has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd "$(QUIET_STDERR)" && echo y")
+ 
+ 	ifeq ($(has_bfd),y)
+ 		EXTLIBS += -lbfd
+ 	else
+-		has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")
++		has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty "$(QUIET_STDERR)" && echo y")
+ 		ifeq ($(has_bfd_iberty),y)
+ 			EXTLIBS += -lbfd -liberty
+ 		else
+-			has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")
++			has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz "$(QUIET_STDERR)" && echo y")
+ 			ifeq ($(has_bfd_iberty_z),y)
+ 				EXTLIBS += -lbfd -liberty -lz
+ 			else
+-				has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")
++				has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o $(BITBUCKET) $(ALL_LDFLAGS) $(EXTLIBS) -liberty "$(QUIET_STDERR)" && echo y")
+ 				ifeq ($(has_cplus_demangle),y)
+ 					EXTLIBS += -liberty
+ 					BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
+@@ -706,7 +712,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
+ 
+ SHELL = $(SHELL_PATH)
+ 
+-all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) PERF-BUILD-OPTIONS
++all:: .perf.dev.null shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) PERF-BUILD-OPTIONS
+ ifneq (,$X)
+ 	$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) perf$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
+ endif
+@@ -1009,6 +1015,11 @@ clean:
+ .PHONY: .FORCE-PERF-VERSION-FILE TAGS tags cscope .FORCE-PERF-CFLAGS
+ .PHONY: .FORCE-PERF-BUILD-OPTIONS
+ 
++.perf.dev.null:
++		touch .perf.dev.null
++
++.INTERMEDIATE:	.perf.dev.null
++
+ ### Make sure built-ins do not have dups and listed in perf.c
+ #
+ check-builtins::
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Display-better-error-messages-on-missing-.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Display-better-error-messages-on-missing-.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,49 @@
+From 537ad0a110fdf5515187852c72b89434394e4822 Mon Sep 17 00:00:00 2001
+From: Randy Dunlap <randy.dunlap at oracle.com>
+Date: Sun, 18 Oct 2009 19:20:24 -0700
+Subject: [PATCH 1/9] perf tools: Display better error messages on missing packages
+
+commit 1abc7f5500fff8422f34826a006648d8741d83d3 upstream.
+
+Check for libelf headers and glibc headers separately so that
+the error message correctly identifies which package
+installation is missing/needed.
+
+Signed-off-by: Randy Dunlap <randy.dunlap at oracle.com>
+Cc: paulus at samba.org
+Cc: a.p.zijlstra at chello.nl
+Cc: efault at gmx.de
+Cc: fweisbec at gmail.com
+Cc: Arnaldo Carvalho de Melo <acme at redhat.com>
+LKML-Reference: <4ADBCCE8.3060300 at oracle.com>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |    6 +++++-
+ 1 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 719d028..3a018b5 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -423,12 +423,16 @@ ifeq ($(uname_S),Darwin)
+ 	PTHREAD_LIBS =
+ endif
+ 
++ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
++	msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
++endif
++
+ ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
+ 	ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
+ 		BASIC_CFLAGS += -DLIBELF_NO_MMAP
+ 	endif
+ else
+-	msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel and glibc-dev[el]);
++	msg := $(error No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel);
+ endif
+ 
+ ifdef NO_DEMANGLE
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Move-QUIET_STDERR-def-to-before-first-use.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Move-QUIET_STDERR-def-to-before-first-use.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,60 @@
+From 309625098647d745f089c515f3351d3e05b0f441 Mon Sep 17 00:00:00 2001
+From: Arnaldo Carvalho de Melo <acme at redhat.com>
+Date: Tue, 12 Jan 2010 08:58:29 -0200
+Subject: [PATCH 8/9] perf tools: Move QUIET_STDERR def to before first use
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit 830395188fae5f4028fa3c38ab1b031aae18a64c upstream.
+
+QUIET_STDERR is used when detecting if -fstack-protector-all can
+be used.
+
+Noticed while building the perf tools on a Debian PARISC64
+machine.
+
+Signed-off-by: Arnaldo Carvalho de Melo <acme at redhat.com>
+Cc: Frédéric Weisbecker <fweisbec at gmail.com>
+Cc: Mike Galbraith <efault at gmx.de>
+Cc: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Paul Mackerras <paulus at samba.org>
+LKML-Reference: <1263293910-8484-1-git-send-email-acme at infradead.org>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |   11 ++++++-----
+ 1 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 1b2f98f..848b4c6 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -252,6 +252,12 @@ PTHREAD_LIBS = -lpthread
+ # explicitly what architecture to check for. Fix this up for yours..
+ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
+ 
++ifeq ($(V), 2)
++	QUIET_STDERR = ">/dev/null"
++else
++	QUIET_STDERR = ">/dev/null 2>&1"
++endif
++
+ ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null "$(QUIET_STDERR)" && echo y"), y)
+   CFLAGS := $(CFLAGS) -fstack-protector-all
+ endif
+@@ -397,11 +403,6 @@ BUILTIN_OBJS += builtin-trace.o
+ 
+ PERFLIBS = $(LIB_FILE)
+ 
+-ifeq ($(V), 2)
+-	QUIET_STDERR = ">/dev/null"
+-else
+-	QUIET_STDERR = ">/dev/null 2>&1"
+-endif
+ #
+ # Platform specific tweaks
+ #
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Suggest-static-libraries-as-well.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Suggest-static-libraries-as-well.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,47 @@
+From 42500e810a577c3e2ca0ae8fb745b7d76b06477f Mon Sep 17 00:00:00 2001
+From: Michael S. Tsirkin <mst at redhat.com>
+Date: Sun, 22 Nov 2009 15:13:11 +0200
+Subject: [PATCH 6/9] perf tools: Suggest static libraries as well
+
+commit b197c7ef7169bd5f11fb9d803b322d0daef7e256 upstream.
+
+On error, suggest installing static libraries
+along with shared libraries.
+
+Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
+Cc: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Paul Mackerras <paulus at samba.org>
+Cc: Frederic Weisbecker <fweisbec at gmail.com>
+Cc: Arnaldo Carvalho de Melo <acme at redhat.com>
+LKML-Reference: <20091122131311.GA24318 at redhat.com>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 8729ee3..0a14f98 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -442,7 +442,7 @@ ifeq ($(uname_S),Darwin)
+ endif
+ 
+ ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+-	msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
++	msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
+ endif
+ 
+ ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) "$(QUIET_STDERR)" && echo y"), y)
+@@ -474,7 +474,7 @@ else
+ 					EXTLIBS += -liberty
+ 					BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
+ 				else
+-					msg := $(warning No bfd.h/libbfd found, install binutils-dev[el] to gain symbol demangling)
++					msg := $(warning No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demangling)
+ 					BASIC_CFLAGS += -DNO_DEMANGLE
+ 				endif
+ 			endif
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Support-static-build.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Support-static-build.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,95 @@
+From f10a5eb3fc97b4d38d783b9f8f7d6d3bdc07a06a Mon Sep 17 00:00:00 2001
+From: Michael S. Tsirkin <mst at redhat.com>
+Date: Thu, 29 Oct 2009 17:20:02 +0200
+Subject: [PATCH 4/9] perf tools: Support static build
+
+commit 751386507701010831d72c522171753d2cd903d2 upstream.
+
+This makes it possible to build perf statically, by
+performing:
+
+  make LDFLAGS=-static
+
+Since static libraries are only searched in the order they are
+specified, move library list from LDFLAGS to EXTLIBS, so that
+they are put at the end of linker command line.
+
+Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
+Cc: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Paul Mackerras <paulus at samba.org>
+Cc: Frederic Weisbecker <fweisbec at gmail.com>
+Cc: Arnaldo Carvalho de Melo <acme at redhat.com>
+LKML-Reference: <20091029152002.GA5406 at redhat.com>
+[ v2: resolved conflicts ]
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |   18 ++++++++++--------
+ 1 files changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 8bad01d..7313b25 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -145,6 +145,8 @@ all::
+ # Define NO_EXTERNAL_GREP if you don't want "perf grep" to ever call
+ # your external grep (e.g., if your system lacks grep, if its grep is
+ # broken, or spawning external process is slower than built-in grep perf has).
++#
++# Define LDFLAGS=-static to build a static binary.
+ 
+ PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
+ 	@$(SHELL_PATH) util/PERF-VERSION-GEN
+@@ -208,7 +210,7 @@ ifndef PERF_DEBUG
+ endif
+ 
+ CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
+-LDFLAGS = -lpthread -lrt -lelf -lm
++EXTLIBS = -lpthread -lrt -lelf -lm
+ ALL_CFLAGS = $(CFLAGS)
+ ALL_LDFLAGS = $(LDFLAGS)
+ STRIP ?= strip
+@@ -433,12 +435,12 @@ ifeq ($(uname_S),Darwin)
+ 	PTHREAD_LIBS =
+ endif
+ 
+-ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
++ifneq ($(shell sh -c "(echo '\#include <gnu/libc-version.h>'; echo 'int main(void) { const char * version = gnu_get_libc_version(); return (long)version; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
+ 	msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
+ endif
+ 
+-ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
+-	ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y"), y)
++ifeq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
++	ifneq ($(shell sh -c "(echo '\#include <libelf.h>'; echo 'int main(void) { Elf * elf = elf_begin(0, ELF_C_READ_MMAP, 0); return (long)elf; }') | $(CC) -x c - $(ALL_CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) > /dev/null 2>&1 && echo y"), y)
+ 		BASIC_CFLAGS += -DLIBELF_NO_MMAP
+ 	endif
+ else
+@@ -448,20 +450,20 @@ endif
+ ifdef NO_DEMANGLE
+ 	BASIC_CFLAGS += -DNO_DEMANGLE
+ else
+-	has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd > /dev/null 2>&1 && echo y")
++	has_bfd := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd > /dev/null 2>&1 && echo y")
+ 
+ 	ifeq ($(has_bfd),y)
+ 		EXTLIBS += -lbfd
+ 	else
+-		has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty > /dev/null 2>&1 && echo y")
++		has_bfd_iberty := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty > /dev/null 2>&1 && echo y")
+ 		ifeq ($(has_bfd_iberty),y)
+ 			EXTLIBS += -lbfd -liberty
+ 		else
+-			has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
++			has_bfd_iberty_z := $(shell sh -c "(echo '\#include <bfd.h>'; echo 'int main(void) { bfd_demangle(0, 0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -liberty -lz > /dev/null 2>&1 && echo y")
+ 			ifeq ($(has_bfd_iberty_z),y)
+ 				EXTLIBS += -lbfd -liberty -lz
+ 			else
+-				has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) -liberty > /dev/null 2>&1 && echo y")
++				has_cplus_demangle := $(shell sh -c "(echo 'extern char *cplus_demangle(const char *, int);'; echo 'int main(void) { cplus_demangle(0, 0); return 0; }') | $(CC) -x c - $(ALL_CFLAGS) -o /dev/null $(ALL_LDFLAGS) $(EXTLIBS) -liberty > /dev/null 2>&1 && echo y")
+ 				ifeq ($(has_cplus_demangle),y)
+ 					EXTLIBS += -liberty
+ 					BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
+-- 
+1.7.1
+

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Test-fstack-protector-all-compiler-option.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/perf-tools-Test-fstack-protector-all-compiler-option.patch	Fri Jul  9 04:20:35 2010	(r15969)
@@ -0,0 +1,52 @@
+From 9beac149731cdee8b105eacebed4697427b98310 Mon Sep 17 00:00:00 2001
+From: Michael Cree <mcree at orcon.net.nz>
+Date: Wed, 11 Nov 2009 20:43:03 +1300
+Subject: [PATCH 3/9] perf tools: Test -fstack-protector-all compiler option for inclusion in CFLAGS
+
+commit 5d7bdab75cd56d2bdc0986ae5546be3b09fea70a upstream.
+
+Some architectures (e.g. Alpha) do not support the
+-fstack-protector-all compiler option and the use of the option
+with -Werror causes the compiler to abort and the build fails.
+
+Test that the compiler supports -fstack-protector-all before
+inclusion in CFLAGS.
+
+Signed-off-by: Michael Cree <mcree at orcon.net.nz>
+Cc: Richard Henderson <rth at twiddle.net>
+Cc: Ivan Kokshaysky <ink at jurassic.park.msu.ru>
+Cc: Peter Zijlstra <a.p.zijlstra at chello.nl>
+Cc: Paul Mackerras <paulus at samba.org>
+LKML-Reference: <20091111074302.GA3728 at omega>
+Signed-off-by: Ingo Molnar <mingo at elte.hu>
+[bwh: Backport to 2.6.32]
+---
+ tools/perf/Makefile |    5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/tools/perf/Makefile b/tools/perf/Makefile
+index 2528a60..8bad01d 100644
+--- a/tools/perf/Makefile
++++ b/tools/perf/Makefile
+@@ -207,7 +207,7 @@ ifndef PERF_DEBUG
+   CFLAGS_OPTIMIZE = -O6
+ endif
+ 
+-CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -fstack-protector-all -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
++CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
+ LDFLAGS = -lpthread -lrt -lelf -lm
+ ALL_CFLAGS = $(CFLAGS)
+ ALL_LDFLAGS = $(LDFLAGS)
+@@ -261,6 +261,9 @@ PTHREAD_LIBS = -lpthread
+ # explicitly what architecture to check for. Fix this up for yours..
+ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
+ 
++ifeq ($(shell sh -c "echo 'int foo(void) {char X[2]; return 3;}' | $(CC) -x c -c -Werror -fstack-protector-all - -o /dev/null >/dev/null 2>&1 && echo y"), y)
++  CFLAGS := $(CFLAGS) -fstack-protector-all
++endif
+ 
+ 
+ ### --- END CONFIGURATION SECTION ---
+-- 
+1.7.1
+

Modified: dists/sid/linux-2.6/debian/patches/series/17
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/17	Thu Jul  8 11:34:02 2010	(r15968)
+++ dists/sid/linux-2.6/debian/patches/series/17	Fri Jul  9 04:20:35 2010	(r15969)
@@ -1,4 +1,10 @@
 + bugfix/all/agp-add-no-warn-since-we-have-a-fallback-to-vmalloc-.patch
-+ bugfix/all/perf-Use-sane-default-CFLAGS.patch
-+ bugfix/all/perf-Dont-hide-errors-from-libelf-test.patch
-+ bugfix/all/perf-Dont-use-dev-null-as-output-for-libelf-test.patch
++ bugfix/all/perf-tools-Display-better-error-messages-on-missing-.patch
++ bugfix/all/perf-tools-Add-make-DEBUG-1-to-remove-the-O6-cflag.patch
++ bugfix/all/perf-tools-Test-fstack-protector-all-compiler-option.patch
++ bugfix/all/perf-tools-Support-static-build.patch
++ bugfix/all/perf-tools-Add-V-2-option-to-help-debug-config-issue.patch
++ bugfix/all/perf-tools-Suggest-static-libraries-as-well.patch
++ bugfix/all/perf-Use-default-compiler-mode-by-default.patch
++ bugfix/all/perf-tools-Move-QUIET_STDERR-def-to-before-first-use.patch
++ bugfix/all/perf-tools-Check-if-dev-null-can-be-used-as-the-o-gc.patch

Modified: dists/sid/linux-2.6/debian/rules.real
==============================================================================
--- dists/sid/linux-2.6/debian/rules.real	Thu Jul  8 11:34:02 2010	(r15968)
+++ dists/sid/linux-2.6/debian/rules.real	Fri Jul  9 04:20:35 2010	(r15969)
@@ -32,7 +32,7 @@
 MAKE_CLEAN = $(setup_env) $(MAKE)
 MAKE_SELF := $(MAKE) -f debian/rules.real $(MAKEOVERRIDES)
 MAKEOVERRIDES =
-MAKE_PERF_VARS = prefix=/usr NO_PERL=1
+MAKE_PERF_VARS = prefix=/usr NO_PERL=1 V=2
 
 #
 # Targets



More information about the Kernel-svn-changes mailing list