* [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh
@ 2021-03-09 16:25 Masahiro Yamada
2021-03-09 17:37 ` Nathan Chancellor
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Masahiro Yamada @ 2021-03-09 16:25 UTC (permalink / raw)
To: linux-kbuild
Cc: Jiri Slaby, Masahiro Yamada, Jiri Slaby, Miguel Ojeda,
Nathan Chancellor, Nick Desaulniers, Philipp Rudo, linux-kernel
Commit aec6c60a01d3 ("kbuild: check the minimum compiler version in
Kconfig") changed how the script detects the compiler version.
Get 'make CROSS_COMPILE=scripts/dummy-tools/' back working again.
Fixes: aec6c60a01d3 ("kbuild: check the minimum compiler version in Kconfig")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
Perhaps, Jiri may have already noticed this issue, and have a similar patch.
I just checked ML, but I did not find a patch to fix this.
scripts/dummy-tools/gcc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/dummy-tools/gcc b/scripts/dummy-tools/gcc
index 7b10332b23ba..39e65fee59bd 100755
--- a/scripts/dummy-tools/gcc
+++ b/scripts/dummy-tools/gcc
@@ -57,9 +57,9 @@ if arg_contain --version "$@"; then
fi
if arg_contain -E "$@"; then
- # For scripts/gcc-version.sh; This emulates GCC 20.0.0
+ # For scripts/cc-version.sh; This emulates GCC 20.0.0
if arg_contain - "$@"; then
- sed 's/^__GNUC__$/20/; s/^__GNUC_MINOR__$/0/; s/^__GNUC_PATCHLEVEL__$/0/'
+ sed -n '/^GCC/{s/__GNUC__/20/; s/__GNUC_MINOR__/0/; s/__GNUC_PATCHLEVEL__/0/; p;}'
exit 0
else
echo "no input files" >&2
--
2.27.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh
2021-03-09 16:25 [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh Masahiro Yamada
@ 2021-03-09 17:37 ` Nathan Chancellor
2021-03-09 18:16 ` Miguel Ojeda
2021-03-10 4:54 ` Jiri Slaby
2 siblings, 0 replies; 5+ messages in thread
From: Nathan Chancellor @ 2021-03-09 17:37 UTC (permalink / raw)
To: Masahiro Yamada
Cc: linux-kbuild, Jiri Slaby, Jiri Slaby, Miguel Ojeda,
Nick Desaulniers, Philipp Rudo, linux-kernel
On Wed, Mar 10, 2021 at 01:25:45AM +0900, Masahiro Yamada wrote:
> Commit aec6c60a01d3 ("kbuild: check the minimum compiler version in
> Kconfig") changed how the script detects the compiler version.
>
> Get 'make CROSS_COMPILE=scripts/dummy-tools/' back working again.
>
> Fixes: aec6c60a01d3 ("kbuild: check the minimum compiler version in Kconfig")
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
> ---
>
> Perhaps, Jiri may have already noticed this issue, and have a similar patch.
> I just checked ML, but I did not find a patch to fix this.
>
>
> scripts/dummy-tools/gcc | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/dummy-tools/gcc b/scripts/dummy-tools/gcc
> index 7b10332b23ba..39e65fee59bd 100755
> --- a/scripts/dummy-tools/gcc
> +++ b/scripts/dummy-tools/gcc
> @@ -57,9 +57,9 @@ if arg_contain --version "$@"; then
> fi
>
> if arg_contain -E "$@"; then
> - # For scripts/gcc-version.sh; This emulates GCC 20.0.0
> + # For scripts/cc-version.sh; This emulates GCC 20.0.0
> if arg_contain - "$@"; then
> - sed 's/^__GNUC__$/20/; s/^__GNUC_MINOR__$/0/; s/^__GNUC_PATCHLEVEL__$/0/'
> + sed -n '/^GCC/{s/__GNUC__/20/; s/__GNUC_MINOR__/0/; s/__GNUC_PATCHLEVEL__/0/; p;}'
> exit 0
> else
> echo "no input files" >&2
> --
> 2.27.0
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh
2021-03-09 16:25 [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh Masahiro Yamada
2021-03-09 17:37 ` Nathan Chancellor
@ 2021-03-09 18:16 ` Miguel Ojeda
2021-03-10 4:54 ` Jiri Slaby
2 siblings, 0 replies; 5+ messages in thread
From: Miguel Ojeda @ 2021-03-09 18:16 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linux Kbuild mailing list, Jiri Slaby, Jiri Slaby, Miguel Ojeda,
Nathan Chancellor, Nick Desaulniers, Philipp Rudo, linux-kernel
On Tue, Mar 9, 2021 at 5:29 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Commit aec6c60a01d3 ("kbuild: check the minimum compiler version in
> Kconfig") changed how the script detects the compiler version.
>
> Get 'make CROSS_COMPILE=scripts/dummy-tools/' back working again.
>
> Fixes: aec6c60a01d3 ("kbuild: check the minimum compiler version in Kconfig")
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Cheers,
Miguel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh
2021-03-09 16:25 [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh Masahiro Yamada
2021-03-09 17:37 ` Nathan Chancellor
2021-03-09 18:16 ` Miguel Ojeda
@ 2021-03-10 4:54 ` Jiri Slaby
2021-03-10 12:17 ` Masahiro Yamada
2 siblings, 1 reply; 5+ messages in thread
From: Jiri Slaby @ 2021-03-10 4:54 UTC (permalink / raw)
To: Masahiro Yamada, linux-kbuild
Cc: Jiri Slaby, Miguel Ojeda, Nathan Chancellor, Nick Desaulniers,
Philipp Rudo, linux-kernel
On 09. 03. 21, 17:25, Masahiro Yamada wrote:
> Commit aec6c60a01d3 ("kbuild: check the minimum compiler version in
> Kconfig") changed how the script detects the compiler version.
>
> Get 'make CROSS_COMPILE=scripts/dummy-tools/' back working again.
>
> Fixes: aec6c60a01d3 ("kbuild: check the minimum compiler version in Kconfig")
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> Perhaps, Jiri may have already noticed this issue, and have a similar patch.
> I just checked ML, but I did not find a patch to fix this.
No, as I was making it work on 5.11 :).
BTW there is one remaining issue I came across:
config PAHOLE_HAS_SPLIT_BTF
def_bool $(success, test `$(PAHOLE) --version | sed -E
's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119")
and in Makefile we see:
PAHOLE = pahole
and not something like:
PAHOLE = $(CROSS_COMPILE)pahole
Any idea how to fix this?
> scripts/dummy-tools/gcc | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/dummy-tools/gcc b/scripts/dummy-tools/gcc
> index 7b10332b23ba..39e65fee59bd 100755
> --- a/scripts/dummy-tools/gcc
> +++ b/scripts/dummy-tools/gcc
> @@ -57,9 +57,9 @@ if arg_contain --version "$@"; then
> fi
>
> if arg_contain -E "$@"; then
> - # For scripts/gcc-version.sh; This emulates GCC 20.0.0
> + # For scripts/cc-version.sh; This emulates GCC 20.0.0
> if arg_contain - "$@"; then
> - sed 's/^__GNUC__$/20/; s/^__GNUC_MINOR__$/0/; s/^__GNUC_PATCHLEVEL__$/0/'
> + sed -n '/^GCC/{s/__GNUC__/20/; s/__GNUC_MINOR__/0/; s/__GNUC_PATCHLEVEL__/0/; p;}'
> exit 0
> else
> echo "no input files" >&2
>
--
js
suse labs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh
2021-03-10 4:54 ` Jiri Slaby
@ 2021-03-10 12:17 ` Masahiro Yamada
0 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2021-03-10 12:17 UTC (permalink / raw)
To: Jiri Slaby
Cc: Linux Kbuild mailing list, Miguel Ojeda, Nathan Chancellor,
Nick Desaulniers, Philipp Rudo, Linux Kernel Mailing List
On Wed, Mar 10, 2021 at 1:54 PM Jiri Slaby <jirislaby@kernel.org> wrote:
>
> On 09. 03. 21, 17:25, Masahiro Yamada wrote:
> > Commit aec6c60a01d3 ("kbuild: check the minimum compiler version in
> > Kconfig") changed how the script detects the compiler version.
> >
> > Get 'make CROSS_COMPILE=scripts/dummy-tools/' back working again.
> >
> > Fixes: aec6c60a01d3 ("kbuild: check the minimum compiler version in Kconfig")
> > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > ---
> >
> > Perhaps, Jiri may have already noticed this issue, and have a similar patch.
> > I just checked ML, but I did not find a patch to fix this.
>
> No, as I was making it work on 5.11 :).
>
> BTW there is one remaining issue I came across:
> config PAHOLE_HAS_SPLIT_BTF
> def_bool $(success, test `$(PAHOLE) --version | sed -E
> 's/v([0-9]+)\.([0-9]+)/\1\2/'` -ge "119")
I think I said this somewhere, but
PAHOLE_HAS_SPLIT_BTF should be deleted.
Checking the pahole version in Kconfig is wrong, I believe.
>
> and in Makefile we see:
> PAHOLE = pahole
>
> and not something like:
> PAHOLE = $(CROSS_COMPILE)pahole
I do not think $(CROSS_COMPILE)pahole
makes sense.
As far as I test, pahole works
for fereing architecture objects too.
The DWARF format is identical
across architectures.
For example, for the following code:
$ cat test.c
struct sample {
char a[2];
long l;
int i;
void *p;
short s;
} sample;
$ gcc -g -c -o test.o test.c; pahole test.o
$ arm-linux-gnueabihf-gcc -g -c -o test.o test.c; pahole test.o
$ aarch64-linux-gnu-gcc -g -c -o test.o test.c; pahole test.o
All worked for me.
> Any idea how to fix this?
>
> > scripts/dummy-tools/gcc | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/scripts/dummy-tools/gcc b/scripts/dummy-tools/gcc
> > index 7b10332b23ba..39e65fee59bd 100755
> > --- a/scripts/dummy-tools/gcc
> > +++ b/scripts/dummy-tools/gcc
> > @@ -57,9 +57,9 @@ if arg_contain --version "$@"; then
> > fi
> >
> > if arg_contain -E "$@"; then
> > - # For scripts/gcc-version.sh; This emulates GCC 20.0.0
> > + # For scripts/cc-version.sh; This emulates GCC 20.0.0
> > if arg_contain - "$@"; then
> > - sed 's/^__GNUC__$/20/; s/^__GNUC_MINOR__$/0/; s/^__GNUC_PATCHLEVEL__$/0/'
> > + sed -n '/^GCC/{s/__GNUC__/20/; s/__GNUC_MINOR__/0/; s/__GNUC_PATCHLEVEL__/0/; p;}'
> > exit 0
> > else
> > echo "no input files" >&2
> >
>
>
> --
> js
> suse labs
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-03-10 12:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 16:25 [PATCH] kbuild: dummy-tools: adjust to scripts/cc-version.sh Masahiro Yamada
2021-03-09 17:37 ` Nathan Chancellor
2021-03-09 18:16 ` Miguel Ojeda
2021-03-10 4:54 ` Jiri Slaby
2021-03-10 12:17 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).