Re: [PATCH 1/2] kbuild: change module.order to list *.o instead of *.ko
From: Masahiro Yamada <masahiroy@kernel.org>
Date: 2023-01-01 06:39:13
Also in:
linux-kbuild, lkml, llvm
On Sun, Jan 1, 2023 at 2:48 AM Marc Kleine-Budde [off-list ref] wrote:
On 11.12.2022 22:04:07, Masahiro Yamada wrote:quoted
scripts/Makefile.build replaces the suffix .o with .ko, then scripts/Makefile.modpost calls the sed command to change .ko back to the original .o suffix. Instead of converting the suffixes back-and-forth, store the .o paths in modules.order, and replace it with .ko in 'make modules_install'. This avoids the unneeded sed command.This breaks direct compilation of kernel modules (on current Linus's master): | $ make drivers/net/can/dev/can-dev.ko | [...] | CC [M] drivers/net/can/dev/skb.o | CC [M] drivers/net/can/dev/calc_bittiming.o | CC [M] drivers/net/can/dev/bittiming.o | CC [M] drivers/net/can/dev/dev.o | CC [M] drivers/net/can/dev/length.o | CC [M] drivers/net/can/dev/netlink.o | LD [M] drivers/net/can/dev/can-dev.o | make[5]: 'drivers/net/can/dev/can-dev.mod' is up to date. | LDS scripts/module.lds | MODPOST Module.symvers | drivers/net/can/dev/can-dev.ko: No such file or directory | make[1]: *** [.../linux/scripts/Makefile.modpost:129: Module.symvers] Error 1 | make: *** [.../linux/Makefile:1982: single_modules] Error 2 According to "make help" it should be possible: | dir/file.ko - Build module including final link I've bisected it to: | first bad commit: [f65a486821cfd363833079b2a7b0769250ee21c9] kbuild: change module.order to list *.o instead of *.ko regards, Marc
Thanks for the report. I submitted a fix. https://lore.kernel.org/lkml/20230101060709.208512-1-masahiroy@kernel.org/T/#u (local)
-- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
-- Best Regards Masahiro Yamada