All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: akpm@linux-foundation.org, masahiroy@kernel.org
Cc: nicolas@fjasle.eu, linux-kbuild@vger.kernel.org,
	llvm@lists.linux.dev,  patches@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	 Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH 01/11] kbuild: Raise the minimum supported version of LLVM to 13.0.1
Date: Thu, 25 Jan 2024 15:55:07 -0700	[thread overview]
Message-ID: <20240125-bump-min-llvm-ver-to-13-0-1-v1-1-f5ff9bda41c5@kernel.org> (raw)
In-Reply-To: <20240125-bump-min-llvm-ver-to-13-0-1-v1-0-f5ff9bda41c5@kernel.org>

When __builtin_mul_overflow() has arguments that differ in terms of
signedness and width, LLVM may generate a libcall to __muloti4 because
it performs the checks in terms of 65-bit multiplication. This issue
becomes harder to hit (but still possible) after LLVM 12.0.0, which
includes a special case for matching widths but different signs.

To gain access to this special case, which the kernel can take advantage
of when calls to __muloti4 appear, bump the minimum supported version of
LLVM for building the kernel to 13.0.1. 13.0.1 was chosen because there
is minimal impact to distribution support while allowing a few more
workarounds to be dropped in the kernel source than if 12.0.0 were
chosen. Looking at container images of up to date distribution versions:

  archlinux:latest              clang version 16.0.6
  debian:oldoldstable-slim      clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
  debian:oldstable-slim         Debian clang version 11.0.1-2
  debian:stable-slim            Debian clang version 14.0.6
  debian:testing-slim           Debian clang version 16.0.6 (19)
  debian:unstable-slim          Debian clang version 16.0.6 (19)
  fedora:38                     clang version 16.0.6 (Fedora 16.0.6-3.fc38)
  fedora:latest                 clang version 17.0.6 (Fedora 17.0.6-1.fc39)
  fedora:rawhide                clang version 17.0.6 (Fedora 17.0.6-1.fc40)
  opensuse/leap:latest          clang version 15.0.7
  opensuse/tumbleweed:latest    clang version 17.0.6
  ubuntu:focal                  clang version 10.0.0-4ubuntu1
  ubuntu:latest                 Ubuntu clang version 14.0.0-1ubuntu1.1
  ubuntu:rolling                Ubuntu clang version 16.0.6 (15)
  ubuntu:devel                  Ubuntu clang version 17.0.6 (3)

The only distribution that gets left behind is Debian Bullseye, as the
default version is 11.0.1; other distributions either have a newer
version than 13.0.1 or one older than the current minimum of 11.0.0.
Debian has easy access to more recent LLVM versions through
apt.llvm.org, so this is not as much of a concern. There are also the
kernel.org LLVM toolchains, which should work with distributions with
glibc 2.28 and newer.

Another benefit of slimming up the number of supported versions of LLVM
for building the kernel is reducing the build capacity needed to support
a matrix that builds with each supported version, which allows a matrix
to reallocate the freed up build capacity towards something else, such
as more configuration combinations.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1975
Link: https://github.com/llvm/llvm-project/issues/38013
Link: https://github.com/llvm/llvm-project/commit/3203143f1356a4e4e3ada231156fc6da6e1a9f9d
Link: https://mirrors.edge.kernel.org/pub/tools/llvm/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 Documentation/process/changes.rst | 2 +-
 scripts/min-tool-version.sh       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst
index 50b3d1cb1115..d7306b8cad13 100644
--- a/Documentation/process/changes.rst
+++ b/Documentation/process/changes.rst
@@ -30,7 +30,7 @@ you probably needn't concern yourself with pcmciautils.
         Program        Minimal version       Command to check the version
 ====================== ===============  ========================================
 GNU C                  5.1              gcc --version
-Clang/LLVM (optional)  11.0.0           clang --version
+Clang/LLVM (optional)  13.0.1           clang --version
 Rust (optional)        1.74.1           rustc --version
 bindgen (optional)     0.65.1           bindgen --version
 GNU make               3.82             make --version
diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh
index 9faa4d3d91e3..5d17022ee1f6 100755
--- a/scripts/min-tool-version.sh
+++ b/scripts/min-tool-version.sh
@@ -29,7 +29,7 @@ llvm)
 	elif [ "$SRCARCH" = loongarch ]; then
 		echo 18.0.0
 	else
-		echo 11.0.0
+		echo 13.0.1
 	fi
 	;;
 rustc)

-- 
2.43.0


  reply	other threads:[~2024-01-25 22:56 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-25 22:55 [PATCH 00/11] Bump the minimum supported version of LLVM to 13.0.1 Nathan Chancellor
2024-01-25 22:55 ` Nathan Chancellor
2024-01-25 22:55 ` Nathan Chancellor
2024-01-25 22:55 ` Nathan Chancellor
2024-01-25 22:55 ` Nathan Chancellor [this message]
2024-01-25 22:55 ` [PATCH 02/11] Makefile: Drop warn-stack-size plugin opt Nathan Chancellor
2024-01-25 22:55 ` [PATCH 03/11] x86: Drop stack-alignment " Nathan Chancellor
2024-01-25 22:55 ` [PATCH 04/11] ARM: Remove Thumb2 __builtin_thread_pointer workaround for Clang Nathan Chancellor
2024-01-25 22:55   ` Nathan Chancellor
2024-01-26  8:44   ` Ard Biesheuvel
2024-01-26  8:44     ` Ard Biesheuvel
2024-01-25 22:55 ` [PATCH 05/11] arm64: Kconfig: Clean up tautological LLVM version checks Nathan Chancellor
2024-01-25 22:55   ` Nathan Chancellor
2024-01-26 12:59   ` Mark Rutland
2024-01-26 12:59     ` Mark Rutland
2024-01-26 16:10     ` Nathan Chancellor
2024-01-26 16:10       ` Nathan Chancellor
2024-01-26 17:00       ` Mark Rutland
2024-01-26 17:00         ` Mark Rutland
2024-01-25 22:55 ` [PATCH 06/11] powerpc: Kconfig: Remove tautology in CONFIG_COMPAT Nathan Chancellor
2024-01-25 22:55   ` Nathan Chancellor
2024-01-25 22:55 ` [PATCH 07/11] riscv: Remove MCOUNT_NAME workaround Nathan Chancellor
2024-01-25 22:55   ` Nathan Chancellor
2024-01-25 22:55 ` [PATCH 08/11] riscv: Kconfig: Remove version dependency from CONFIG_CLANG_SUPPORTS_DYNAMIC_FTRACE Nathan Chancellor
2024-01-25 22:55   ` Nathan Chancellor
2024-01-25 22:55 ` [PATCH 09/11] fortify: Drop Clang version check for 12.0.1 or newer Nathan Chancellor
2024-01-25 23:09   ` Kees Cook
2024-01-25 22:55 ` [PATCH 10/11] lib/Kconfig.debug: Update Clang version check in CONFIG_KCOV Nathan Chancellor
2024-01-25 22:55 ` [PATCH 11/11] compiler-clang.h: Update __diag_clang() macros for minimum version bump Nathan Chancellor
2024-01-25 23:10 ` [PATCH 00/11] Bump the minimum supported version of LLVM to 13.0.1 Kees Cook
2024-01-25 23:10   ` Kees Cook
2024-01-25 23:10   ` Kees Cook
2024-01-25 23:10   ` Kees Cook
2024-03-25  4:42 ` patchwork-bot+linux-riscv
2024-03-25  4:42   ` patchwork-bot+linux-riscv
2024-03-25  4:42   ` patchwork-bot+linux-riscv
2024-03-25  4:42   ` patchwork-bot+linux-riscv

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=20240125-bump-min-llvm-ver-to-13-0-1-v1-1-f5ff9bda41c5@kernel.org \
    --to=nathan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=nicolas@fjasle.eu \
    --cc=patches@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.