~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/bugfix/all/perf-tools-Support-static-build.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From f10a5eb3fc97b4d38d783b9f8f7d6d3bdc07a06a Mon Sep 17 00:00:00 2001
2
 
From: Michael S. Tsirkin <mst@redhat.com>
3
 
Date: Thu, 29 Oct 2009 17:20:02 +0200
4
 
Subject: [PATCH 4/9] perf tools: Support static build
5
 
 
6
 
commit 751386507701010831d72c522171753d2cd903d2 upstream.
7
 
 
8
 
This makes it possible to build perf statically, by
9
 
performing:
10
 
 
11
 
  make LDFLAGS=-static
12
 
 
13
 
Since static libraries are only searched in the order they are
14
 
specified, move library list from LDFLAGS to EXTLIBS, so that
15
 
they are put at the end of linker command line.
16
 
 
17
 
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
18
 
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
19
 
Cc: Paul Mackerras <paulus@samba.org>
20
 
Cc: Frederic Weisbecker <fweisbec@gmail.com>
21
 
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
22
 
LKML-Reference: <20091029152002.GA5406@redhat.com>
23
 
[ v2: resolved conflicts ]
24
 
Signed-off-by: Ingo Molnar <mingo@elte.hu>
25
 
[bwh: Backport to 2.6.32]
26
 
---
27
 
 tools/perf/Makefile |   18 ++++++++++--------
28
 
 1 files changed, 10 insertions(+), 8 deletions(-)
29
 
 
30
 
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
31
 
index 8bad01d..7313b25 100644
32
 
--- a/tools/perf/Makefile
33
 
+++ b/tools/perf/Makefile
34
 
@@ -145,6 +145,8 @@ all::
35
 
 # Define NO_EXTERNAL_GREP if you don't want "perf grep" to ever call
36
 
 # your external grep (e.g., if your system lacks grep, if its grep is
37
 
 # broken, or spawning external process is slower than built-in grep perf has).
38
 
+#
39
 
+# Define LDFLAGS=-static to build a static binary.
40
 
 
41
 
 PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
42
 
        @$(SHELL_PATH) util/PERF-VERSION-GEN
43
 
@@ -208,7 +210,7 @@ ifndef PERF_DEBUG
44
 
 endif
45
 
 
46
 
 CFLAGS = $(MBITS) -ggdb3 -Wall -Wextra -std=gnu99 -Werror $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
47
 
-LDFLAGS = -lpthread -lrt -lelf -lm
48
 
+EXTLIBS = -lpthread -lrt -lelf -lm
49
 
 ALL_CFLAGS = $(CFLAGS)
50
 
 ALL_LDFLAGS = $(LDFLAGS)
51
 
 STRIP ?= strip
52
 
@@ -433,12 +435,12 @@ ifeq ($(uname_S),Darwin)
53
 
        PTHREAD_LIBS =
54
 
 endif
55
 
 
56
 
-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)
57
 
+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)
58
 
        msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
59
 
 endif
60
 
 
61
 
-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)
62
 
-       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)
63
 
+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)
64
 
+       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)
65
 
                BASIC_CFLAGS += -DLIBELF_NO_MMAP
66
 
        endif
67
 
 else
68
 
@@ -448,20 +450,20 @@ endif
69
 
 ifdef NO_DEMANGLE
70
 
        BASIC_CFLAGS += -DNO_DEMANGLE
71
 
 else
72
 
-       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")
73
 
+       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")
74
 
 
75
 
        ifeq ($(has_bfd),y)
76
 
                EXTLIBS += -lbfd
77
 
        else
78
 
-               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")
79
 
+               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")
80
 
                ifeq ($(has_bfd_iberty),y)
81
 
                        EXTLIBS += -lbfd -liberty
82
 
                else
83
 
-                       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")
84
 
+                       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")
85
 
                        ifeq ($(has_bfd_iberty_z),y)
86
 
                                EXTLIBS += -lbfd -liberty -lz
87
 
                        else
88
 
-                               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")
89
 
+                               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")
90
 
                                ifeq ($(has_cplus_demangle),y)
91
 
                                        EXTLIBS += -liberty
92
 
                                        BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
93
 
1.7.1
94