From: Nathan Chancellor <nathan@kernel.org>
To: Rong Xu <xur@google.com>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
Nicolas Schier <nsc@kernel.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Miguel Ojeda <ojeda@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Alice Ryhl <aliceryhl@google.com>,
Sami Tolvanen <samitolvanen@google.com>,
"Mike Rapoport (Microsoft)" <rppt@kernel.org>,
Rafael Aquini <aquini@redhat.com>,
Michael Ellerman <mpe@ellerman.id.au>,
Stafford Horne <shorne@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Piotr Gorski <piotrgorski@cachyos.org>,
Teresa Johnson <tejohnson@google.com>,
linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
llvm@lists.linux.dev, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v5 1/2] kbuild: move vmlinux.a build rule to scripts/Makefile.vmlinux_a
Date: Mon, 16 Mar 2026 13:43:11 -0700 [thread overview]
Message-ID: <20260316204311.GA1329928@ax162> (raw)
In-Reply-To: <CAF1bQ=TqFwmm9NhBPnxaoTCqHOsm1Q6MLhNcqpYq4uObZxzk3A@mail.gmail.com>
On Mon, Mar 16, 2026 at 11:16:41AM -0700, Rong Xu wrote:
> If that's the case, we can just remove flag "--thin". Can we verify if
> that works?
I think we can only remove it from the second llvm-ar invocation. I
tested
diff --git a/Makefile b/Makefile
index 2b15f0b4a0cb..fb001e02cc0f 100644
--- a/Makefile
+++ b/Makefile
@@ -1260,12 +1260,11 @@ ifdef CONFIG_TRIM_UNUSED_KSYMS
KBUILD_MODULES := y
endif
-# '$(AR) mPi' needs 'T' to workaround the bug of llvm-ar <= 14
quiet_cmd_ar_vmlinux.a = AR $@
cmd_ar_vmlinux.a = \
rm -f $@; \
$(AR) cDPrST $@ $(KBUILD_VMLINUX_OBJS); \
- $(AR) mPiT $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt)
+ $(AR) mPi $$($(AR) t $@ | sed -n 1p) $@ $$($(AR) t $@ | grep -F -f $(srctree)/scripts/head-object-list.txt)
targets += vmlinux.a
vmlinux.a: $(KBUILD_VMLINUX_OBJS) scripts/head-object-list.txt FORCE
--
on 7.0-rc4, which showed no issues. This is basically a revert of my
suggested workaround for the original issue:
https://lore.kernel.org/YyjjT5gQ2hGMH0ni@dev-arch.thelio-3990X/
You could add this as a prerequisite patch, I don't think it should be
squashed into the move change, especially since that appears to be why
we are in this situation. Why are we converting from the 'T' modifier to
'--thin' in the move patch? I know the documentation of llvm-ar and GNU
ar says that 'T' is deprecated in favor of '--thin' because it may do
different things on various ar implementations but the kernel only
supports these two implementations. I think we should just copy the
commands as they are and address the deprecation separately, perhaps
with an ar-option like Nicolas suggested upthread.
How about a v3 that looks like:
Patch 1: The diff above because all supported llvm-ar versions do the
same thing as GNU ar.
Patch 2: The move patch without changing 'T' into '--thin'.
Patch 3: The same as before, perhaps without '--thin' as well.
You'll need to base on kbuild-next-unstable [1] to address the conflict
with Yonghong's "kbuild: Reduce the number of compiler-generated
suffixes for clang thin-lto build" [2].
[1]: https://git.kernel.org/kbuild/l/kbuild-next-unstable
[2]: https://lore.kernel.org/20260307050250.3767489-1-yonghong.song@linux.dev/
Cheers,
Nathan
next prev parent reply other threads:[~2026-03-16 20:43 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 18:28 [PATCH v5 0/2] kbuild: distributed build support for Clang ThinLTO xur
2025-10-28 18:28 ` [PATCH v5 1/2] kbuild: move vmlinux.a build rule to scripts/Makefile.vmlinux_a xur
2026-03-16 13:33 ` Nicolas Schier
2026-03-16 13:59 ` Miguel Ojeda
2026-03-16 17:27 ` Rong Xu
2026-03-16 17:52 ` Nicolas Schier
2026-03-16 17:59 ` Nathan Chancellor
2026-03-16 18:16 ` Rong Xu
2026-03-16 20:43 ` Nathan Chancellor [this message]
2026-03-16 20:53 ` Rong Xu
2026-03-16 21:31 ` Rong Xu
2025-10-28 18:28 ` [PATCH v5 2/2] kbuild: distributed build support for Clang ThinLTO xur
2025-10-28 19:22 ` [PATCH v5 0/2] " Piotr Gorski
2025-12-04 17:49 ` Nathan Chancellor
2025-12-04 18:36 ` Rong Xu
2026-03-12 8:25 ` Nathan Chancellor
2026-03-12 11:45 ` Nicolas Schier
2026-03-12 17:50 ` Rong Xu
2026-03-13 14:50 ` Nicolas Schier
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=20260316204311.GA1329928@ax162 \
--to=nathan@kernel.org \
--cc=aliceryhl@google.com \
--cc=aquini@redhat.com \
--cc=arnd@arndb.de \
--cc=christophe.leroy@csgroup.eu \
--cc=justinstitt@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=masahiroy@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=morbo@google.com \
--cc=mpe@ellerman.id.au \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=piotrgorski@cachyos.org \
--cc=rppt@kernel.org \
--cc=samitolvanen@google.com \
--cc=shorne@gmail.com \
--cc=tejohnson@google.com \
--cc=tglx@linutronix.de \
--cc=xur@google.com \
/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