public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts - use $OBJDUMP to get correct objdump (cross compile)
@ 2005-09-19 21:06 Ben Dooks
  2005-09-20  8:28 ` Keith Owens
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Dooks @ 2005-09-19 21:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: patch-out

[-- Attachment #1: Type: text/plain, Size: 2347 bytes --]

The scripts for `make buildcheck` are executing
objdump straight, which is wrong if the system
is using `make CROSS_COMPILE=....`. 

Change the scripts to use $OBJDUMP passed from
the Makefile's environment, so that the correct
objdump is used, and the symbols are printed
correctly

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

diff -urN -X ../dontdiff linux-2.6.13-simtec1/scripts/reference_discarded.pl linux-2.6.13-simtec2/scripts/reference_discarded.pl
--- linux-2.6.13-simtec1/scripts/reference_discarded.pl	2005-09-06 12:28:18.000000000 +0100
+++ linux-2.6.13-simtec2/scripts/reference_discarded.pl	2005-09-19 22:02:07.000000000 +0100
@@ -18,7 +18,7 @@
 $| = 1;
 
 # printf("Finding objects, ");
-open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
+open(OBJDUMP_LIST, "find . -name '*.o' | xargs \$OBJDUMP -h |") || die "getting objdump list failed";
 while (defined($line = <OBJDUMP_LIST>)) {
 	chomp($line);
 	if ($line =~ /:\s+file format/) {
@@ -74,7 +74,7 @@
 $errorcount = 0;
 foreach $object (keys(%object)) {
 	my $from;
-	open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
+	open(OBJDUMP, "\$OBJDUMP -r $object|") || die "cannot objdump -r $object";
 	while (defined($line = <OBJDUMP>)) {
 		chomp($line);
 		if ($line =~ /RELOCATION RECORDS FOR /) {
diff -urN -X ../dontdiff linux-2.6.13-simtec1/scripts/reference_init.pl linux-2.6.13-simtec2/scripts/reference_init.pl
--- linux-2.6.13-simtec1/scripts/reference_init.pl	2005-09-06 12:28:18.000000000 +0100
+++ linux-2.6.13-simtec2/scripts/reference_init.pl	2005-09-19 22:00:52.000000000 +0100
@@ -26,7 +26,7 @@
 $| = 1;
 
 printf("Finding objects, ");
-open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
+open(OBJDUMP_LIST, "find . -name '*.o' | xargs \$OBJDUMP -h |") || die "getting objdump list failed";
 while (defined($line = <OBJDUMP_LIST>)) {
 	chomp($line);
 	if ($line =~ /:\s+file format/) {
@@ -81,7 +81,7 @@
 printf("Scanning objects\n");
 foreach $object (sort(keys(%object))) {
 	my $from;
-	open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
+	open(OBJDUMP, "\$OBJDUMP -r $object|") || die "cannot objdump -r $object";
 	while (defined($line = <OBJDUMP>)) {
 		chomp($line);
 		if ($line =~ /RELOCATION RECORDS FOR /) {

[-- Attachment #2: scripts-buildcheck-pass-objdump.patch --]
[-- Type: text/plain, Size: 2015 bytes --]

diff -urN -X ../dontdiff linux-2.6.13-simtec1/scripts/reference_discarded.pl linux-2.6.13-simtec2/scripts/reference_discarded.pl
--- linux-2.6.13-simtec1/scripts/reference_discarded.pl	2005-09-06 12:28:18.000000000 +0100
+++ linux-2.6.13-simtec2/scripts/reference_discarded.pl	2005-09-19 22:02:07.000000000 +0100
@@ -18,7 +18,7 @@
 $| = 1;
 
 # printf("Finding objects, ");
-open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
+open(OBJDUMP_LIST, "find . -name '*.o' | xargs \$OBJDUMP -h |") || die "getting objdump list failed";
 while (defined($line = <OBJDUMP_LIST>)) {
 	chomp($line);
 	if ($line =~ /:\s+file format/) {
@@ -74,7 +74,7 @@
 $errorcount = 0;
 foreach $object (keys(%object)) {
 	my $from;
-	open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
+	open(OBJDUMP, "\$OBJDUMP -r $object|") || die "cannot objdump -r $object";
 	while (defined($line = <OBJDUMP>)) {
 		chomp($line);
 		if ($line =~ /RELOCATION RECORDS FOR /) {
diff -urN -X ../dontdiff linux-2.6.13-simtec1/scripts/reference_init.pl linux-2.6.13-simtec2/scripts/reference_init.pl
--- linux-2.6.13-simtec1/scripts/reference_init.pl	2005-09-06 12:28:18.000000000 +0100
+++ linux-2.6.13-simtec2/scripts/reference_init.pl	2005-09-19 22:00:52.000000000 +0100
@@ -26,7 +26,7 @@
 $| = 1;
 
 printf("Finding objects, ");
-open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
+open(OBJDUMP_LIST, "find . -name '*.o' | xargs \$OBJDUMP -h |") || die "getting objdump list failed";
 while (defined($line = <OBJDUMP_LIST>)) {
 	chomp($line);
 	if ($line =~ /:\s+file format/) {
@@ -81,7 +81,7 @@
 printf("Scanning objects\n");
 foreach $object (sort(keys(%object))) {
 	my $from;
-	open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
+	open(OBJDUMP, "\$OBJDUMP -r $object|") || die "cannot objdump -r $object";
 	while (defined($line = <OBJDUMP>)) {
 		chomp($line);
 		if ($line =~ /RELOCATION RECORDS FOR /) {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scripts - use $OBJDUMP to get correct objdump (cross compile)
  2005-09-19 21:06 [PATCH] scripts - use $OBJDUMP to get correct objdump (cross compile) Ben Dooks
@ 2005-09-20  8:28 ` Keith Owens
  2005-09-20 14:39   ` Ben Dooks
  0 siblings, 1 reply; 6+ messages in thread
From: Keith Owens @ 2005-09-20  8:28 UTC (permalink / raw)
  To: Ben Dooks; +Cc: linux-kernel, patch-out

On Mon, 19 Sep 2005 22:06:45 +0100, 
Ben Dooks <ben-linux@fluff.org> wrote:
>The scripts for `make buildcheck` are executing
>objdump straight, which is wrong if the system
>is using `make CROSS_COMPILE=....`. 
>
>Change the scripts to use $OBJDUMP passed from
>the Makefile's environment, so that the correct
>objdump is used, and the symbols are printed
>correctly

Those scripts are meant to work even when they are invoked by hand,
without OBJDUMP being defined in the environment.  This is the correct
fix.

Signed-off-by: Keith Owens <kaos@ocs.com.au>

Index: linux/scripts/namespace.pl
===================================================================
--- linux.orig/scripts/namespace.pl	2005-08-29 09:41:01.000000000 +1000
+++ linux/scripts/namespace.pl	2005-09-20 18:25:12.124090186 +1000
@@ -67,11 +67,17 @@ use strict;
 use File::Find;
 
 my $nm = "/usr/bin/nm -p";
-my $objdump = "/usr/bin/objdump -s -j .comment";
 my $srctree = "";
 my $objtree = "";
 $srctree = "$ENV{'srctree'}/" if (exists($ENV{'srctree'}));
 $objtree = "$ENV{'objtree'}/" if (exists($ENV{'objtree'}));
+my $objdump;
+if (exists($ENV{'OBJDUMP'})) {
+	$objdump = $ENV{'OBJDUMP'};
+} else {
+	$objdump = 'objdump';
+}
+$objdump .= ' -s -j .comment';
 
 if ($#ARGV != -1) {
 	print STDERR "usage: $0 takes no parameters\n";
Index: linux/scripts/reference_discarded.pl
===================================================================
--- linux.orig/scripts/reference_discarded.pl	2005-09-20 16:36:32.095627904 +1000
+++ linux/scripts/reference_discarded.pl	2005-09-20 18:22:00.117517858 +1000
@@ -14,11 +14,17 @@ my $object;
 my $line;
 my $ignore;
 my $errorcount;
+my $objdump;
+if (exists($ENV{'OBJDUMP'})) {
+	$objdump = $ENV{'OBJDUMP'};
+} else {
+	$objdump = 'objdump';
+}
 
 $| = 1;
 
 # printf("Finding objects, ");
-open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
+open(OBJDUMP_LIST, "find . -name '*.o' | xargs $objdump -h |") || die "getting objdump list failed";
 while (defined($line = <OBJDUMP_LIST>)) {
 	chomp($line);
 	if ($line =~ /:\s+file format/) {
@@ -74,7 +80,7 @@ foreach $object (keys(%object)) {
 $errorcount = 0;
 foreach $object (keys(%object)) {
 	my $from;
-	open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
+	open(OBJDUMP, "$objdump -r $object|") || die "cannot objdump -r $object";
 	while (defined($line = <OBJDUMP>)) {
 		chomp($line);
 		if ($line =~ /RELOCATION RECORDS FOR /) {
Index: linux/scripts/reference_init.pl
===================================================================
--- linux.orig/scripts/reference_init.pl	2005-09-20 16:36:32.095627904 +1000
+++ linux/scripts/reference_init.pl	2005-09-20 18:24:14.060854489 +1000
@@ -22,11 +22,17 @@ my %object;
 my $object;
 my $line;
 my $ignore;
+my $objdump;
+if (exists($ENV{'OBJDUMP'})) {
+	$objdump = $ENV{'OBJDUMP'};
+} else {
+	$objdump = 'objdump';
+}
 
 $| = 1;
 
 printf("Finding objects, ");
-open(OBJDUMP_LIST, "find . -name '*.o' | xargs objdump -h |") || die "getting objdump list failed";
+open(OBJDUMP_LIST, "find . -name '*.o' | xargs $objdump -h |") || die "getting objdump list failed";
 while (defined($line = <OBJDUMP_LIST>)) {
 	chomp($line);
 	if ($line =~ /:\s+file format/) {
@@ -81,7 +87,7 @@ printf("ignoring %d conglomerate(s)\n", 
 printf("Scanning objects\n");
 foreach $object (sort(keys(%object))) {
 	my $from;
-	open(OBJDUMP, "objdump -r $object|") || die "cannot objdump -r $object";
+	open(OBJDUMP, "$objdump -r $object|") || die "cannot objdump -r $object";
 	while (defined($line = <OBJDUMP>)) {
 		chomp($line);
 		if ($line =~ /RELOCATION RECORDS FOR /) {


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scripts - use $OBJDUMP to get correct objdump (cross compile)
  2005-09-20  8:28 ` Keith Owens
