Re: [PATCH v2 3/3] selftests/nolibc: fix up O= option support
From: Zhangjin Wu
Date: Sun Aug 27 2023 - 03:10:22 EST
Hi, Yuan
> Hi Zhangjin and Willy,
>
> On 8/26/2023 12:30 PM, Zhangjin Wu wrote:
[...]
> >
> > ubuntu@linux-lab:/labs/linux-lab/src/linux-stable/tools/testing/selftests/nolibc$ find sysroot/ -name "errno.h"
> > sysroot/i386/include/errno.h
> > sysroot/i386/include/asm-generic/errno.h
> > sysroot/i386/include/asm/errno.h --> here it is
> > sysroot/i386/include/linux/errno.h
> > sysroot/x86/include/errno.h
> > sysroot/x86/include/asm-generic/errno.h
> > sysroot/x86/include/asm/errno.h --> here it is
> > sysroot/x86/include/linux/errno.h
> >
> > That also means, to use O=out for run-user, we also need to use O=out for
> > defconfig (and kernel ...) too, otherwise, the top-level source code tree will
> > be polluated.
> >
> > Seems a manual mrproper on top-level source code tree is always required for a
> > new iteration, so, it may be ok to pick this patch with a note on the potential
> > error.
>
> There are two potential solutions for addressing this issue.
>
> The first option involves copying
> 'linux/arch/x86/include/generated/uapi/asm/' to 'sysroot/x86/include/'
> during the make of target headers_standalone.
>
Will this work when linux/arch/x86/include/generated/uapi/asm/ is stale?
for example, when linux/arch/x86/include/generated/uapi/asm/ is there
for v6.1, but we are installing v6.5 sysroot?
> The second approach entails displaying an error message when the code
> tree is not clean and prompting users to manually execute 'make
> mrproper'. In this case, we can utilize the target 'outputmakefile' from
> the root makefile directly.
>
A question is, without O= option, will this 'outputmakefile' always
require to do mrproper (when we have already done defconfig, kernel or
run without O=)? but currently, seems we don't require to do so.
Currently, the asm/errno.h is installed whenever the source code tree is
clean or not, the issue is asm/errno.h will not be installed only when
O= specified. The root solution may be the generic-y (or generated-y?) in
scripts/Makefile.asm-generic should be corrected to work with O= option?
but this common code want us to be more careful.
> Willy, which method do you prefer? Do you have any alternative
> suggestions? :)
>
>
> Besides. using x86_64-linux-gnu- won't reproduce this issue. It searched
> and found 'asm/errno.h' in '/usr/include/x86_64-linux-gnu', whereas
> 'x86_64-linux' lacks these libraries.
>
So, the -gnu- toolchain may hide some issues in
scripts/Makefile.asm-generic for O= option.
Thanks,
Zhangjin