arch/powerpc/boot/Makefile | 6 +++--- arch/powerpc/kernel/Makefile | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-)
The extra-y syntax is planned for deprecation because it is similar
to always-y.
When building the boot wrapper, always-y and extra-y are equivalent.
Use always-y instead.
In arch/powerpc/kernel/Makefile, I added ifdef KBUILD_BUILTIN to
keep the current behavior: prom_init_check is skipped when building
only modular objects.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
arch/powerpc/boot/Makefile | 6 +++---
arch/powerpc/kernel/Makefile | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 184d0680e661..b003f7ac8755 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -242,13 +242,13 @@ $(obj)/wrapper.a: $(obj-wlib) FORCE
hostprogs := addnote hack-coff mktree
targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) zImage.lds
-extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
+always-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
$(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
dtstree := $(src)/dts
wrapper := $(src)/wrapper
-wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
+wrapperbits := $(always-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
$(wrapper) FORCE
#############
@@ -455,7 +455,7 @@ WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
WRAPPER_BINDIR := /usr/sbin
INSTALL := install
-extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
+extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(always-y))
hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs))
wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts))
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 4d2daa8e7bca..ac01cedad107 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -201,7 +201,9 @@ obj-$(CONFIG_ALTIVEC) += vector.o
obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o
obj64-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_entry_64.o
-extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check
+ifdef KBUILD_BUILTIN
+always-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check
+endif
obj-$(CONFIG_PPC64) += $(obj64-y)
obj-$(CONFIG_PPC32) += $(obj32-y)
--
2.43.0
On Tue, 03 Jun 2025 01:32:24 +0900, Masahiro Yamada wrote:
> The extra-y syntax is planned for deprecation because it is similar
> to always-y.
>
> When building the boot wrapper, always-y and extra-y are equivalent.
> Use always-y instead.
>
> In arch/powerpc/kernel/Makefile, I added ifdef KBUILD_BUILTIN to
> keep the current behavior: prom_init_check is skipped when building
> only modular objects.
>
> [...]
Applied to powerpc/fixes.
[1/1] powerpc: use always-y instead of extra-y in Makefiles
https://git.kernel.org/powerpc/c/eb59d4c5948d93e940b5dde9d1bf3b33367fbcb8
Thanks
Le 02/06/2025 à 18:32, Masahiro Yamada a écrit : > The extra-y syntax is planned for deprecation because it is similar > to always-y. > > When building the boot wrapper, always-y and extra-y are equivalent. > Use always-y instead. > > In arch/powerpc/kernel/Makefile, I added ifdef KBUILD_BUILTIN to > keep the current behavior: prom_init_check is skipped when building > only modular objects. I don't understand what you mean. CONFIG_PPC_OF_BOOT_TRAMPOLINE is a bool, it cannot be a module. prom_init_check is only to check the content of prom_init.o which is never a module. Is always-y to run _after_ prom_init.o is built ? Christophe > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > --- > > arch/powerpc/boot/Makefile | 6 +++--- > arch/powerpc/kernel/Makefile | 4 +++- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile > index 184d0680e661..b003f7ac8755 100644 > --- a/arch/powerpc/boot/Makefile > +++ b/arch/powerpc/boot/Makefile > @@ -242,13 +242,13 @@ $(obj)/wrapper.a: $(obj-wlib) FORCE > hostprogs := addnote hack-coff mktree > > targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) zImage.lds > -extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ > +always-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ > $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds > > dtstree := $(src)/dts > > wrapper := $(src)/wrapper > -wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ > +wrapperbits := $(always-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ > $(wrapper) FORCE > > ############# > @@ -455,7 +455,7 @@ WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts > WRAPPER_BINDIR := /usr/sbin > INSTALL := install > > -extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) > +extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(always-y)) > hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs)) > wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper > dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts)) > diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile > index 4d2daa8e7bca..ac01cedad107 100644 > --- a/arch/powerpc/kernel/Makefile > +++ b/arch/powerpc/kernel/Makefile > @@ -201,7 +201,9 @@ obj-$(CONFIG_ALTIVEC) += vector.o > > obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o > obj64-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_entry_64.o > -extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check > +ifdef KBUILD_BUILTIN > +always-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check > +endif > > obj-$(CONFIG_PPC64) += $(obj64-y) > obj-$(CONFIG_PPC32) += $(obj32-y)
On Tue, Jun 3, 2025 at 3:50 PM Christophe Leroy <christophe.leroy@csgroup.eu> wrote: > > > > Le 02/06/2025 à 18:32, Masahiro Yamada a écrit : > > The extra-y syntax is planned for deprecation because it is similar > > to always-y. > > > > When building the boot wrapper, always-y and extra-y are equivalent. > > Use always-y instead. > > > > In arch/powerpc/kernel/Makefile, I added ifdef KBUILD_BUILTIN to > > keep the current behavior: prom_init_check is skipped when building > > only modular objects. > > I don't understand what you mean. > > CONFIG_PPC_OF_BOOT_TRAMPOLINE is a bool, it cannot be a module. > > prom_init_check is only to check the content of prom_init.o which is > never a module. > > Is always-y to run _after_ prom_init.o is built ? The intent of "make ARCH=powerpc modules" is to compile objects that are necessary for modules, that is, all built-in objects are skipped. However, always-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check would generate prom_init_check regardless, and its prerequisite, prom_init.o as well. With CONFIG_MODULES=y and CONFIG_MODVERSIONS=n, and without ifdef KBUILD_BUILTIN, $ make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- modules would result in this: CC [M] arch/powerpc/kvm/book3s_xive_native.o CC [M] arch/powerpc/kvm/book3s_64_vio.o LD [M] arch/powerpc/kvm/kvm.o CC [M] arch/powerpc/kvm/book3s_hv.o AS [M] arch/powerpc/kvm/book3s_hv_interrupts.o CC [M] arch/powerpc/kvm/book3s_64_mmu_hv.o CC [M] arch/powerpc/kvm/book3s_64_mmu_radix.o CC [M] arch/powerpc/kvm/book3s_hv_nested.o CC [M] arch/powerpc/kvm/book3s_hv_tm.o LD [M] arch/powerpc/kvm/kvm-hv.o CC [M] arch/powerpc/kernel/rtas_flash.o CC arch/powerpc/kernel/prom_init.o PROMCHK arch/powerpc/kernel/prom_init_check CC [M] kernel/locking/locktorture.o CC [M] kernel/time/test_udelay.o CC [M] kernel/time/time_test.o CC [M] kernel/backtracetest.o CC [M] kernel/torture.o CC [M] kernel/resource_kunit.o CC [M] kernel/sysctl-test.o CC [M] fs/ext4/inode-test.o LD [M] fs/ext4/ext4-inode-test.o CC [M] fs/fat/namei_vfat.o LD [M] fs/fat/vfat.o CC [M] fs/fat/fat_test.o CC [M] fs/nls/nls_ucs2_utils.o CC [M] fs/netfs/buffered_read.o CC [M] fs/netfs/buffered_write.o ... You can see these two lines: CC arch/powerpc/kernel/prom_init.o PROMCHK arch/powerpc/kernel/prom_init_check are supposed to be skipped when "make modules", but actually compiled without ifdef. So, I added ifdef KBUILD_BUILTIN to preserve the current behavior. > Christophe > > > > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> > > --- > > > > arch/powerpc/boot/Makefile | 6 +++--- > > arch/powerpc/kernel/Makefile | 4 +++- > > 2 files changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile > > index 184d0680e661..b003f7ac8755 100644 > > --- a/arch/powerpc/boot/Makefile > > +++ b/arch/powerpc/boot/Makefile > > @@ -242,13 +242,13 @@ $(obj)/wrapper.a: $(obj-wlib) FORCE > > hostprogs := addnote hack-coff mktree > > > > targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) zImage.lds > > -extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ > > +always-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ > > $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds > > > > dtstree := $(src)/dts > > > > wrapper := $(src)/wrapper > > -wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ > > +wrapperbits := $(always-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ > > $(wrapper) FORCE > > > > ############# > > @@ -455,7 +455,7 @@ WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts > > WRAPPER_BINDIR := /usr/sbin > > INSTALL := install > > > > -extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y)) > > +extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(always-y)) > > hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs)) > > wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper > > dts-installed := $(patsubst $(dtstree)/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(dtstree)/*.dts)) > > diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile > > index 4d2daa8e7bca..ac01cedad107 100644 > > --- a/arch/powerpc/kernel/Makefile > > +++ b/arch/powerpc/kernel/Makefile > > @@ -201,7 +201,9 @@ obj-$(CONFIG_ALTIVEC) += vector.o > > > > obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o > > obj64-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_entry_64.o > > -extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check > > +ifdef KBUILD_BUILTIN > > +always-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check > > +endif > > > > obj-$(CONFIG_PPC64) += $(obj64-y) > > obj-$(CONFIG_PPC32) += $(obj32-y) > -- Best Regards Masahiro Yamada
Masahiro Yamada <masahiroy@kernel.org> writes: > On Tue, Jun 3, 2025 at 3:50 PM Christophe Leroy > <christophe.leroy@csgroup.eu> wrote: >> Le 02/06/2025 à 18:32, Masahiro Yamada a écrit : >> > The extra-y syntax is planned for deprecation because it is similar >> > to always-y. >> > >> > When building the boot wrapper, always-y and extra-y are equivalent. >> > Use always-y instead. >> > >> > In arch/powerpc/kernel/Makefile, I added ifdef KBUILD_BUILTIN to >> > keep the current behavior: prom_init_check is skipped when building >> > only modular objects. >> >> I don't understand what you mean. >> >> CONFIG_PPC_OF_BOOT_TRAMPOLINE is a bool, it cannot be a module. >> >> prom_init_check is only to check the content of prom_init.o which is >> never a module. >> >> Is always-y to run _after_ prom_init.o is built ? > > The intent of "make ARCH=powerpc modules" > is to compile objects that are necessary for modules, > that is, all built-in objects are skipped. > > However, > always-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check > would generate prom_init_check regardless, > and its prerequisite, prom_init.o as well. > > With CONFIG_MODULES=y and > CONFIG_MODVERSIONS=n, > and without ifdef KBUILD_BUILTIN, > > $ make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- modules > > would result in this: > > > CC [M] arch/powerpc/kvm/book3s_xive_native.o > CC [M] arch/powerpc/kvm/book3s_64_vio.o > LD [M] arch/powerpc/kvm/kvm.o > CC [M] arch/powerpc/kvm/book3s_hv.o > AS [M] arch/powerpc/kvm/book3s_hv_interrupts.o > CC [M] arch/powerpc/kvm/book3s_64_mmu_hv.o > CC [M] arch/powerpc/kvm/book3s_64_mmu_radix.o > CC [M] arch/powerpc/kvm/book3s_hv_nested.o > CC [M] arch/powerpc/kvm/book3s_hv_tm.o > LD [M] arch/powerpc/kvm/kvm-hv.o > CC [M] arch/powerpc/kernel/rtas_flash.o > CC arch/powerpc/kernel/prom_init.o > PROMCHK arch/powerpc/kernel/prom_init_check > CC [M] kernel/locking/locktorture.o > CC [M] kernel/time/test_udelay.o > CC [M] kernel/time/time_test.o > CC [M] kernel/backtracetest.o > CC [M] kernel/torture.o > CC [M] kernel/resource_kunit.o > CC [M] kernel/sysctl-test.o > CC [M] fs/ext4/inode-test.o > LD [M] fs/ext4/ext4-inode-test.o > CC [M] fs/fat/namei_vfat.o > LD [M] fs/fat/vfat.o > CC [M] fs/fat/fat_test.o > CC [M] fs/nls/nls_ucs2_utils.o > CC [M] fs/netfs/buffered_read.o > CC [M] fs/netfs/buffered_write.o > ... > > > > You can see these two lines: > > CC arch/powerpc/kernel/prom_init.o > PROMCHK arch/powerpc/kernel/prom_init_check > > are supposed to be skipped when "make modules", > but actually compiled without ifdef. > > So, I added ifdef KBUILD_BUILTIN to preserve > the current behavior. OK, that makes sense. I don't really ever build just modules, so I wouldn't notice, but some folks probably do. Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) cheers
On Mon, Jun 9, 2025 at 10:02 AM Michael Ellerman <mpe@ellerman.id.au> wrote: > > Masahiro Yamada <masahiroy@kernel.org> writes: > > On Tue, Jun 3, 2025 at 3:50 PM Christophe Leroy > > <christophe.leroy@csgroup.eu> wrote: > >> Le 02/06/2025 à 18:32, Masahiro Yamada a écrit : > >> > The extra-y syntax is planned for deprecation because it is similar > >> > to always-y. > >> > > >> > When building the boot wrapper, always-y and extra-y are equivalent. > >> > Use always-y instead. > >> > > >> > In arch/powerpc/kernel/Makefile, I added ifdef KBUILD_BUILTIN to > >> > keep the current behavior: prom_init_check is skipped when building > >> > only modular objects. > >> > >> I don't understand what you mean. > >> > >> CONFIG_PPC_OF_BOOT_TRAMPOLINE is a bool, it cannot be a module. > >> > >> prom_init_check is only to check the content of prom_init.o which is > >> never a module. > >> > >> Is always-y to run _after_ prom_init.o is built ? > > > > The intent of "make ARCH=powerpc modules" > > is to compile objects that are necessary for modules, > > that is, all built-in objects are skipped. > > > > However, > > always-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init_check > > would generate prom_init_check regardless, > > and its prerequisite, prom_init.o as well. > > > > With CONFIG_MODULES=y and > > CONFIG_MODVERSIONS=n, > > and without ifdef KBUILD_BUILTIN, > > > > $ make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- modules > > > > would result in this: > > > > > > CC [M] arch/powerpc/kvm/book3s_xive_native.o > > CC [M] arch/powerpc/kvm/book3s_64_vio.o > > LD [M] arch/powerpc/kvm/kvm.o > > CC [M] arch/powerpc/kvm/book3s_hv.o > > AS [M] arch/powerpc/kvm/book3s_hv_interrupts.o > > CC [M] arch/powerpc/kvm/book3s_64_mmu_hv.o > > CC [M] arch/powerpc/kvm/book3s_64_mmu_radix.o > > CC [M] arch/powerpc/kvm/book3s_hv_nested.o > > CC [M] arch/powerpc/kvm/book3s_hv_tm.o > > LD [M] arch/powerpc/kvm/kvm-hv.o > > CC [M] arch/powerpc/kernel/rtas_flash.o > > CC arch/powerpc/kernel/prom_init.o > > PROMCHK arch/powerpc/kernel/prom_init_check > > CC [M] kernel/locking/locktorture.o > > CC [M] kernel/time/test_udelay.o > > CC [M] kernel/time/time_test.o > > CC [M] kernel/backtracetest.o > > CC [M] kernel/torture.o > > CC [M] kernel/resource_kunit.o > > CC [M] kernel/sysctl-test.o > > CC [M] fs/ext4/inode-test.o > > LD [M] fs/ext4/ext4-inode-test.o > > CC [M] fs/fat/namei_vfat.o > > LD [M] fs/fat/vfat.o > > CC [M] fs/fat/fat_test.o > > CC [M] fs/nls/nls_ucs2_utils.o > > CC [M] fs/netfs/buffered_read.o > > CC [M] fs/netfs/buffered_write.o > > ... > > > > > > > > You can see these two lines: > > > > CC arch/powerpc/kernel/prom_init.o > > PROMCHK arch/powerpc/kernel/prom_init_check > > > > are supposed to be skipped when "make modules", > > but actually compiled without ifdef. > > > > So, I added ifdef KBUILD_BUILTIN to preserve > > the current behavior. > > OK, that makes sense. > > I don't really ever build just modules, so I wouldn't notice, but some > folks probably do. > > Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) No rush for this patch. Please take it to your ppc tree. Thank you. -- Best Regards Masahiro Yamada
© 2016 - 2025 Red Hat, Inc.