lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 13 Jun 2023 19:23:20 -0700
From:   John Hubbard <jhubbard@...dia.com>
To:     Anders Roxell <anders.roxell@...aro.org>, <shuah@...nel.org>
CC:     <linux-kselftest@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <usama.anjum@...labora.com>
Subject: Re: [PATCH] selftests: lib.mk: fix out-of-tree builds

On 6/13/23 00:49, Anders Roxell wrote:
> Since commit ("selftests: error out if kernel header files are not yet
> built") got merged, the kselftest build correctly because the
> KBUILD_OUTPUT isn't set when building out-of-tree and specifying 'O='
> This is the error message that pops up.
> 
> make --silent --keep-going --jobs=32 O=/home/anders/.cache/tuxmake/builds/1482/build INSTALL_PATH=/home/anders/.cache/tuxmake/builds/1482/build/kselftest_install ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- V=1 CROSS_COMPILE_COMPAT=arm-linux-gnueabihf- kselftest-install
> make[3]: Entering directory '/home/anders/src/kernel/next/tools/testing/selftests/alsa'
> 
> -e .[1;31merror.[0m: missing kernel header files.
> Please run this and try again:
> 
>      cd /home/anders/src/kernel/next/tools/testing/selftests/../../..
>      make headers
> 
> make[3]: Leaving directory '/home/anders/src/kernel/next/tools/testing/selftests/alsa'
> make[3]: *** [../lib.mk:77: kernel_header_files] Error 1
> 
> Fixing the issue by assigning KBUILD_OUTPUT the same way how its done in
> kselftest's Makefile. By adding 'KBUILD_OUTPUT := $(O)' 'if $(origin O)'
> is set to 'command line'. This will set the the BUILD dir to
> KBUILD_OUTPUT/kselftest when doing out-of-tree builds which makes them
> in its own separete output directory.
> 
> Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
> ---
>   tools/testing/selftests/lib.mk | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
> index b8ea03b9a015..d17854285f2b 100644
> --- a/tools/testing/selftests/lib.mk
> +++ b/tools/testing/selftests/lib.mk
> @@ -44,6 +44,10 @@ endif
>   selfdir = $(realpath $(dir $(filter %/lib.mk,$(MAKEFILE_LIST))))
>   top_srcdir = $(selfdir)/../../..
>   
> +ifeq ("$(origin O)", "command line")
> +  KBUILD_OUTPUT := $(O)
> +endif
> +

Thanks for fixing this up! This looks correct.

(It's too bad that we have all this duplication between the Makefile
and lib.mk.)

thanks,
-- 
John Hubbard
NVIDIA

>   ifneq ($(KBUILD_OUTPUT),)
>     # Make's built-in functions such as $(abspath ...), $(realpath ...) cannot
>     # expand a shell special character '~'. We use a somewhat tedious way here.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