@ 2005-09-20 14:39   ` Ben Dooks
  0 siblings, 0 replies; 6+ messages in thread
From: Ben Dooks @ 2005-09-20 14:39 UTC (permalink / raw)
  To: Keith Owens; +Cc: Ben Dooks, linux-kernel

On Tue, Sep 20, 2005 at 06:28:49PM +1000, Keith Owens wrote:
> On Mon, 19 Sep 2005 22:06:45 +0100, 
> Ben Dooks <ben-linux@fluff.org> wrote:
> >The scripts for `make buildcheck` are executing
> >objdump straight, which is wrong if the system
> >is using `make CROSS_COMPILE=....`. 
> >
> >Change the scripts to use $OBJDUMP passed from
> >the Makefile's environment, so that the correct
> >objdump is used, and the symbols are printed
> >correctly
> 
> Those scripts are meant to work even when they are invoked by hand,
> without OBJDUMP being defined in the environment.  This is the correct
> fix.
> 
> Signed-off-by: Keith Owens <kaos@ocs.com.au>

Ok, that seems to have fixed the problems, thanks.

Acked-by: Ben Dooks <ben-linux@fluff.org>

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scripts - use $OBJDUMP to get correct objdump (cross compile)
       [not found] ` <4OLPC-3NQ-19@gated-at.bofh.it>
