* nm vmlinux error in arch/arm reappears after upgrade to make 4.4
@ 2023-01-07 0:29 Nathan Chancellor
2023-01-07 7:19 ` Masahiro Yamada
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2023-01-07 0:29 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Nick Desaulniers, Nicolas Schier, linux-kbuild, linux-kernel
Hi Masahiro,
My distribution recently updated their version of make to 4.4 from 4.3,
after which I notice the following error from nm when building ARCH=arm
kernels, which I thought that this was supposed to be resolved with
commit 3ec8a5b33dea ("kbuild: do not export LDFLAGS_vmlinux") but the
tree clearly has this and it is not visible while just running clean (I
have to build zImage to see it):
$ git show -s --format='%h ("%s")'
512dee0c00ad ("Merge tag 'x86-urgent-2023-01-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip")
$ make --version | head -1
GNU Make 4.4
$ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=build defconfig zImage
arm-linux-gnueabi-nm: 'arch/arm/boot/compressed/../../../../vmlinux': No such file
vs.
$ make --version | head -1
GNU Make 4.3
$ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=build defconfig zImage
I bisected make to see what change causes this and I landed on
commit 98da874c ("[SV 10593] Export variables to $(shell ...)
commands") [1], which certainly seems like a reasonable commit to
blame but I am not sure how exactly it factors in here.
If you need any more information on reproducing this, I am happy to
provide it (CROSS_COMPILE is just the toolchains from kernel.org).
[1]: https://git.savannah.gnu.org/cgit/make.git/commit/?id=98da874c43035a490cdca81331724f233a3d0c9a
Cheers,
Nathan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: nm vmlinux error in arch/arm reappears after upgrade to make 4.4
2023-01-07 0:29 nm vmlinux error in arch/arm reappears after upgrade to make 4.4 Nathan Chancellor
@ 2023-01-07 7:19 ` Masahiro Yamada
2023-01-07 15:22 ` Masahiro Yamada
0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2023-01-07 7:19 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Nick Desaulniers, Nicolas Schier, linux-kbuild, linux-kernel
On Sat, Jan 7, 2023 at 9:29 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Hi Masahiro,
>
> My distribution recently updated their version of make to 4.4 from 4.3,
> after which I notice the following error from nm when building ARCH=arm
> kernels, which I thought that this was supposed to be resolved with
> commit 3ec8a5b33dea ("kbuild: do not export LDFLAGS_vmlinux") but the
> tree clearly has this and it is not visible while just running clean (I
> have to build zImage to see it):
Presumably, this is a different issue than 3ec8a5b33dea
>
> $ git show -s --format='%h ("%s")'
> 512dee0c00ad ("Merge tag 'x86-urgent-2023-01-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip")
>
> $ make --version | head -1
> GNU Make 4.4
>
> $ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=build defconfig zImage
> arm-linux-gnueabi-nm: 'arch/arm/boot/compressed/../../../../vmlinux': No such file
>
> vs.
>
> $ make --version | head -1
> GNU Make 4.3
>
> $ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=build defconfig zImage
>
> I bisected make to see what change causes this and I landed on
> commit 98da874c ("[SV 10593] Export variables to $(shell ...)
> commands") [1], which certainly seems like a reasonable commit to
> blame but I am not sure how exactly it factors in here.
>
> If you need any more information on reproducing this, I am happy to
> provide it (CROSS_COMPILE is just the toolchains from kernel.org).
>
> [1]: https://git.savannah.gnu.org/cgit/make.git/commit/?id=98da874c43035a490cdca81331724f233a3d0c9a
>
> Cheers,
> Nathan
Confirmed, but I still do not understand what
is triggering this.
These are my findings:
- O= option is needed to reproduce it.
- allnoconfig still produces it.
- I do not see it in the incremental builds.
I see it again in the full build after "git clean -fdx".
If I slightly cleaned the code like follows,
this issue disappeared.
($(obj)/../../../../vmlinux is the same as vmlinux)
diff --git a/arch/arm/boot/compressed/Makefile
b/arch/arm/boot/compressed/Makefile
index 2ef651a78fa2..726ecabcef09 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -107,7 +107,7 @@ ccflags-remove-$(CONFIG_FUNCTION_TRACER) += -pg
asflags-y := -DZIMAGE
# Supply kernel BSS size to the decompressor via a linker symbol.
-KBSS_SZ = $(shell echo $$(($$($(NM) $(obj)/../../../../vmlinux | \
+KBSS_SZ = $(shell echo $$(($$($(NM) vmlinux | \
sed -n -e 's/^\([^ ]*\) [ABD] __bss_start$$/-0x\1/p' \
-e 's/^\([^ ]*\) [ABD] __bss_stop$$/+0x\1/p') )) )
LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
--
Best Regards
Masahiro Yamada
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: nm vmlinux error in arch/arm reappears after upgrade to make 4.4
2023-01-07 7:19 ` Masahiro Yamada
@ 2023-01-07 15:22 ` Masahiro Yamada
0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2023-01-07 15:22 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Nick Desaulniers, Nicolas Schier, linux-kbuild, linux-kernel
On Sat, Jan 7, 2023 at 4:19 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Sat, Jan 7, 2023 at 9:29 AM Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > Hi Masahiro,
> >
> > My distribution recently updated their version of make to 4.4 from 4.3,
> > after which I notice the following error from nm when building ARCH=arm
> > kernels, which I thought that this was supposed to be resolved with
> > commit 3ec8a5b33dea ("kbuild: do not export LDFLAGS_vmlinux") but the
> > tree clearly has this and it is not visible while just running clean (I
> > have to build zImage to see it):
>
>
> Presumably, this is a different issue than 3ec8a5b33dea
>
My bad.
3ec8a5b33dea unexported LDFLAGS_vmlinux
However,
5d4aeffbf709 exported LDFLAGS_vmlinux again.
> >
> > $ git show -s --format='%h ("%s")'
> > 512dee0c00ad ("Merge tag 'x86-urgent-2023-01-04' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip")
> >
> > $ make --version | head -1
> > GNU Make 4.4
> >
> > $ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=build defconfig zImage
> > arm-linux-gnueabi-nm: 'arch/arm/boot/compressed/../../../../vmlinux': No such file
> >
> > vs.
> >
> > $ make --version | head -1
> > GNU Make 4.3
> >
> > $ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- O=build defconfig zImage
> >
> > I bisected make to see what change causes this and I landed on
> > commit 98da874c ("[SV 10593] Export variables to $(shell ...)
> > commands") [1], which certainly seems like a reasonable commit to
> > blame but I am not sure how exactly it factors in here.
> >
> > If you need any more information on reproducing this, I am happy to
> > provide it (CROSS_COMPILE is just the toolchains from kernel.org).
> >
> > [1]: https://git.savannah.gnu.org/cgit/make.git/commit/?id=98da874c43035a490cdca81331724f233a3d0c9a
> >
> > Cheers,
> > Nathan
>
>
>
> Confirmed, but I still do not understand what
> is triggering this.
I figured out the reason.
I will send a patch later.
>
> These are my findings:
>
> - O= option is needed to reproduce it.
>
> - allnoconfig still produces it.
>
> - I do not see it in the incremental builds.
> I see it again in the full build after "git clean -fdx".
>
>
>
> If I slightly cleaned the code like follows,
> this issue disappeared.
> ($(obj)/../../../../vmlinux is the same as vmlinux)
>
>
>
>
> diff --git a/arch/arm/boot/compressed/Makefile
> b/arch/arm/boot/compressed/Makefile
> index 2ef651a78fa2..726ecabcef09 100644
> --- a/arch/arm/boot/compressed/Makefile
> +++ b/arch/arm/boot/compressed/Makefile
> @@ -107,7 +107,7 @@ ccflags-remove-$(CONFIG_FUNCTION_TRACER) += -pg
> asflags-y := -DZIMAGE
>
> # Supply kernel BSS size to the decompressor via a linker symbol.
> -KBSS_SZ = $(shell echo $$(($$($(NM) $(obj)/../../../../vmlinux | \
> +KBSS_SZ = $(shell echo $$(($$($(NM) vmlinux | \
> sed -n -e 's/^\([^ ]*\) [ABD] __bss_start$$/-0x\1/p' \
> -e 's/^\([^ ]*\) [ABD] __bss_stop$$/+0x\1/p') )) )
> LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
>
>
>
>
>
>
>
>
>
>
> --
> Best Regards
> Masahiro Yamada
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-07 15:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-07 0:29 nm vmlinux error in arch/arm reappears after upgrade to make 4.4 Nathan Chancellor
2023-01-07 7:19 ` Masahiro Yamada
2023-01-07 15:22 ` 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).