From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f74.google.com (mail-dl1-f74.google.com [74.125.82.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 059303AA51F for ; Fri, 29 May 2026 18:53:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780080834; cv=none; b=DEutxZfcnZ0kV9/Ll18AI7gedn8skdtVdXCr2lUfqQL8lmheB/mPpqlwItHAyGHACUN/nZgnTxmyg7rIz5fvZVzeyxbf2nawzm3ZZzDTTYcScRFovX6AvXym79PqPgexbM3sE/4Fx9eSKG0Ey7S5VBenMKSEjqjiAaAqFDXcCNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780080834; c=relaxed/simple; bh=/lNacLdW9sEOoTS/HBDmtkyIRf4qRh3MXKPb+7r4ATI=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=rN243I8t+Fu68kc85VOec6g6Gmq3IuLHNuwroQBWD6xRx8UrLQB2G5IfOVpjIob1gvO1JesgSafwOQ91IatbBwQuouOHL0ADAu5Z4IhNh3dz5Dy3NrbCBiDLZR+Xa+ZSVxwvVUgqIgnrzBWvDPQXZZMYly1aTpMCQ5TCyRW1OC8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--xur.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=qx3CuErx; arc=none smtp.client-ip=74.125.82.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--xur.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qx3CuErx" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-13709ab38a8so6949165c88.0 for ; Fri, 29 May 2026 11:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780080830; x=1780685630; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=81SwLsYV+fPUwbYdTwTcJ7io6v2ZR/O+UY0W6GoVbVk=; b=qx3CuErx9L9OsiXJ8CZc3sHsPyqI7CFMtdxuk5M213/1WzNXPY+6w8kDe36L5B7ieY fjsemuHDmKijqq1a48tOcz/OCNbEXVUPQ1/Nqi9VSsRLVRqfJWFMQDuUllqfwzMeg9sX e2MeDTCb6v0B734vWYQTOKFIqcTNg3DrfmgLkaF50UgUHmvOxVsUfF42ySVAIoTW0HSJ uNuK7fRiZFNDbwld+HBqcSA4eEkAHkIwCT9Y42Rolur5btKJe3ZtsaR928B8kyWWSirE wrHFWu5g++SxEwTHhfsLlol+H6BpveDVAUh6nmJKvTQfJp+DlAFCBLR/AUwcaP4tKi0j /33g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780080830; x=1780685630; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=81SwLsYV+fPUwbYdTwTcJ7io6v2ZR/O+UY0W6GoVbVk=; b=PZbIP41O9/p7ciRuyTsuUH03kfS2f5ZaNhGeXeKoaE02IzhsO12WJZrnFJ0hb2NYoW Bc7DOFzGQ6NyhQjQhD8rDhLPvaFbzWQi12FW0NvlVQMbmkSBubFe0PB7TU4r42tFFDvN Nyb7OsfW0iqa6VxVMG5YhN6qB3157sxdxjoB8Hm9wFoBPjhC3bQ+AJmvPquyg1klsDxI jkqDdyez3QSmOQ9oX9v5VmTcyoiScpAJrMWv5+o9rpRl5DWCn6KTN8Y7IC8iWV16ex5A nhSFZAkNSINWVk8RlAwgUmECNRcHh549GuVuTlj53/nCNR16dAYSr2S2a+pgFRn/OHJB gG0A== X-Gm-Message-State: AOJu0YyFVgzx4DoL1ZeSHGafTIdOgsaKMU26lm1Q4fOEXY7zuw4YqflE eIYI0BGKzbAwyOl/xbm3ufIXUfJP6mWAYj73BumFh36e3QuKjWf66C2sYdwevSxjhzXEIA== X-Received: from dlbcf5.prod.google.com ([2002:a05:7022:4585:b0:136:8b77:210a]) (user=xur job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:f96:b0:136:5c88:d928 with SMTP id a92af1059eb24-137d426d0e5mr388314c88.19.1780080829713; Fri, 29 May 2026 11:53:49 -0700 (PDT) Date: Fri, 29 May 2026 11:53:43 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.54.0.823.g6e5bcc1fc9-goog Message-ID: <20260529185347.2418373-1-xur@google.com> Subject: [PATCH v12 0/3] kbuild: distributed build support for Clang ThinLTO From: xur@google.com To: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Yonghong Song , 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 , Rong Xu , Venkat Rao Bagalkote , Miguel Ojeda , Teresa Johnson Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" From: Rong Xu ChangeLog: V12: Fixed an build error reported by Nathan Chancellor: Reverted to v10 shell script based approach to get saved_c_flags. V11: Integrated feedback from Sashiko (Nathan Chancellor): (1) Included modkern_cflags within the saved _c_flags. (2) Replaced the shell command with $(saved_c_flags_$(<)). (3) Refined the file matching for ar_vmlinux.a. V10: Fixed a minor build error in v9 and added comments. V9: Fixed a minor build error. V8: Disabled -always-rename-promoted-locals=false for the distrubute mode, based on Yonghong and Nathan's comments. V7: (1) Resolved a conflict by rebasing to kbuild/kbuild-next-unstable. (2) Separated the '--thin' to 'T' change into its own patch to preserve Masahiro's original version. V6: Change '--thin' back to 'T' in Makefile.vmlinux_a to fix reported the build error from old ar. V5: Handle single quote escaping in echo _c_flags to fix Piotr Gorski's reported error. V4: This is based on the reimplementation provided by Masahiro Yamada on May 26. The difference is that this version now saves the compiler flags (_c_flags) from the Front-End (FE) compilation and re-uses them for the subsequent Back-End (BE) compilation. Rong Xu (3): kbuild: move vmlinux.a build rule to scripts/Makefile.vmlinux_a kbuild: change --thin back to 'T' in $(AR) kbuild: distributed build support for Clang ThinLTO .gitignore | 2 + Makefile | 30 +++++++------- arch/Kconfig | 19 +++++++++ scripts/Makefile.lib | 8 ++++ scripts/Makefile.thinlto | 40 ++++++++++++++++++ scripts/Makefile.vmlinux_a | 83 ++++++++++++++++++++++++++++++++++++++ scripts/mod/modpost.c | 15 +++++-- 7 files changed, 180 insertions(+), 17 deletions(-) create mode 100644 scripts/Makefile.thinlto create mode 100644 scripts/Makefile.vmlinux_a base-commit: 2c31897a17e55a6da529b4e797e98c6febc60fd2 -- 2.54.0.823.g6e5bcc1fc9-goog