decodecode: use cross-compiler/toolchain if defined
PATCH 1/1 decodecode: use cross-compiler/toolchain if defined
Hi Sam,
Not sure if this is really in the kbuild domain, but I see you've taken patches to this script before, so I'll make an attempt too :-)
Vegard
Quoted 1 line
From
75166add6121dbda4fad2e197d4fe6525dee580cMon Sep 17 00:00:00 2001
From: Vegard Nossum <[email protected]>
Date: Mon, 12 May 2008 15:36:38 +0200
Subject: [PATCH] decodecode: use cross-compiler/toolchain if defined
Quoted 1 line
From the
Makefile: "CROSS_COMPILEspecify [sic] the prefix used for all
executables used".
This is also very useful for decoding oopses on other archs than the native one, so it seems natural to have it in the decodecode script as well.
--- scripts/decodecode | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
scripts/decodecode +4 -4
@@ -48,8 +48,8 @@ if [ $marker -ne 0 ]; then beforemark=`echo "$code" | cut -c-$((${marker} - 1))` echo -n " .byte 0x" > $T.s echo $beforemark | sed -e 's/ /,0x/g' >> $T.s - as $AFLAGS -o $T.o $T.s - objdump -S $T.o + ${CROSS_COMPILE}as $AFLAGS -o $T.o $T.s + ${CROSS_COMPILE}objdump -S $T.o rm $T.o $T.s # and fix code at-and-after marker
@@ -59,6 +59,6 @@ fi code=`echo $code | sed -e 's/ [<(]/ /;s/[>)] / /;s/ /,0x/g'` echo -n " .byte 0x" > $T.s echo $code >> $T.s -as $AFLAGS -o $T.o $T.s -objdump -S $T.o +${CROSS_COMPILE}as $AFLAGS -o $T.o $T.s +${CROSS_COMPILE}objdump -S $T.o rm $T $T.s $T.o
Signature · 1 line
1.5.4.1
Quoted 4 lines · Vegard Nossum
Hi Sam,
Not sure if this is really in the kbuild domain, but I see you've taken patches to this script before, so I'll make an attempt too :-)
Fine - and thanks for the reminder (in private mail).
Quoted 9 lines
Vegard
From
75166add6121dbda4fad2e197d4fe6525dee580cMon Sep 17 00:00:00 2001
From: Vegard Nossum <[email protected]>
Date: Mon, 12 May 2008 15:36:38 +0200
Subject: [PATCH] decodecode: use cross-compiler/toolchain if defined
Quoted 6 lines
From the
Makefile: "CROSS_COMPILEspecify [sic] the prefix used for all executables used".This is also very useful for decoding oopses on other archs than the native one, so it seems natural to have it in the decodecode script as well.
I agree with the intent of this patch.
But as it is my experience that most people use CROSS_COMPILE on the commandline and not as an environmnet variable most will not benefit from this patch.
We should as a minimum document this use of decodecode where we document its usage today (oops-tracing.txt).
We could also make it a Makefile target thus it is a bit more natural to supply the typical Makefile parameters?
Please rework one way or the other.
Sam
Quoted 10 lines · Sam Ravnborg
Quoted 9 lines · Vegard Nossum
From
75166add6121dbda4fad2e197d4fe6525dee580cMon Sep 17 00:00:00 2001
From: Vegard Nossum <[email protected]>
Date: Mon, 12 May 2008 15:36:38 +0200
Subject: [PATCH] decodecode: use cross-compiler/toolchain if definedFrom the
Makefile: "CROSS_COMPILEspecify [sic] the prefix used for all executables used".
Quoted 8 lines
Quoted 3 lines
This is also very useful for decoding oopses on other archs than the native one, so it seems natural to have it in the decodecode script as well.
I agree with the intent of this patch.
But as it is my experience that most people useCROSS_COMPILEon the commandline and not as an environmnet variable most will not benefit from this patch.
I do use it on the command line too, it just has to come in front of the 'make' command:
CROSS_COMPILE=x86_64-linux-unknown-gnu- make
Quoted 7 lines
We should as a minimum document this use of decodecode where we document its usage today (oops-tracing.txt).
We could also make it a
Makefiletarget thus it is a bit more natural to supply the typicalMakefileparameters?Please rework one way or the other.
I can try to do both those, however I don't see how this patch fails to be an improvement in any case.
Thanks for the feedback.
Vegard
Signature · 4 lines
"The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036