Re: [PATCH v2 4/4] kbuild: use $(src) instead of $(srctree)/$(src) for source directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 28, 2024 at 2:14 AM Edgecombe, Rick P
<rick.p.edgecombe@xxxxxxxxx> wrote:
>
> On Fri, 2024-05-10 at 04:36 +0900, Masahiro Yamada wrote:
> >
> > Or, fix the code.
> >
> >
> > Now fixed. Thanks for the report.
> >
>
> Hi,
>
> This commit broke my build in a similar way:
> make ARCH=x86_64 O=../linux-tdx-kvm-out/ -j36 M=arch/x86/kvm/
> make[1]: Entering directory '/home/rpedgeco/repos/linux-tdx-kvm-out'
> /home/rpedgeco/repos/linux/scripts/Makefile.build:41: arch/x86/kvm/Makefile: No
> such file or directory
> make[3]: *** No rule to make target 'arch/x86/kvm/Makefile'.  Stop.
> make[2]: *** [/home/rpedgeco/repos/linux/Makefile:1934: arch/x86/kvm] Error 2
> make[1]: *** [/home/rpedgeco/repos/linux/Makefile:240: __sub-make] Error 2
> make[1]: Leaving directory '/home/rpedgeco/repos/linux-tdx-kvm-out'
> make: *** [Makefile:240: __sub-make] Error 2
>
> This patch didn’t fix it:
> https://lore.kernel.org/lkml/20240624-kbuild-fix-xconfig-v1-1-7c06eae6d3aa@xxxxxx/
>
> But reverting b1992c3772e6 ("kbuild: use $(src) instead of $(srctree)/$(src) for
> source directory") does.
>
> I'm guess it has something to do with the "M=" option because:
> make ARCH=x86_64 O=../linux-tdx-kvm-out/ -j36 arch/x86/kvm/kvm.ko
> arch/x86/kvm/kvm-intel.ko
>
> ...works.



There are two solutions, depending on what you want to achieve.

The official way is to pass the absolute path to M=
(or relative path to ../linux-tdm-kvm-out)

The other unofficial way is to pass VPATH.
The external module build does not officially support
the separate output directory, but you can still
do it in this case.

[1] will work like before.



[1] Output module objects to linux-tdm-kvm-out/arch/x86/kvm/ (unofficial)


$ make ARCH=x86_64 O=../linux-tdx-kvm-out/ -j36 M=arch/x86/kvm VPATH=$(pwd)


[2] Output the module objects into arch/x86/kvm/ of the source tree (official)


$ make ARCH=x86_64 O=../linux-tdx-kvm-out/ -j36 M=$(realpath arch/x86/kvm)



-- 
Best Regards
Masahiro Yamada





[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux