From: Arnd Bergmann <arnd@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Arnd Bergmann <arnd@arndb.de>
Cc: linux-kbuild@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nicolas@fjasle.eu>,
linux-kernel@vger.kernel.org
Subject: [PATCH] kbuild: mark "FORCE" target as secondary
Date: Wed, 17 Jul 2024 14:42:44 +0200 [thread overview]
Message-ID: <20240717124253.2275084-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
Starting with make-4.4.1, Kbuild uses the special .NOTINTERMEDIATE
target to mark all targets as not intermediate, which slightly changes
the behavior compared to older versions of make.
This causes a build regression with my change to the system call table
scripts now in scripts/Makefile.asm-headers, forcing a rebuild of the
generated files with every make invocation and effectively breaking
incremental builds.
I have narrowed down the change in behavior to the way that the
'FORCE' target is treated: If this is marked as not intermediate,
the $(if_changed) macro always evaluates it as a missing prerequisite,
but if it is marked as .SECONDARY, it works like before.
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org
Fixes: 875ef1a57f32 ("kbuild: use .NOTINTERMEDIATE for future GNU Make versions")
Fixes: fbb5c0606fa4 ("kbuild: add syscall table generation to scripts/Makefile.asm-headers")
Closes: https://lore.kernel.org/lkml/91b10591-1554-4860-8843-01c6cfd7de13@app.fastmail.com/T/#m4c979c42d0c086f616e41b4ca76f2873902b8a25
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
----
I'm still a bit confused by the way this works in detail, hopefully
Masahiro Yamada can either confirm that this is a correct fix or provide
a better one.
---
scripts/Kbuild.include | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index faf37bafa3f8..aa1ffaeb8fc0 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -267,6 +267,7 @@ endif
# deleted files.
ifneq ($(and $(filter notintermediate, $(.FEATURES)),$(filter-out 4.4,$(MAKE_VERSION))),)
.NOTINTERMEDIATE:
+.SECONDARY: FORCE
else
.SECONDARY:
endif
--
2.39.2
next reply other threads:[~2024-07-17 12:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 12:42 Arnd Bergmann [this message]
2024-07-17 15:18 ` [PATCH] kbuild: mark "FORCE" target as secondary Masahiro Yamada
2024-07-17 16:24 ` Arnd Bergmann
2024-07-17 16:45 ` Masahiro Yamada
2024-07-17 18:50 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240717124253.2275084-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox