From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from e2i702.smtp2go.com (e2i702.smtp2go.com [103.2.142.190]) (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 79FDC1AB513 for ; Sat, 2 Nov 2024 21:08:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.2.142.190 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730581721; cv=none; b=WaKok8wuhFr4Ehw5FjA/LZ3v8kgqcj5n/p1HmV8iUpnnL3z/JCXVUJVXpKWN1oFM0JJtUqx/5YHbC30ZsVgsJ97Nnia/zdtLvDdFIc1h2ScTGd776B0b3rN0QUwgL5b0ZurqrkRNOBQExzbpkQPjSjm2028ClEUqUmKNRFaBnZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730581721; c=relaxed/simple; bh=S6N9ZGM2cfU20hr9WOcviqXD5oXVjBqaHStnNBvwVnc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VGhWSyYrsUdPqDXRE/EBNX2O4a7ZGxttaTgyFweGu0/DC1QtE2Z9uvZTBAgui6f9U40IyEKmLvUtSaDjQuxHV9Z/SnXV18lw0Qut++pHa4Eh4L+mF8fg2yS+xZ44gj0oiR3svRykwN8GSNWmqmH9mEQjaK0ypAtRslQllSydQ+A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fjasle.eu; spf=pass smtp.mailfrom=em1174286.fjasle.eu; dkim=fail (0-bit key) header.d=smtpservice.net header.i=@smtpservice.net header.b=ENKzs7hR reason="unknown key version"; dkim=pass (2048-bit key) header.d=fjasle.eu header.i=@fjasle.eu header.b=ahvAHSJq; dkim=pass (1024-bit key) header.d=fjasle.eu header.i=@fjasle.eu header.b=V46Jvjlf; arc=none smtp.client-ip=103.2.142.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fjasle.eu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=em1174286.fjasle.eu Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="unknown key version" (0-bit key) header.d=smtpservice.net header.i=@smtpservice.net header.b="ENKzs7hR"; dkim=pass (2048-bit key) header.d=fjasle.eu header.i=@fjasle.eu header.b="ahvAHSJq"; dkim=pass (1024-bit key) header.d=fjasle.eu header.i=@fjasle.eu header.b="V46Jvjlf" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=mp6320.a1-4.dyn; x=1730582615; h=Feedback-ID: X-Smtpcorp-Track:Message-ID:Subject:To:From:Date:Reply-To:Sender: List-Unsubscribe:List-Unsubscribe-Post; bh=HLrkWZmy37z2+q6UvAJjqEXBZQvEVug9IkxNqJcixI8=; b=ENKzs7hRb/7kZfehx30yrGHu1n gJnNwiIqBxSjEr4njpwtWZp2KRuGI4daexGvOR4t1HVbwtEVodV96bibsDG3m2GwgKsQB/ygJDRfa yG6aeXfVv7TFjNpzaMHwjCbj7/7omO7bhhfyw/iKRUaSzWlzaMnYbJcKQyzeMUYsjAuQwbIXjvLFO wJXcHJo9BjzCuBQbiWc9swDtT83CLPylJmfadqAMwxZ4mF6KzQPSHVdZLjKw1KNwdpMH9TFF7xAR1 5B6tGeg+w1WQigRUm/UHUKjMLNjgJVgPTyJ67oQyAVzewaOytTt9UigKCmnJaX4S7kJbydFb2khOj k2PCOU+A==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fjasle.eu; i=@fjasle.eu; q=dns/txt; s=s1174286; t=1730581715; h=from : subject : to : message-id : date; bh=HLrkWZmy37z2+q6UvAJjqEXBZQvEVug9IkxNqJcixI8=; b=ahvAHSJqtfFf5zxfD4Eww+/1el2aDADGvE8A+LnKJCMx/j4utxPzIDC7DzX1IS9dwdESz /EtN5CH4aN6iebtvAqaw6kHz/vSv7sAKcbRKuNiEE3PAfX2nhPFcRAiJbFsG7RKm2wgcH5y O327svKUSlsYORk3vZ2Uhvm9K+GD2gPkYbb5t7rmCXULPaFDCMQmzEpz1Vijzras0LfG8Ey V/nza+P7rYV+19D6AMjCrBMAl5d8MBUZ0nphJgiNKQt9xFu0QhLjfpTRgbX+vUxy+yl+FY4 MkN1usOoogBdjeZQkZWwMznCtAXaB3ub8KDS+h296OxRFVEjhOoilIBn4paw== Received: from [10.172.233.45] (helo=SmtpCorp) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2-S2G) (envelope-from ) id 1t7LLV-qt4DSG-Eh; Sat, 02 Nov 2024 21:07:45 +0000 Received: from [10.85.249.164] (helo=leknes.fjasle.eu) by smtpcorp.com with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97.1-S2G) (envelope-from ) id 1t7LLU-AIkwcC8v3t7-KDch; Sat, 02 Nov 2024 21:07:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fjasle.eu; s=mail; t=1730581664; bh=S6N9ZGM2cfU20hr9WOcviqXD5oXVjBqaHStnNBvwVnc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V46JvjlffE0FnQAi51MJR4LGCSgDKR3d3n8bNdPfvkttAFMBl3EKiYVsPEa4v/1zG tByg80SaewjkEYADd33G1q/czS+0ScSWI4+MitbOP5D0tuUzGdPkXPLGRCZThvpKRD SYTEL0TRoVB/Mb/VIVXYSq/NE59Vss1EpK3LrlWI= Received: by leknes.fjasle.eu (Postfix, from userid 1000) id 39AFA3D7A3; Sat, 2 Nov 2024 22:07:44 +0100 (CET) Date: Sat, 2 Nov 2024 22:07:44 +0100 From: Nicolas Schier To: Vegard Nossum Cc: Masahiro Yamada , linux-kbuild@vger.kernel.org, Nathan Chancellor , Michael Ellerman , Morten Linderud , Haelwenn Monnier , Jann Horn , Kees Cook , James Bottomley , Theodore Ts'o , linux-hardening@vger.kernel.org Subject: Re: [RFC PATCH 02/11] kbuild: document some prerequisites Message-ID: References: <20240819160309.2218114-1-vegard.nossum@oracle.com> <20240819160309.2218114-3-vegard.nossum@oracle.com> Precedence: bulk X-Mailing-List: linux-hardening@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240819160309.2218114-3-vegard.nossum@oracle.com> X-UID: 186 X-Smtpcorp-Track: 0a7_vKaSAiD5.JBPDhvVjrgcK.fJSj7AbWlco Feedback-ID: 1174286m:1174286a9YXZ7r:1174286shYHl4XWV8 X-Report-Abuse: Please forward a copy of this message, including all headers, to On Mon, Aug 19, 2024 at 06:02:59PM +0200 Vegard Nossum wrote: > When running 'make --dry-run', make will invoke itself recursively for > recipes using $(MAKE), but otherwise not execute the other commands in > a recipe. > > However, if a prerequisite is missing and 'make' does not how to create it > (which will be the case when running 'make -n'), it will complain with an > error message like this: > > $ make -n > ... > make -f ./scripts/Makefile.modpost > make[1]: *** No rule to make target 'modules.order', needed by 'modules-only.symvers'. Stop. > make: *** [Makefile:1868: modpost] Error 2 > > In this case, the top-level makefile has reached a recipe that ran 'make' > recursively on scripts/Makefile.modpost, which itself has a rule with > modules.order as a prerequisite. Since the file doesn't exist, and make > doesn't know how to create it, it errors out. > > We can document such prerequisites (which are expected to be created by > the parent Makefile) by adding them to the PHONY list of each respective > Makefile. > > Signed-off-by: Vegard Nossum > --- > arch/x86/boot/compressed/Makefile | 6 ++++++ > scripts/Makefile.modfinal | 5 +++++ > scripts/Makefile.modpost | 4 ++++ > scripts/Makefile.vmlinux | 7 +++++++ > scripts/Makefile.vmlinux_o | 3 +++ > 5 files changed, 25 insertions(+) > > diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile > index f2051644de943..ccef6f0e04bc7 100644 > --- a/arch/x86/boot/compressed/Makefile > +++ b/arch/x86/boot/compressed/Makefile > @@ -80,6 +80,9 @@ quiet_cmd_voffset = VOFFSET $@ > > targets += ../voffset.h > > +# We don't know how to build this A comment for documentation is a good idea, but I think this one is not very helpful to those who don't know the patch description. What about something like this? # Provided by a recursive-make predecessor Kind regards Nicolas