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]
Message-ID: <500504f6-fed1-45a4-a518-4631a6f3e463@t-8ch.de>
Date:   Fri, 4 Aug 2023 18:02:35 +0200
From:   Thomas Weißschuh <thomas@...ch.de>
To:     Zhangjin Wu <falcon@...ylab.org>
Cc:     arnd@...db.de, linux-kernel@...r.kernel.org,
        linux-kselftest@...r.kernel.org, tanyuan@...ylab.org, w@....eu
Subject: Re: [PATCH v1 2/3] selftests/nolibc: fix up O= option support

On 2023-08-04 23:52:18+0800, Zhangjin Wu wrote:
> > On 2023-08-04 15:43:42+0800, Zhangjin Wu wrote:
> > > Hi, Thomas
> > > 
> > > > On 2023-08-03 22:45:52+0800, Zhangjin Wu wrote:
> > > > > To avoid pollute the source code tree and avoid mrproper for every
> > > > > architecture switch, the O= argument must be supported.
> > > > > 
> > > > > Both IMAGE and .config are from the building directory, let's use
> > > > > objtree instead of srctree for them.
> > > > > 
> > > > > If no O= option specified, means building kernel in source code tree,
> > > > > objtree should be srctree in such case.
> > > > > 
> > > > > Suggested-by: Willy Tarreau <w@....eu>
> > > > > Link: https://lore.kernel.org/lkml/ZK0AB1OXH1s2xYsh@1wt.eu/
> > > > > Signed-off-by: Zhangjin Wu <falcon@...ylab.org>
> > > > > ---
> > > > >  tools/testing/selftests/nolibc/Makefile | 7 +++++--
> > > > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
> > > > > index 51fef5e6a152..af590aee063a 100644
> > > > > --- a/tools/testing/selftests/nolibc/Makefile
> > > > > +++ b/tools/testing/selftests/nolibc/Makefile
> > > > > @@ -9,6 +9,9 @@ ifeq ($(srctree),)
> > > > >  srctree := $(patsubst %/tools/testing/selftests/,%,$(dir $(CURDIR)))
> > > > >  endif
> > > > >  
> > > > > +# add objtree for O= argument, required by IMAGE and .config
> > > > > +objtree ?= $(srctree)
> > > > 
> > > > Isn't this already set by the included tools/scripts/Makefile.include?
> > > >
> > > 
> > > Good question, but it is empty if no O= specified, checked it several
> > > times before ;-)
> > 
> > For me it is not empty when I am in tools/testing/selftests/nolibc/.
> >
> 
> Interesting, here is the code I added to check the value:
> 
>     diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
>     index 22f1e1d73fa8..1ae19e896e24 100644
>     --- a/tools/testing/selftests/nolibc/Makefile
>     +++ b/tools/testing/selftests/nolibc/Makefile
>     @@ -12,6 +12,8 @@ include $(srctree)/scripts/subarch.include
>      ARCH = $(SUBARCH)
>      endif
>     
>     +$(error objtree=$(objtree), srctree=$(srctree))
>     +
> 
> Whenever I do defconfig or run,
> 
>     $ make help
>     Makefile:15: *** objtree=, srctree=/labs/linux-lab/src/linux-stable.  Stop.
> 
> It is only not empty when we pass O explicitly:
> 
>     $ mkdir out
>     $ make help O=out
>     Makefile:15: *** objtree=out, srctree=/labs/linux-lab/src/linux-stable.  Stop.
>     $ make help O=$PWD/out
>     Makefile:15: *** objtree=/labs/linux-lab/src/linux-stable/tools/testing/selftests/nolibc/out, srctree=/labs/linux-lab/src/linux-stable.  Stop.

Welp, now it's the same for me.
I guess I messed it up before, maybe I forgot to remove your changes
while testing?

Anyways instead of having to manually do stuff with $(objtree) we could
also use $(OUTPUT)$(IMAGE) to always get the correct image.

> [..]
> 
> After align the empty objtree value with you, will renew this patch.

Thanks!
Thomas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