On Sat, Mar 28, 2026 at 02:03:11PM -0700, Andrew Morton wrote:
> On Sat, 28 Mar 2026 13:56:50 -0700 Andrew Morton <[email protected]> 
> wrote:
> 
> > On Sat, 28 Mar 2026 10:12:06 +0800 Li Wang <[email protected]> wrote:
> > 
> > > > from the top level?
> > > 
> > > Should use:
> > > 
> > >     make kselftest
> > 
> 
> I'm probably doing something wrong, but `make -j50 kselftest-all'
> appears to have scribbled on my top-level Makefile, so now I'm getting
> 
> ts:/usr/src/25> make kselftest-all 
> /usr/src/25/Makefile:5: *** Too many open files.  Stop.
> 
> ts:/usr/src/25> cat Makefile
> # Automatically generated by /usr/src/25/Makefile: don't edit
> export KBUILD_OUTPUT = .
> export KBUILD_EXTMOD = /usr/src/25
> export KBUILD_EXTMOD_OUTPUT = /usr/src/25
> include /usr/src/25/Makefile
> 
> I've done this twice in succession now.  Any suggestions where I should
> look?

When build selftests from the top-level, sub-makes entered via `-C` may
still inherit the caller's PWD from the environment.

Some selftests use $(PWD) in recursive kbuild invocations, which can
then incorrectly resolve to the kernel top directory instead of the
current test directory.

Maybe try export PWD in the ../selftests/lib.mk?

  export PWD := $(CURDIR)

-- 
Regards,
Li Wang


Reply via email to