Re: [RFC v3 0/3] Fix errors when try to build kvm selftests on specified output

From: shuah
Date: Thu Mar 26 2020 - 16:57:40 EST


On 3/25/20 9:07 PM, Xiaoyao Li wrote:
Hi Shuah,

Hope you're happy with this version that I only touch KVM's Makefile.

I attempted to build KVM selftests on a specified dir, unfortunately
neither "make O=/path/to/mydir TARGETS=kvm" in tools/testing/selftests, nor
"make OUTPUT=/path/to/mydir" in tools/testing/selftests/kvm work.


Why are you running "make OUTPUT=/path/to/mydir"

It isn't correct.

make O=/path/to/mydir is what you have to use. Please main Makefile
as well for O= and KBUILD_OUTPUT usages.

Please see Documentation/dev-tools/kselftest.rst for use-cases.

make O=/path/to/mydir TARGETS=kvm is a right use-case and I can see
it will fail to create x86_64 directory.

Let's start with the following two commands and try to fix the
problems you are seeing.

make O=/path/to/mydir in kvm directory (this is supported,
however, the following command from the main Makefile is
recommended use.)

From main Makefile in kernel srcdir
make O=/path/to/mydir TARGETS=kvm

Also, just build isn't sufficient for you to be able to run the
tests.

make kselftest-install O=/path/to/mydir TARGETS=kvm will generate
run script.

thanks,
-- Shuah