@ 2005-09-20 16:55   ` Bodo Eggert
  2005-09-20 18:43     ` Valdis.Kletnieks
  0 siblings, 1 reply; 6+ messages in thread
From: Bodo Eggert @ 2005-09-20 16:55 UTC (permalink / raw)
  To: Keith Owens, Ben Dooks, linux-kernel, patch-out

Keith Owens <kaos@ocs.com.au> wrote:

> +my $objdump;
> +if (exists($ENV{'OBJDUMP'})) {
> +     $objdump = $ENV{'OBJDUMP'};

Having a typo in the environment shouldn't silently do something different
from what's requested. Use something like

my @objdump = ( (defined $ENV{'OBJDUMP'})? $ENV{'OBJDUMP'} :
                                           "/usr/bin/objdump",
               '-s', '-j');
> +} else {
> +     $objdump = 'objdump';
> +}
> +$objdump .= ' -s -j .comment';

Having a space as the option delimiter will break if the path to objdump
contains a space. Therefore you'll need to use an array.

-- 
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scripts - use $OBJDUMP to get correct objdump (cross compile)
  2005-09-20 16:55   ` Bodo Eggert
@ 2005-09-20 18:43     ` Valdis.Kletnieks
  2005-09-20 19:03       ` Bodo Eggert
  0 siblings, 1 reply; 6+ messages in thread
From: Valdis.Kletnieks @ 2005-09-20 18:43 UTC (permalink / raw)
  To: 7eggert; +Cc: Keith Owens, Ben Dooks, linux-kernel, patch-out

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]

On Tue, 20 Sep 2005 18:55:22 +0200, Bodo Eggert said:

> Having a space as the option delimiter will break if the path to objdump
> contains a space. Therefore you'll need to use an array.

No. You need to draw the line somewhere.  You let them have a space in the
path, the next thing you know the'll be back asking why a UTF-8 encoded
non-breaking-white-space in the path doesn't work. :)

[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scripts - use $OBJDUMP to get correct objdump (cross compile)
  2005-09-20 18:43     ` Valdis.Kletnieks
@ 2005-09-20 19:03       ` Bodo Eggert
  0 siblings, 0 replies; 6+ messages in thread
From: Bodo Eggert @ 2005-09-20 19:03 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: 7eggert, Keith Owens, Ben Dooks, linux-kernel, patch-out

On Tue, 20 Sep 2005 Valdis.Kletnieks@vt.edu wrote:
> On Tue, 20 Sep 2005 18:55:22 +0200, Bodo Eggert said:

> > Having a space as the option delimiter will break if the path to objdump
> > contains a space. Therefore you'll need to use an array.
> 
> No. You need to draw the line somewhere.  You let them have a space in the
> path, the next thing you know the'll be back asking why a UTF-8 encoded
> non-breaking-white-space in the path doesn't work. :)

Anything not containing '\0' SHOULD work on posix systems. Anything else 
is a programming error.

-- 
I always tell customers/clients the same thing:
   "Good, Fast, Cheap.  You can pick two."
	-- randem in <slrna09rui.g43.root@jade.randemmedia.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-09-20 19:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-19 21:06 [PATCH] scripts - use $OBJDUMP to get correct objdump (cross compile) Ben Dooks
2005-09-20  8:28 ` Keith Owens
2005-09-20 14:39   ` Ben Dooks
     [not found] <4OB3R-5gu-13@gated-at.bofh.it>
     [not found] ` <4OLPC-3NQ-19@gated-at.bofh.it>
2005-09-20 16:55   ` Bodo Eggert
2005-09-20 18:43     ` Valdis.Kletnieks
2005-09-20 19:03       ` Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox