aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2010-02-01 22:54:12 +0000
committerBen Hutchings <benh@debian.org>2010-02-01 22:54:12 +0000
commit7e0532181f811ffed58083b1e3e5cb56db13d80a (patch)
treeffacbbb736547a8e06f0292799a59bc1d77ce517
parent1edf84b96ba4470218d33d82c4c5cd3289879261 (diff)
downloadkernel_replicant_linux-7e0532181f811ffed58083b1e3e5cb56db13d80a.tar.gz
kernel_replicant_linux-7e0532181f811ffed58083b1e3e5cb56db13d80a.tar.bz2
kernel_replicant_linux-7e0532181f811ffed58083b1e3e5cb56db13d80a.zip
[sparc] ftrace: Fix build-time architecture detection (Closes: #568025)
svn path=/dists/trunk/linux-2.6/; revision=15093
-rw-r--r--debian/changelog4
-rw-r--r--debian/patches/bugfix/all/ftrace-Use-UTS_MACHINE-not-ARCH-and-word-size-in-recordmcount.patch154
-rw-r--r--debian/patches/series/71
3 files changed, 159 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index ebe63b1bb3c1..187b10f30096 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,11 @@
linux-2.6 (2.6.32-7) UNRELEASED; urgency=low
+ [ maximilian attems]
* [x86] Disable deprecated X86_CPU_DEBUG, causes boot failures.
+ [ Ben Hutchings ]
+ * [sparc] ftrace: Fix build-time architecture detection (Closes: #568025)
+
-- maximilian attems <maks@debian.org> Mon, 01 Feb 2010 17:16:31 +0100
linux-2.6 (2.6.32-6) unstable; urgency=high
diff --git a/debian/patches/bugfix/all/ftrace-Use-UTS_MACHINE-not-ARCH-and-word-size-in-recordmcount.patch b/debian/patches/bugfix/all/ftrace-Use-UTS_MACHINE-not-ARCH-and-word-size-in-recordmcount.patch
new file mode 100644
index 000000000000..f6cbb8863a0d
--- /dev/null
+++ b/debian/patches/bugfix/all/ftrace-Use-UTS_MACHINE-not-ARCH-and-word-size-in-recordmcount.patch
@@ -0,0 +1,154 @@
+From 6cb4452dcd9108720e0aae978b98a30a8b7ebf69 Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Mon, 1 Feb 2010 22:12:56 +0000
+Subject: [PATCH] ftrace: Use UTS_MACHINE, not ARCH and word size, in recordmcount.pl
+
+$(ARCH) is user input and does not reliably correspond to either a
+source architecture or a utsname machine name. recordmcount.pl is not
+even consistent in which names it uses internally at the moment.
+Replace $(ARCH) and word size arguments with $(UTS_MACHINE), which
+should be a stable identifier for the target architecture.
+---
+ scripts/Makefile.build | 4 ++--
+ scripts/recordmcount.pl | 34 +++++++++++++---------------------
+ 2 files changed, 15 insertions(+), 23 deletions(-)
+
+diff --git a/scripts/Makefile.build b/scripts/Makefile.build
+index 341b589..49e4b4f 100644
+--- a/scripts/Makefile.build
++++ b/scripts/Makefile.build
+@@ -206,8 +206,8 @@ cmd_modversions = \
+ endif
+
+ ifdef CONFIG_FTRACE_MCOUNT_RECORD
+-cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \
+- "$(if $(CONFIG_64BIT),64,32)" \
++cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl \
++ "$(UTS_MACHINE)" \
+ "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \
+ "$(if $(part-of-module),1,0)" "$(@)";
+ endif
+diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
+index 090d300..7d53e2a 100755
+--- a/scripts/recordmcount.pl
++++ b/scripts/recordmcount.pl
+@@ -105,7 +105,7 @@ if ($#ARGV < 7) {
+ exit(1);
+ }
+
+-my ($arch, $bits, $objdump, $objcopy, $cc,
++my ($machine, $objdump, $objcopy, $cc,
+ $ld, $nm, $rm, $mv, $is_module, $inputfile) = @ARGV;
+
+ # This file refers to mcount and shouldn't be ftraced, so lets' ignore it
+@@ -129,7 +129,7 @@ $nm = "nm" if ((length $nm) == 0);
+ $rm = "rm" if ((length $rm) == 0);
+ $mv = "mv" if ((length $mv) == 0);
+
+-#print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " .
++#print STDERR "running: $P '$machine' '$objdump' '$objcopy' '$cc' '$ld' " .
+ # "'$nm' '$rm' '$mv' '$inputfile'\n";
+
+ my %locals; # List of local (static) functions
+@@ -145,14 +145,6 @@ my $mcount_regex; # Find the call site to mcount (return offset)
+ my $alignment; # The .align value to use for $mcount_section
+ my $section_type; # Section header plus possible alignment command
+
+-if ($arch eq "x86") {
+- if ($bits == 64) {
+- $arch = "x86_64";
+- } else {
+- $arch = "i386";
+- }
+-}
+-
+ #
+ # We base the defaults off of i386, the other archs may
+ # feel free to change them in the below if statements.
+@@ -164,7 +156,7 @@ $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$";
+ $section_type = '@progbits';
+ $type = ".long";
+
+-if ($arch eq "x86_64") {
++if ($machine eq "x86_64") {
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$";
+ $type = ".quad";
+ $alignment = 8;
+@@ -175,7 +167,7 @@ if ($arch eq "x86_64") {
+ $objcopy .= " -O elf64-x86-64";
+ $cc .= " -m64";
+
+-} elsif ($arch eq "i386") {
++} elsif ($machine eq "i386") {
+ $alignment = 4;
+
+ # force flags for this arch
+@@ -184,20 +176,20 @@ if ($arch eq "x86_64") {
+ $objcopy .= " -O elf32-i386";
+ $cc .= " -m32";
+
+-} elsif ($arch eq "s390" && $bits == 32) {
++} elsif ($machine eq "s390") {
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$";
+ $alignment = 4;
+ $ld .= " -m elf_s390";
+ $cc .= " -m31";
+
+-} elsif ($arch eq "s390" && $bits == 64) {
++} elsif ($machine eq "s390x") {
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
+ $alignment = 8;
+ $type = ".quad";
+ $ld .= " -m elf64_s390";
+ $cc .= " -m64";
+
+-} elsif ($arch eq "sh") {
++} elsif ($machine eq "sh") {
+ $alignment = 2;
+
+ # force flags for this arch
+@@ -205,27 +197,27 @@ if ($arch eq "x86_64") {
+ $objcopy .= " -O elf32-sh-linux";
+ $cc .= " -m32";
+
+-} elsif ($arch eq "powerpc") {
++} elsif ($machine eq "ppc" || $machine eq "ppc64") {
+ $nm_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
+ $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?.*?)>:";
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
+
+- if ($bits == 64) {
++ if ($machine eq "ppc64") {
+ $type = ".quad";
+ }
+
+-} elsif ($arch eq "arm") {
++} elsif ($machine eq "arm") {
+ $alignment = 2;
+ $section_type = '%progbits';
+
+-} elsif ($arch eq "ia64") {
++} elsif ($machine eq "ia64") {
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
+ $type = "data8";
+
+ if ($is_module eq "0") {
+ $cc .= " -mconstant-gp";
+ }
+-} elsif ($arch eq "sparc64") {
++} elsif ($machine eq "sparc64") {
+ # In the objdump output there are giblets like:
+ # 0000000000000000 <igmp_net_exit-0x18>:
+ # As there's some data blobs that get emitted into the
+@@ -246,7 +238,7 @@ if ($arch eq "x86_64") {
+ $cc .= " -m64";
+ $objcopy .= " -O elf64-sparc";
+ } else {
+- die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
++ die "Arch $machine is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
+ }
+
+ my $text_found = 0;
+--
+1.6.6
+
diff --git a/debian/patches/series/7 b/debian/patches/series/7
new file mode 100644
index 000000000000..31b92795cdde
--- /dev/null
+++ b/debian/patches/series/7
@@ -0,0 +1 @@
++ bugfix/all/ftrace-Use-UTS_MACHINE-not-ARCH-and-word-size-in-recordmcount.patch