powerpc: add crtsavres.o to always-y instead of extra-y
PATCH 1/1 powerpc: add crtsavres.o to always-y instead of extra-y
crtsavres.o is linked to modules. However, as explained in commit d0e628cd817f ("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.
For example, the following command fails:
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules
[snip]
LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko
ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory
make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1
make[2]: *** [Makefile:1844: modules] Error 2
make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2
make: *** [Makefile:234: __sub-make] Error 2---
arch/powerpc/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/lib/Makefile +1 -1
@@ -45,7 +45,7 @@ obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o # so it is only needed for modules, and only for older linkers which # do not support --save-restore-funcs ifndef CONFIG_LD_IS_BFD -extra-$(CONFIG_PPC64) += crtsavres.o +always-$(CONFIG_PPC64) += crtsavres.o endif obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \
Signature · 1 line
2.40.1
Quoted 6 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
Quoted 9 lines
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules
[snip]
LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko
ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory
make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1
make[2]: *** [Makefile:1844: modules] Error 2
make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2
make: *** [Makefile:234: __sub-make] Error 2Thanks. Is this the correct Fixes tag?
Hmm, looks like LLD might just do this now automatically for us too without --save-restore-funcs (https://reviews.llvm.org/D79977).
But we probably still need it for older versions, so we still need your patch.
Quoted 19 lines
Signed-off-by Masahiro Yamada <[email protected]>---
arch/powerpc/lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/lib/Makefile +1
-1@@ -45,7 +45,7 @@ obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o # so it is only needed for modules, and only for older linkers which # do not support --save-restore-funcs ifndef CONFIG_LD_IS_BFD -extra-$(CONFIG_PPC64) += crtsavres.o +always-$(CONFIG_PPC64) += crtsavres.o endif obj-$(CONFIG_PPC_BOOK3S_64) += copyuser_power7.o copypage_power7.o \
Quoted 17 lines · Nicholas Piggin
Quoted 6 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
Quoted 9 lines
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules [snip] LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 make[2]: *** [Makefile:1844: modules] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 make: *** [Makefile:234: __sub-make] Error 2
Quoted 4 lines
Thanks. Is this the correct Fixes tag?
Fixes d0e628cd817f ("powerpc/64: Do not link crtsavres.o in vmlinux")
I am finding a different commit ID:
commit baa25b571a168aff5a13bfdc973f1229e2b12b63
Author: Nicholas Piggin <[email protected]> Date: Fri May 12 01:56:49 2017 +1000
powerpc/64: Do not link crtsavres.o in vmlinux
The 64-bit linker creates save/restore functions on demand with final links, so vmlinux does not require crtsavres.o.
-aneesh
Quoted 31 lines · Aneesh Kumar K.V
Quoted 17 lines · Nicholas Piggin
Quoted 6 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
Quoted 9 lines
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules [snip] LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 make[2]: *** [Makefile:1844: modules] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 make: *** [Makefile:234: __sub-make] Error 2Quoted 4 lines
Thanks. Is this the correct Fixes tag?
Fixes d0e628cd817f ("powerpc/64: Do not link crtsavres.o in vmlinux")I am finding a different commit ID:
commit
baa25b571a168aff5a13bfdc973f1229e2b12b63Author: Nicholas Piggin <[email protected]> Date: Fri May 12 01:56:49 2017 +1000
Quoted 7 lines
powerpc/64: Do not link crtsavres.o in vmlinux
The 64-bit linker creates save/restore functions on demand with final links, so vmlinux does not require crtsavres.o.
-aneesh
Yeah, I think the correct tag is:
Signature · 2 lines
Best Regards Masahiro Yamada
Michael Ellerman
reviewerQuoted 33 lines · Masahiro Yamada
Quoted 31 lines · Aneesh Kumar K.V
Quoted 17 lines · Nicholas Piggin
Quoted 6 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
Quoted 9 lines
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules [snip] LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 make[2]: *** [Makefile:1844: modules] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 make: *** [Makefile:234: __sub-make] Error 2Quoted 4 lines
Thanks. Is this the correct Fixes tag?
Fixes d0e628cd817f ("powerpc/64: Do not link crtsavres.o in vmlinux")I am finding a different commit ID:
commit
baa25b571a168aff5a13bfdc973f1229e2b12b63Author: Nicholas Piggin <[email protected]> Date: Fri May 12 01:56:49 2017 +1000
Quoted 8 lines
Quoted 4 lines
powerpc/64: Do not link crtsavres.o in vmlinux
The 64-bit linker creates save/restore functions on demand with final links, so vmlinux does not require crtsavres.o.
Yeah, I think the correct tag is:
Fixes baa25b571a16 ("powerpc/64: Do not link crtsavres.o in vmlinux")
Yep, I used that when applying.
cheers
Quoted 17 lines · Nicholas Piggin
Quoted 6 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
Quoted 9 lines
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules [snip] LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 make[2]: *** [Makefile:1844: modules] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 make: *** [Makefile:234: __sub-make] Error 2
Quoted 8 lines
Thanks. Is this the correct Fixes tag?
Fixes d0e628cd817f ("powerpc/64: Do not link crtsavres.o in vmlinux")Hmm, looks like LLD might just do this now automatically for us too without --save-restore-funcs (https://reviews.llvm.org/D79977).
But we probably still need it for older versions, so we still need your patch.
Hi,
I'm still seeing the error of crtsavres.o missing when building external modules after "make LLVM=1 modules_prepare". Should it be built also in archprepare?
Thanks,
Jan
arch/powerpc/Makefile +4 -1
@@ -57,8 +57,11 @@ ifeq ($(CONFIG_PPC64)$(CONFIG_LD_IS_BFD),yy) # Have the linker provide sfpr if possible. # There is a corresponding test in arch/powerpc/lib/Makefile KBUILD_LDFLAGS_MODULE += --save-restore-funcs +crtsavres_prepare: else KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +crtsavres_prepare: + $(MAKE) $(build)=arch/powerpc/lib arch/powerpc/lib/crtsavres.o endif ifdef CONFIG_CPU_LITTLE_ENDIAN
@@ -389,7 +392,7 @@ vdso_prepare: prepare0 $(build)=arch/powerpc/kernel/vdso include/generated/vdso64-offsets.h) endif -archprepare: checkbin +archprepare: checkbin crtsavres_prepare archheaders: $(Q)$(MAKE) $(build)=arch/powerpc/kernel/syscalls all
Michael Ellerman
reviewerQuoted 27 lines · Jan Stancek
Quoted 17 lines · Nicholas Piggin
Quoted 6 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
Quoted 9 lines
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules [snip] LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 make[2]: *** [Makefile:1844: modules] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 make: *** [Makefile:234: __sub-make] Error 2Quoted 8 lines
Thanks. Is this the correct Fixes tag?
Fixes d0e628cd817f ("powerpc/64: Do not link crtsavres.o in vmlinux")Hmm, looks like LLD might just do this now automatically for us too without --save-restore-funcs (https://reviews.llvm.org/D79977).
But we probably still need it for older versions, so we still need your patch.
Quoted 4 lines
Hi,
I'm still seeing the error of crtsavres.o missing when building external modules after "make LLVM=1
modules_prepare". Should it be built also in archprepare?
Or modules_prepare?
Example patch below.
cheers
arch/powerpc/Makefile +5 -0
@@ -59,6 +59,11 @@ ifeq ($(CONFIG_PPC64)$(CONFIG_LD_IS_BFD),yy) KBUILD_LDFLAGS_MODULE += --save-restore-funcs else KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o + +crtsavres_prepare: scripts + $(MAKE) $(build)=arch/powerpc/lib arch/powerpc/lib/crtsavres.o + +modules_prepare: crtsavres_prepare endif ifdef CONFIG_CPU_LITTLE_ENDIAN
Quoted 29 lines · Michael Ellerman
Quoted 27 lines · Jan Stancek
Quoted 25 lines · Nicholas Piggin
Quoted 6 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
Quoted 9 lines
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules [snip] LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 make[2]: *** [Makefile:1844: modules] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 make: *** [Makefile:234: __sub-make] Error 2Thanks. Is this the correct Fixes tag?
Fixes d0e628cd817f ("powerpc/64: Do not link crtsavres.o in vmlinux")Hmm, looks like LLD might just do this now automatically for us too without --save-restore-funcs (https://reviews.llvm.org/D79977).
But we probably still need it for older versions, so we still need your patch.
Quoted 8 lines
Quoted 4 lines
Hi,
I'm still seeing the error of crtsavres.o missing when building external modules after "make LLVM=1
modules_prepare". Should it be built also in archprepare?Or
modules_prepare?Example patch below.
I tested your patch with my setup and that works for me as well.
Quoted 21 lines
cheers
arch/powerpc/Makefile +5
-0@@ -59,6 +59,11 @@ ifeq ($(CONFIG_PPC64)$(CONFIG_LD_IS_BFD),yy) KBUILD_LDFLAGS_MODULE += --save-restore-funcs else KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o + +crtsavres_prepare: scripts + $(MAKE) $(build)=arch/powerpc/lib arch/powerpc/lib/crtsavres.o + +modules_prepare: crtsavres_prepare endif ifdef CONFIG_CPU_LITTLE_ENDIAN
Quoted 33 lines · Jan Stancek
Quoted 31 lines · Michael Ellerman
Quoted 29 lines · Jan Stancek
Quoted 17 lines · Nicholas Piggin
Quoted 6 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
Quoted 9 lines
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules [snip] LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 make[2]: *** [Makefile:1844: modules] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 make: *** [Makefile:234: __sub-make] Error 2Quoted 8 lines
Thanks. Is this the correct Fixes tag?
Fixes d0e628cd817f ("powerpc/64: Do not link crtsavres.o in vmlinux")Hmm, looks like LLD might just do this now automatically for us too without --save-restore-funcs (https://reviews.llvm.org/D79977).
But we probably still need it for older versions, so we still need your patch.Hi,
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
I'm still seeing the error of crtsavres.o missing when building external modules after "make LLVM=1
modules_prepare". Should it be built also in archprepare?Or
modules_prepare?Example patch below.
I tested your patch with my setup and that works for me as well.
Please note 'make ARCH=powerpc clean' will remove '*.o' files globally.
Kbuild promised you would still be able to compile external modules after 'make clean' (until you run 'make mrproper'), but that would not work in this case.
So, the external module support for powerpc
is broken in another way, already.
Perhaps, an easy workaround might be to change
the suffix, but I did not test it at all.
mv arch/powerpc/lib/crtsavres.o arch/powerpc/lib/crtsavres.o.do_not_remove_me
Signature · 2 lines
Best Regards Masahiro Yamada
Michael Ellerman
AppliedQuoted 15 lines · Masahiro Yamada
crtsavres.o is linked to modules. However, as explained in commit
d0e628cd817f("kbuild: doc: clarify the difference between extra-y and always-y"), 'make modules' does not build extra-y.For example, the following command fails:
$ make ARCH=powerpc LLVM=1 KBUILD_MODPOST_WARN=1 mrproper ps3_defconfig modules [snip] LD [M] arch/powerpc/platforms/cell/spufs/spufs.ko ld.lld: error: cannot open arch/powerpc/lib/crtsavres.o: No such file or directory make[3]: *** [scripts/Makefile.modfinal:56: arch/powerpc/platforms/cell/spufs/spufs.ko] Error 1 make[2]: *** [Makefile:1844: modules] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:350: __build_one_by_one] Error 2 make: *** [Makefile:234: __sub-make] Error 2
Quoted 1 line
[...]
Applied to powerpc/next.
[1/1] powerpc: add crtsavres.o to always-y instead of extra-y
https://git.kernel.org/powerpc/c/1b1e38002648819c04773647d5242990e2824264
cheers