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 0B2D62C0F78; Mon, 16 Mar 2026 20:43:17 +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=1773693798; cv=none; b=bY4aOn11zGhAe0PbNjOGH5+wSouxrkQAB4glxCYq2UlsTfaVuFFphJwQ41Kce0RgJZq6G05qw3OTBwRfasXMFFLNnpgyoRk7gXMTuNc6ki8C92OWDV928FnatXut9/xq0S3tE8mrreCgLQDQHH5Ror07gUT6qgoGoOjwAQZgSJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773693798; c=relaxed/simple; bh=w/Uak5YC/dvbbLtjxRzj7m+BemNmjs0WEGwQX+esFvE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FJHaSN9L9DGfXJjeY2BJMfVeodplqSVMXgrUZ66EdYWKV39LmLpJos2P9ISTOuJtP4Yh0H8KEiSWsNtwe+GN8gCEskPyFhn8kyj+l6ACe1vAYN5vROOwilPfU/5WD2Ns4S+bGQNDmlzAi4Z2YZBjGU1JUCnP9GOupcFokakevZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HWOt1lhE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HWOt1lhE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96633C19421; Mon, 16 Mar 2026 20:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773693797; bh=w/Uak5YC/dvbbLtjxRzj7m+BemNmjs0WEGwQX+esFvE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HWOt1lhEt5eyxh1Es5LhRP2WRiuazbLby7QCgXKh2rzRH4IGt0dyGyP7ztv8ZB7xK tZR1Qjdj4YbRlhxsrxqUT2LP1tZMczqL30rv8IlDlz1/eGOYMxIW8ud10/InaIMGNz j/E9O+em1m0KASKQh5r/t3184FbTN1h1Bx2A8DJm7PV1/ZmTNiYAmnJHUMd7suKmS1 gjXDw4wQxfXKyVPz3JsEpgl/HdgSvG8IINfSLKEVRmzloGfPjnXTK2GauIjFuDG/w7 0kKfGjcGBsJXlx+InA8BAQrNNDBSOVn+iPAFUKQt2hjkOfemXbm2bGVFU9+piF9n5f mnM1oD0KhHvpA== Date: Mon, 16 Mar 2026 13:43:11 -0700 From: Nathan Chancellor To: Rong Xu Cc: Miguel Ojeda , Nicolas Schier , Masahiro Yamada , Nick Desaulniers , Bill Wendling , Justin Stitt , Miguel Ojeda , Thomas Gleixner , Alice Ryhl , Sami Tolvanen , "Mike Rapoport (Microsoft)" , Rafael Aquini , Michael Ellerman , Stafford Horne , Christophe Leroy , Piotr Gorski , Teresa Johnson , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, Arnd Bergmann Subject: Re: [PATCH v5 1/2] kbuild: move vmlinux.a build rule to scripts/Makefile.vmlinux_a Message-ID: <20260316204311.GA1329928@ax162> References: <20251028182822.3210436-1-xur@google.com> <20251028182822.3210436-2-xur@google.com> <20260316175953.GA1910339@ax162> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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