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 4A723298CB2 for ; Thu, 28 May 2026 20:39:08 +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=1780000749; cv=none; b=gH8/rherdBhtyzVDIoAvQOrgUxSw5SBeMYR679s+gKKiDc5utSmVK9vmyJBEsBoqlXWfv56brsyG/QTcjaluoatL81OHpQqyl0Fuzn1QdutobVWCXy//zktqd+iTUv+cOrK2xXyDnv6p5WdVU/yhp8vSaW41c/nhd3fuOz3yKCI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000749; c=relaxed/simple; bh=VPtm4KyGA2rNPcyT372mZgGPQ6VKzDlSiQWaFrEG3/8=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=BFC/Ww91MzUTf9yrfZXI4gvTGzVfIwhlMe7jG7bgNDpY3EQnkc3HuVFnGkxOz3sVF3xnA03KdymBj3DQf9OXxOplkEsU78DGUtMaXS2j2EtgvvgDT+64eEc/P1FsiKlTZVktQAGUB3ykTgDxYbb1M10tcBoVRk+QIM+LxU6ys4I= 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=gxCz1E+N; 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="gxCz1E+N" Received: by mail-dl1-f74.google.com with SMTP id a92af1059eb24-1365060ac82so5511193c88.1 for ; Thu, 28 May 2026 13:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780000747; x=1780605547; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=oimbIklD2oW7RQ9Kb+qSzXj17yQYOv/MDfmOJ3+h/TE=; b=gxCz1E+NWVKqEOwW//9vZ90Derrizy/TvJqyDdacNbu8m1SsmKbcmRSOrslLMsdUme hU/UXaxrmYmv6VvulRkH/luT51zex166WfNFIQpOpTn4t9xoTxVudwuig64ROBMjVJO+ zXnITrpgWtFtraF2jSaoJfj9HIB59+NZrxofE5J2a2RoJhhYC7YIlVC7Ez97X6i7ZYss NWtR+2lXj4vKgi2V7g2JOdo1DHgIsg77MIBbwTaANqwe7PEKgXQbQy5fRX4aeVmvg4/v JnX3YwG8pm4J4qno9jJeoIykx15AACi4uHek23omUDtoneAvzbpoSVlnDkM1mlv+TaVj 7o3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780000747; x=1780605547; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=oimbIklD2oW7RQ9Kb+qSzXj17yQYOv/MDfmOJ3+h/TE=; b=G9lc7NFdKUE/l34NGOybMpGorMRH7FcBVMIdBcLKYiMOCieuAUStMKXgveXohbUEba WNH6mYODCWMsyAdXDqsx1vcZEIsAh8mTMgoKvaG4RrL1hi4ca9dlAeKL1u3z/tzcwcHx W6OyvL4ugla7Fh7WB+E0vXAjVc8Df3TU1tkGgIsdmHzYcA2Ce8hZuXMdbkxpvja4ckI6 wikI8Cj0GpFJ3zK4LhRcADs7F59oqU8N2lqlG7KMgZsRUHbYc6v7Clvzziam3KqxilAO 0kM39kTIwHyHapLg8CVr2t8D+VxlYyrjwP1MuBuFoGXE0qdFVvLD6PExrjDKPcmEHn6F ajlg== X-Gm-Message-State: AOJu0YwkXUpsJ2N6DIjt/cyZEyKFKAMKC0NFTkfH+uot59T80d7o2VQ2 E1l5DcdmJxkU2QUmgQp0efPs9fMCXPiZtUfokbKRYqAanZ9q9RD4m+g8eIPQclaJhkGemw== X-Received: from dlbvs1.prod.google.com ([2002:a05:7022:3f01:b0:135:1edf:c813]) (user=xur job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7022:250e:b0:12d:31cb:b806 with SMTP id a92af1059eb24-137ac20c3abmr88958c88.26.1780000747087; Thu, 28 May 2026 13:39:07 -0700 (PDT) Date: Thu, 28 May 2026 13:39:02 -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: <20260528203905.687687-1-xur@google.com> Subject: [PATCH v11 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: 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 | 41 +++++++++++++++++++ scripts/Makefile.vmlinux_a | 83 ++++++++++++++++++++++++++++++++++++++ scripts/mod/modpost.c | 15 +++++-- 7 files changed, 181 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