From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62B761A3154; Tue, 31 Mar 2026 03:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774928982; cv=none; b=sAZMpMCXAsFwLh0vKL5QXlLQ5lbuNhw57+AZDMTNu+edy7ACSxULx/2f03PVoV3l6W8ZWRD2h9MyJdMa18c2Po/x3f+1dE0Kqzhsafu7MVFO2YeIIi9Zg93xqD892NjaC0dcIUyRyEguQAOXEqKPsKxrvBgGUNwGAPcZTbQLCPY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774928982; c=relaxed/simple; bh=l06uxyOpIMnyXWTGELET/DMNPi9LVXkhpKravgaBkFI=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=A6UZjOc/Ekpq5cL0RJfgBxIonuvaceM80kcwXxwfKvSAyTRWhImGsTgGzYNHLeXQUHOyM/O10gdiBJI+0s+T5Rh6sS60KRMuUf3VK+YKvhuluNzmFQah0Hoey2/geVKES7awICwc+//41dnDjFDgCa/53a2rO/N2+jEwXB7vMpM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=FIGWQa+B; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="FIGWQa+B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE02BC2BC9E; Tue, 31 Mar 2026 03:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1774928981; bh=l06uxyOpIMnyXWTGELET/DMNPi9LVXkhpKravgaBkFI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FIGWQa+BsQEZY8tMKHl+WSXn8LoUdpgI/KWXRdhbgaJfjwnJVVyfyiZkSeV2OYHUR 8HBw6QPiIlFZsKLSJiNStfHgWaXJFRxn/mfcTNYdLJcg+/NZXk//Gu0BQqE8uS58qa rBdMXX3Y9MB4qhauTVeOLAKUGhCKWRefw36mGOZk= Date: Mon, 30 Mar 2026 20:49:41 -0700 From: Andrew Morton To: Li Wang Cc: linux-kbuild@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: tools/testing/selftests Message-Id: <20260330204941.de4ba3fde700e669d33f054c@linux-foundation.org> In-Reply-To: References: <20260327143234.40bb8a0119bd55670ddfeec6@linux-foundation.org> <20260328135650.435b415f8c00835b2fa471e0@linux-foundation.org> <20260328140311.d6ce99302f93923b0cffb441@linux-foundation.org> <20260330170954.47dfef29063afe9ea502505a@linux-foundation.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 31 Mar 2026 09:52:35 +0800 Li Wang wrote: > On Mon, Mar 30, 2026 at 05:09:54PM -0700, Andrew Morton wrote: > > On Sun, 29 Mar 2026 18:04:52 +0800 Li Wang wrote: > > > > > > 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) > > > > Thanks, I'll get onto this stuff soon. > > I have created a patchset for those build tiny issues, > let me send out to you to have a early try? Sure. > > Meanwhile, shouldn't this work? > > > > ts:/usr/src/25/tools/testing/selftests/mm> make merge.i > > make: *** No rule to make target 'merge.i'. Stop. > > That's probably because Makefile explicitly disables the implicit .c to .i rule. > > In line#43 of Makefile: > > MAKEFLAGS += --no-builtin-rules > > I doubt do we really need to add back the 'gcc -E' approach? I occasionally use it for figuring out inclusion messes. `make -V' followed by copy-paste-edit still works ;) > The selftests build system intentionally kills built-in rules to prevent > half-broken implicit builds. > (the comment line# 33~42 in the Makefile explains why) OK, wow, looks like that solution was painfully arrived at.