mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
9c1b86f8ce
Patch series "Bump the minimum supported version of LLVM to 13.0.1".
This series bumps the minimum supported version of LLVM for building the
kernel to 13.0.1. The first patch does the bump and all subsequent
patches clean up all the various workarounds and checks for earlier
versions.
Quoting the first patch's commit message for those that were only on CC
for the clean ups:
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.
This passes my build matrix with all supported versions.
This is based on Andrew's mm-nonmm-unstable to avoid trivial conflicts
with my series to update the LLVM links across the repository [1] but I
can easily rebase it to linux-kbuild if Masahiro would rather these
patches go through there (and defer the conflict resolution to the merge
window).
[1]: https://lore.kernel.org/20240109-update-llvm-links-v1-0-eb09b59db071@kernel.org/
This patch (of 11):
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.
Link: https://lkml.kernel.org/r/20240125-bump-min-llvm-ver-to-13-0-1-v1-0-f5ff9bda41c5@kernel.org
Closes: https://github.com/ClangBuiltLinux/linux/issues/1975
Link: https://github.com/llvm/llvm-project/issues/38013
Link:
|
||
---|---|---|
.. | ||
atomic | ||
basic | ||
clang-tools | ||
coccinelle | ||
dtc | ||
dummy-tools | ||
gcc-plugins | ||
gdb | ||
genksyms | ||
kconfig | ||
ksymoops | ||
mod | ||
package | ||
selinux | ||
tracing | ||
.gitignore | ||
as-version.sh | ||
asn1_compiler.c | ||
bloat-o-meter | ||
bootgraph.pl | ||
bpf_doc.py | ||
cc-can-link.sh | ||
cc-version.sh | ||
check_extable.sh | ||
check-git | ||
check-sysctl-docs | ||
check-uapi.sh | ||
checkdeclares.pl | ||
checkincludes.pl | ||
checkkconfigsymbols.py | ||
checkpatch.pl | ||
checkstack.pl | ||
checksyscalls.sh | ||
checkversion.pl | ||
cleanfile | ||
cleanpatch | ||
coccicheck | ||
config | ||
const_structs.checkpatch | ||
decode_stacktrace.sh | ||
decodecode | ||
depmod.sh | ||
dev-needs.sh | ||
diffconfig | ||
documentation-file-ref-check | ||
export_report.pl | ||
extract_xc3028.pl | ||
extract-ikconfig | ||
extract-module-sig.pl | ||
extract-sys-certs.pl | ||
extract-vmlinux | ||
faddr2line | ||
file-size.sh | ||
find-unused-docs.sh | ||
gcc-x86_32-has-stack-protector.sh | ||
gcc-x86_64-has-stack-protector.sh | ||
gen-randstruct-seed.sh | ||
generate_initcall_order.pl | ||
generate_rust_analyzer.py | ||
generate_rust_target.rs | ||
get_abi.pl | ||
get_dvb_firmware | ||
get_feat.pl | ||
get_maintainer.pl | ||
gfp-translate | ||
git.orderFile | ||
head-object-list.txt | ||
headerdep.pl | ||
headers_install.sh | ||
insert-sys-cert.c | ||
install.sh | ||
jobserver-exec | ||
kallsyms.c | ||
Kbuild.include | ||
Kconfig.include | ||
kernel-doc | ||
ld-version.sh | ||
leaking_addresses.pl | ||
Lindent | ||
link-vmlinux.sh | ||
Makefile | ||
Makefile.asm-generic | ||
Makefile.btf | ||
Makefile.build | ||
Makefile.clang | ||
Makefile.clean | ||
Makefile.compiler | ||
Makefile.debug | ||
Makefile.defconf | ||
Makefile.dtbinst | ||
Makefile.extrawarn | ||
Makefile.gcc-plugins | ||
Makefile.headersinst | ||
Makefile.host | ||
Makefile.kasan | ||
Makefile.kcov | ||
Makefile.kcsan | ||
Makefile.kmsan | ||
Makefile.lib | ||
Makefile.modfinal | ||
Makefile.modinst | ||
Makefile.modpost | ||
Makefile.package | ||
Makefile.randstruct | ||
Makefile.ubsan | ||
Makefile.userprogs | ||
Makefile.vdsoinst | ||
Makefile.vmlinux | ||
Makefile.vmlinux_o | ||
makelst | ||
markup_oops.pl | ||
min-tool-version.sh | ||
misc-check | ||
mkcompile_h | ||
mksysmap | ||
mkuboot.sh | ||
module.lds.S | ||
modules-check.sh | ||
nsdeps | ||
objdiff | ||
objdump-func | ||
orc_hash.sh | ||
pahole-version.sh | ||
parse-maintainers.pl | ||
patch-kernel | ||
profile2linkerlist.pl | ||
prune-kernel | ||
recordmcount.c | ||
recordmcount.h | ||
recordmcount.pl | ||
relocs_check.sh | ||
remove-stale-files | ||
rust_is_available_bindgen_libclang.h | ||
rust_is_available_test.py | ||
rust_is_available.sh | ||
rustdoc_test_builder.rs | ||
rustdoc_test_gen.rs | ||
setlocalversion | ||
show_delta | ||
sign-file.c | ||
sorttable.c | ||
sorttable.h | ||
spdxcheck-test.sh | ||
spdxcheck.py | ||
spdxexclude | ||
spelling.txt | ||
sphinx-pre-install | ||
split-man.pl | ||
stackdelta | ||
stackusage | ||
subarch.include | ||
syscallhdr.sh | ||
syscallnr.sh | ||
syscalltbl.sh | ||
tags.sh | ||
test_fortify.sh | ||
tools-support-relr.sh | ||
unifdef.c | ||
ver_linux | ||
xen-hypercalls.sh | ||
xz_wrap.sh |