From: Ingo Molnar <mingo@kernel.org>
To: Ard Biesheuvel <ardb+git@google.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
linux-kbuild@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>
Subject: Re: [RFC PATCH 0/4] x86/build: Get rid of vmlinux postlink step
Date: Mon, 24 Feb 2025 19:51:35 +0100 [thread overview]
Message-ID: <Z7y_i-ySL68BfkgQ@gmail.com> (raw)
In-Reply-To: <20250224132132.1765115-6-ardb+git@google.com>
* Ard Biesheuvel <ardb+git@google.com> wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
>
> Kbuild supports an architecture specific Makefile.postlink file that is
> invoked for the vmlinux target after it has been built. This Makefile
> takes 'vmlinux' (which has just been built) as the target, and mangles
> the file and/or constructs other intermediate artifacts from it.
>
> This violates the general philosophy of Make, which is based on rules
> and dependencies, and artifacts that are rebuilt only when any of their
> dependencies have been updated.
>
> Instead, the different incarnations of vmlinux that are consumed by
> different stages of the build should be emitted as distinct files, where
> rules and dependencies are used to define one in terms of the other.
>
> This also works around an error observed here [0], where vmlinux is
> deleted by Make because a subsequent step that consumes it as input
> throws an error.
>
> So refactor the vmlinux shell scripts and build rules so that
> architectures that rely on --emit-relocs to construct vmlinux with
> static relocations preserved will get a separate vmlinux.unstripped file
> carrying those relocations. This removes the need for an imperative
> postlink step, given that any rules that depend on the unstripped
> vmlinux can now simply depend on vmlinux.unstripped, rather than inject
> a build step into Makefile.postlink
Nice! Does this also result in any measurable speedup of the build, or
are the steps still similar?
But in terms of justification for upstreaming, the reduction in
complexity alone makes it worth it IMO:
19 files changed, 52 insertions(+), 87 deletions(-)
Thanks,
Ingo
next prev parent reply other threads:[~2025-02-24 18:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-24 13:21 [RFC PATCH 0/4] x86/build: Get rid of vmlinux postlink step Ard Biesheuvel
2025-02-24 13:21 ` [RFC PATCH 1/4] Kbuild/link-vmlinux.sh: Make output file name configurable Ard Biesheuvel
2025-02-24 13:21 ` [RFC PATCH 2/4] Kbuild: Introduce Kconfig symbol for linking vmlinux with relocations Ard Biesheuvel
2025-03-07 18:58 ` Masahiro Yamada
2025-02-24 13:21 ` [RFC PATCH 3/4] Kbuild: Create intermediate vmlinux build with relocations preserved Ard Biesheuvel
2025-03-07 19:04 ` Masahiro Yamada
2025-02-24 13:21 ` [RFC PATCH 4/4] x86: Get rid of Makefile.postlink Ard Biesheuvel
2025-02-24 18:51 ` Ingo Molnar [this message]
2025-02-24 19:59 ` [RFC PATCH 0/4] x86/build: Get rid of vmlinux postlink step Linus Torvalds
2025-02-24 21:25 ` Ard Biesheuvel
2025-02-24 21:28 ` Ard Biesheuvel
2025-03-06 16:47 ` Ard Biesheuvel
2025-03-07 18:54 ` Masahiro Yamada
2025-03-08 10:49 ` Ard Biesheuvel
2025-03-08 16:17 ` Masahiro Yamada
2025-03-08 22:42 ` Ard Biesheuvel
2025-03-09 9:48 ` Ingo Molnar
2025-03-11 2:38 ` Masahiro Yamada
2025-03-11 6:40 ` Ard Biesheuvel
2025-03-11 9:52 ` Masahiro Yamada
2025-03-11 16:00 ` Petr Pavlu
2025-03-13 10:31 ` Masahiro Yamada
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=Z7y_i-ySL68BfkgQ@gmail.com \
--to=mingo@kernel.org \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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