linux-tools: Restrict architectures and fix build for hppa

perf: Use sane default CFLAGS
perf: Don't hide compiler/linker errors from libelf test
perf: Don't use /dev/null as the output file for libelf test
Don't attempt to build for architectures where perf events are not available.

svn path=/dists/sid/linux-2.6/; revision=15967
This commit is contained in:
Ben Hutchings 2010-07-08 03:30:36 +00:00
parent 419f528cda
commit a0f4087607
7 changed files with 98 additions and 3 deletions

5
debian/changelog vendored
View File

@ -1,7 +1,12 @@
linux-2.6 (2.6.32-17) UNRELEASED; urgency=low
[ maximilian attems ]
* agp: add no warn since we have a fallback to vmalloc paths.
[ Ben Hutchings ]
* linux-tools: Fix build for hppa and do not attempt to build for
architectures where perf events are not available
-- maximilian attems <maks@debian.org> Wed, 07 Jul 2010 12:33:04 +0200
linux-2.6 (2.6.32-16) unstable; urgency=low

View File

@ -0,0 +1,27 @@
From 952765d9ac09d6c60e222a74f05470b3735191cc Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 8 Jul 2010 01:43:36 +0100
Subject: [PATCH 2/3] perf: Don't hide compiler/linker errors from libelf test
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
tools/perf/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 1fb9d5c..33b02a5 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -423,7 +423,7 @@ ifeq ($(uname_S),Darwin)
PTHREAD_LIBS =
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)
+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 && 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
--
1.7.1

View File

@ -0,0 +1,31 @@
From 8d07027f1d40d85aeb4a410f23819ebb0c216ab3 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 8 Jul 2010 02:51:43 +0100
Subject: [PATCH 3/3] perf: Don't use /dev/null as the output file for libelf test
On some architectures ld makes a second pass over the output file and
this won't work.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
tools/perf/Makefile | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 33b02a5..30fe5e3 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -423,8 +423,8 @@ ifeq ($(uname_S),Darwin)
PTHREAD_LIBS =
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 && 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 dummy $(ALL_LDFLAGS) > /dev/null && echo y; rm -f dummy"), 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 dummy $(ALL_LDFLAGS) > /dev/null 2>&1 && echo y; rm -f dummy"), y)
BASIC_CFLAGS += -DLIBELF_NO_MMAP
endif
else
--
1.7.1

View File

@ -0,0 +1,27 @@
From 57a8c6e3959d0bda7194be3e7a0f743abc4e2c32 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben@decadent.org.uk>
Date: Thu, 8 Jul 2010 01:41:25 +0100
Subject: [PATCH 1/3] perf: Use sane default CFLAGS
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
tools/perf/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 719d028..1fb9d5c 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -200,7 +200,7 @@ 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)
+CFLAGS = -ggdb3 -Wall -Wextra -std=gnu99 -O2 -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS)
LDFLAGS = -lpthread -lrt -lelf -lm
ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
--
1.7.1

View File

@ -1 +1,4 @@
+ 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

6
debian/rules.real vendored
View File

@ -32,14 +32,16 @@ setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTION_UPLOADER=$(UPLOADER) DIS
MAKE_CLEAN = $(setup_env) $(MAKE)
MAKE_SELF := $(MAKE) -f debian/rules.real $(MAKEOVERRIDES)
MAKEOVERRIDES =
MAKE_PERF_VARS = prefix=/usr NO_PERL=1 MBITS=
MAKE_PERF_VARS = prefix=/usr NO_PERL=1
#
# Targets
#
binary-arch-arch: install-headers_$(ARCH)
binary-arch-arch: install-libc-dev_$(ARCH)
binary-arch-arch: install-tools_$(ARCH)
ifneq ($(filter amd64 hppa i386 powerpc s390 sh4 sparc sparc64,$(ARCH)),)
binary-arch-arch: install-tools_$(ARCH)
endif
binary-arch-featureset: install-headers_$(ARCH)_$(FEATURESET)
binary-arch-flavour: install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
ifeq ($(DEBUG),True)

View File

@ -1,5 +1,5 @@
Package: linux-tools-@version@
Architecture: any
Architecture: amd64, hppa, i386, powerpc, s390, sh4, sparc, sparc64
Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: linux-base (>= 2.6.32-16)
Suggests: linux-doc-@version@