* [PATCH] Replace use of perl with sed and tr in s390x build.
@ 2021-05-18 4:46 Rob Landley
2021-05-31 21:55 ` Vasily Gorbik
0 siblings, 1 reply; 3+ messages in thread
From: Rob Landley @ 2021-05-18 4:46 UTC (permalink / raw)
To: Heiko Carstens, Vasily Gorbik, Christian Borntraeger,
Alexander Egorenkov, Philipp Rudo, linux-s390, linux-kernel
From: Rob Landley <rob@landley.net>
Commit 246218962e21 in November added a perl dependency to the s390x vmlinux
build, complicating the "countering trusting trust" build approach ala
http://lists.landley.net/pipermail/toybox-landley.net/2020-July/011898.html
Signed-off-by: Rob Landley <rob@landley.net>
---
arch/s390/boot/compressed/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile
index de18dab518bb..e941b165bd4f 100644
--- a/arch/s390/boot/compressed/Makefile
+++ b/arch/s390/boot/compressed/Makefile
@@ -33,7 +33,7 @@ $(obj)/vmlinux.syms: $(obj)/vmlinux.lds $(objtree)/arch/s390/boot/startup.a $(OB
quiet_cmd_dumpsyms = DUMPSYMS $<
define cmd_dumpsyms
- $(NM) -n -S --format=bsd "$<" | $(PERL) -ne '/(\w+)\s+(\w+)\s+[tT]\s+(\w+)/ and printf "%x %x %s\0",hex $$1,hex $$2,$$3' > "$@"
+ $(NM) -n -S --format=bsd "$<" | sed -nE 's/^0*([0-9a-fA-F]+) 0*([0-9a-fA-F]+) [tT] ([^ ]*)$$/\1 \2 \3/p' | tr '\n' '\0' > "$@"
endef
$(obj)/syms.bin: $(obj)/vmlinux.syms FORCE
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Replace use of perl with sed and tr in s390x build.
2021-05-18 4:46 [PATCH] Replace use of perl with sed and tr in s390x build Rob Landley
@ 2021-05-31 21:55 ` Vasily Gorbik
2021-06-01 18:19 ` Rob Landley
0 siblings, 1 reply; 3+ messages in thread
From: Vasily Gorbik @ 2021-05-31 21:55 UTC (permalink / raw)
To: Rob Landley
Cc: Heiko Carstens, Christian Borntraeger, Alexander Egorenkov,
Philipp Rudo, linux-s390, linux-kernel
On Mon, May 17, 2021 at 11:46:44PM -0500, Rob Landley wrote:
> From: Rob Landley <rob@landley.net>
>
> Commit 246218962e21 in November added a perl dependency to the s390x vmlinux
> build, complicating the "countering trusting trust" build approach ala
> http://lists.landley.net/pipermail/toybox-landley.net/2020-July/011898.html
>
> Signed-off-by: Rob Landley <rob@landley.net>
> ---
>
> arch/s390/boot/compressed/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile
> index de18dab518bb..e941b165bd4f 100644
> --- a/arch/s390/boot/compressed/Makefile
> +++ b/arch/s390/boot/compressed/Makefile
> @@ -33,7 +33,7 @@ $(obj)/vmlinux.syms: $(obj)/vmlinux.lds $(objtree)/arch/s390/boot/startup.a $(OB
>
> quiet_cmd_dumpsyms = DUMPSYMS $<
> define cmd_dumpsyms
> - $(NM) -n -S --format=bsd "$<" | $(PERL) -ne '/(\w+)\s+(\w+)\s+[tT]\s+(\w+)/ and printf "%x %x %s\0",hex $$1,hex $$2,$$3' > "$@"
> + $(NM) -n -S --format=bsd "$<" | sed -nE 's/^0*([0-9a-fA-F]+) 0*([0-9a-fA-F]+) [tT] ([^ ]*)$$/\1 \2 \3/p' | tr '\n' '\0' > "$@"
> endef
The change itself is fine. Yields the same result as before with
binutils/llvm/elfutils versions of nm.
With s390 defconfig there is at least another perl invocation via
./lib/build_OID_registry, which is hard to get rid of. debug_defconfig calls
./scripts/headers_check.pl on top. Perl is explicitly listed in "Minimal
requirements to compile the Kernel" in Documentation/process/changes.rst and
quite frankly I'm not aware of any plans to get rid of it. It has its use.
So, would you mind if I pick your patch changing the commit message
like the following?
"""
s390/decompressor: replace use of perl with simple sed/tr
Use simple sed/tr instead of perl to generate decompressor symbols
file with the same result.
Signed-off-by: Rob Landley <rob@landley.net>
"""
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Replace use of perl with sed and tr in s390x build.
2021-05-31 21:55 ` Vasily Gorbik
@ 2021-06-01 18:19 ` Rob Landley
0 siblings, 0 replies; 3+ messages in thread
From: Rob Landley @ 2021-06-01 18:19 UTC (permalink / raw)
To: Vasily Gorbik
Cc: Heiko Carstens, Christian Borntraeger, Alexander Egorenkov,
Philipp Rudo, linux-s390, linux-kernel
On 5/31/21 4:55 PM, Vasily Gorbik wrote:
> On Mon, May 17, 2021 at 11:46:44PM -0500, Rob Landley wrote:
>> From: Rob Landley <rob@landley.net>
>>
>> Commit 246218962e21 in November added a perl dependency to the s390x vmlinux
>> build, complicating the "countering trusting trust" build approach ala
>> http://lists.landley.net/pipermail/toybox-landley.net/2020-July/011898.html
>>
>> Signed-off-by: Rob Landley <rob@landley.net>
>> ---
>>
>> arch/s390/boot/compressed/Makefile | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile
>> index de18dab518bb..e941b165bd4f 100644
>> --- a/arch/s390/boot/compressed/Makefile
>> +++ b/arch/s390/boot/compressed/Makefile
>> @@ -33,7 +33,7 @@ $(obj)/vmlinux.syms: $(obj)/vmlinux.lds $(objtree)/arch/s390/boot/startup.a $(OB
>>
>> quiet_cmd_dumpsyms = DUMPSYMS $<
>> define cmd_dumpsyms
>> - $(NM) -n -S --format=bsd "$<" | $(PERL) -ne '/(\w+)\s+(\w+)\s+[tT]\s+(\w+)/ and printf "%x %x %s\0",hex $$1,hex $$2,$$3' > "$@"
>> + $(NM) -n -S --format=bsd "$<" | sed -nE 's/^0*([0-9a-fA-F]+) 0*([0-9a-fA-F]+) [tT] ([^ ]*)$$/\1 \2 \3/p' | tr '\n' '\0' > "$@"
>> endef
>
> The change itself is fine. Yields the same result as before with
> binutils/llvm/elfutils versions of nm.
...
> So, would you mind if I pick your patch changing the commit message
> like the following?
> """
> s390/decompressor: replace use of perl with simple sed/tr
>
> Use simple sed/tr instead of perl to generate decompressor symbols
> file with the same result.
Works for me.
> Signed-off-by: Rob Landley <rob@landley.net>
> """
Thanks,
Rob
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-01 18:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 4:46 [PATCH] Replace use of perl with sed and tr in s390x build Rob Landley
2021-05-31 21:55 ` Vasily Gorbik
2021-06-01 18:19 ` Rob Landley
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.