Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM 20 #22780

Merged
merged 37 commits into from
Apr 5, 2025
Merged

LLVM 20 #22780

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
50cb2fa
ci: Stop triggering the workflow for llvm branches.
alexrp Feb 5, 2025
c712f18
build: Update to LLVM/Clang 20.
alexrp Feb 5, 2025
0181cfe
zig cc: Update driver files to Clang 20.
alexrp Feb 5, 2025
ce75472
zig cc: Update intrinsic headers to Clang 20.
alexrp Feb 5, 2025
a89b343
libunwind: Update to LLVM 20.
alexrp Feb 5, 2025
7ab01c9
libcxxabi: Update to Clang 20.
alexrp Feb 5, 2025
156ab87
libcxx: Update to Clang 20.
alexrp Feb 5, 2025
8ea2e1d
compiler: Updates for LLVM/Clang 20 API changes.
alexrp Feb 5, 2025
4de368a
std.Target: Update CPU models/features for LLVM 20.
alexrp Feb 5, 2025
eefb334
std.Target: Bump baseline bpfel/bpfeb model to v3.
alexrp Mar 18, 2025
1599f8a
std.Target: Bump baseline hexagon model to hexagonv68.
alexrp Mar 10, 2025
8954e97
std.Target: Add Abi.muslf32 and Abi.muslsf.
alexrp Mar 10, 2025
d67d52a
zig cc: Update options data to Clang 20.
alexrp Feb 5, 2025
e99c118
libtsan: Update to LLVM 20.
alexrp Feb 5, 2025
3d1cfdb
llvm: Set target-abi module flag.
alexrp Feb 12, 2025
4c5c5bc
llvm: Fix i128 alignment for various targets.
alexrp Mar 5, 2025
cf9c6f5
compiler: Update max int alignments for some targets.
alexrp Mar 5, 2025
8583053
llvm: Update the list of targets that use native f16/f128.
alexrp Mar 10, 2025
82b9d9c
compiler-rt: Fix names of some float/int conversion routines for hexa…
alexrp Mar 5, 2025
7415739
Sema: Prevent tail calls of std.builtin.returnError().
alexrp Mar 6, 2025
166766d
llvm: never_tail implies never_inline, so set noinline in this case too.
alexrp Mar 6, 2025
9a59cff
llvm: Allow FastISel on mips again.
alexrp Mar 10, 2025
7109e46
llvm: Use muslabin32/muslabi64 environments in the target triple.
alexrp Mar 10, 2025
b9456d6
test: mips32 is no longer a slow target with LLVM 20.
alexrp Mar 9, 2025
96fe4fb
Revert "test: Partially disable `vector float operators` on mips."
alexrp Mar 10, 2025
3310307
std: Disable `link with relative paths` and `linkat with different di…
alexrp Mar 9, 2025
0d6f3aa
llvm: Remove workaround for zero-length memset/memcpy on wasm.
alexrp Mar 10, 2025
6667e0f
Revert "glibc: Patch to work around missing features in LLVM's s390x …
alexrp Mar 10, 2025
2846963
zig cc: Avoid passing any "CPU" features related to float ABI to Clang.
alexrp Mar 10, 2025
9e4199d
Compilation: Remove the PowerPC soft float preprocessor workaround.
alexrp Mar 10, 2025
15a05fc
Revert "compiler: Don't consider powerpc to have red zone support yet."
alexrp Mar 10, 2025
7c5412c
build: Rename -Dtest-slow-targets to -Dtest-extra-targets.
alexrp Mar 21, 2025
c3e88a2
compiler: Recognize -fno-sanitize=<...> in addition to -fsanitize=<...>.
alexrp Apr 3, 2025
957a5ae
cmake: Pass -fno-sanitize=undefined when building zig2.
alexrp Apr 3, 2025
4b360a1
ci: Update tarballs to 0.15.0-dev.203+53270f008.
alexrp Apr 3, 2025
7c85dc4
test: Disable `error union switch with call operand` (ReleaseSafe) on…
alexrp Apr 3, 2025
cefe65c
ci: update tarballs to 0.15.0-dev.203+53270f008
andrewrk Apr 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- llvm19
concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ else()
set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")
endif()

find_package(llvm 19)
find_package(clang 19)
find_package(lld 19)
find_package(llvm 20)
find_package(clang 20)
find_package(lld 20)

if(ZIG_STATIC_ZLIB)
if (MSVC)
Expand Down Expand Up @@ -809,7 +809,7 @@ if(MSVC)
else()
set(ZIG_WASM2C_COMPILE_FLAGS "-std=c99 -O2")
set(ZIG1_COMPILE_FLAGS "-std=c99 -Os")
set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-stack-protector")
set(ZIG2_COMPILE_FLAGS "-std=c99 -O0 -fno-sanitize=undefined -fno-stack-protector")
if(APPLE)
set(ZIG2_LINK_FLAGS "-Wl,-stack_size,0x10000000")
elseif(MINGW)
Expand Down
24 changes: 15 additions & 9 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ pub fn build(b: *std.Build) !void {

const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};
const test_target_filters = b.option([]const []const u8, "test-target-filter", "Skip tests whose target triple do not match any filter") orelse &[0][]const u8{};
const test_slow_targets = b.option(bool, "test-slow-targets", "Enable running module tests for targets that have a slow compiler backend") orelse false;
const test_extra_targets = b.option(bool, "test-extra-targets", "Enable running module tests for additional targets") orelse false;

var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined;
var chosen_mode_index: usize = 0;
Expand Down Expand Up @@ -433,7 +433,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
.test_slow_targets = test_slow_targets,
.test_extra_targets = test_extra_targets,
.root_src = "test/behavior.zig",
.name = "behavior",
.desc = "Run the behavior tests",
Expand All @@ -449,7 +449,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
.test_slow_targets = test_slow_targets,
.test_extra_targets = test_extra_targets,
.root_src = "test/c_import.zig",
.name = "c-import",
.desc = "Run the @cImport tests",
Expand All @@ -464,7 +464,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
.test_slow_targets = test_slow_targets,
.test_extra_targets = test_extra_targets,
.root_src = "lib/compiler_rt.zig",
.name = "compiler-rt",
.desc = "Run the compiler_rt tests",
Expand All @@ -480,7 +480,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
.test_slow_targets = test_slow_targets,
.test_extra_targets = test_extra_targets,
.root_src = "lib/c.zig",
.name = "universal-libc",
.desc = "Run the universal libc tests",
Expand All @@ -496,7 +496,7 @@ pub fn build(b: *std.Build) !void {
test_modules_step.dependOn(tests.addModuleTests(b, .{
.test_filters = test_filters,
.test_target_filters = test_target_filters,
.test_slow_targets = test_slow_targets,
.test_extra_targets = test_extra_targets,
.root_src = "lib/std/std.zig",
.name = "std",
.desc = "Run the standard library tests",
Expand Down Expand Up @@ -1166,10 +1166,10 @@ const llvm_libs = [_][]const u8{
"LLVMXRay",
"LLVMLibDriver",
"LLVMDlltoolDriver",
"LLVMTelemetry",
"LLVMTextAPIBinaryReader",
"LLVMCoverage",
"LLVMLineEditor",
"LLVMSandboxIR",
"LLVMXCoreDisassembler",
"LLVMXCoreCodeGen",
"LLVMXCoreDesc",
Expand All @@ -1196,6 +1196,10 @@ const llvm_libs = [_][]const u8{
"LLVMSystemZCodeGen",
"LLVMSystemZDesc",
"LLVMSystemZInfo",
"LLVMSPIRVCodeGen",
"LLVMSPIRVDesc",
"LLVMSPIRVInfo",
"LLVMSPIRVAnalysis",
"LLVMSparcDisassembler",
"LLVMSparcAsmParser",
"LLVMSparcCodeGen",
Expand Down Expand Up @@ -1294,18 +1298,19 @@ const llvm_libs = [_][]const u8{
"LLVMCoroutines",
"LLVMipo",
"LLVMVectorize",
"LLVMSandboxIR",
"LLVMLinker",
"LLVMInstrumentation",
"LLVMFrontendOpenMP",
"LLVMFrontendOffloading",
"LLVMFrontendOpenACC",
"LLVMFrontendHLSL",
"LLVMFrontendDriver",
"LLVMFrontendAtomic",
"LLVMExtensions",
"LLVMDWARFLinkerParallel",
"LLVMDWARFLinkerClassic",
"LLVMDWARFLinker",
"LLVMCodeGenData",
"LLVMGlobalISel",
"LLVMMIRParser",
"LLVMAsmPrinter",
Expand All @@ -1314,6 +1319,7 @@ const llvm_libs = [_][]const u8{
"LLVMTarget",
"LLVMObjCARCOpts",
"LLVMCodeGenTypes",
"LLVMCGData",
"LLVMIRPrinter",
"LLVMInterfaceStub",
"LLVMFileCheck",
Expand All @@ -1329,14 +1335,14 @@ const llvm_libs = [_][]const u8{
"LLVMDebugInfoBTF",
"LLVMDebugInfoPDB",
"LLVMDebugInfoMSF",
"LLVMDebugInfoCodeView",
"LLVMDebugInfoDWARF",
"LLVMObject",
"LLVMTextAPI",
"LLVMMCParser",
"LLVMIRReader",
"LLVMAsmParser",
"LLVMMC",
"LLVMDebugInfoCodeView",
"LLVMBitReader",
"LLVMFuzzerCLI",
"LLVMCore",
Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-linux-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ARCH="$(uname -m)"
TARGET="$ARCH-linux-musl"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
PREFIX="$HOME/deps/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-linux-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ARCH="$(uname -m)"
TARGET="$ARCH-linux-musl"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
PREFIX="$HOME/deps/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-macos-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
ZIGDIR="$PWD"
TARGET="$ARCH-macos-none"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
PREFIX="$HOME/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-macos-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
ZIGDIR="$PWD"
TARGET="$ARCH-macos-none"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
PREFIX="$HOME/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/aarch64-windows.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$TARGET = "$($Env:ARCH)-windows-gnu"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
$MCPU = "baseline"
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
$PREFIX_PATH = "$(Get-Location)\..\$ZIG_LLVM_CLANG_LLD_NAME"
Expand Down
2 changes: 1 addition & 1 deletion ci/x86_64-linux-debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ARCH="$(uname -m)"
TARGET="$ARCH-linux-musl"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
PREFIX="$HOME/deps/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/x86_64-linux-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
ARCH="$(uname -m)"
TARGET="$ARCH-linux-musl"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
PREFIX="$HOME/deps/$CACHE_BASENAME"
ZIG="$PREFIX/bin/zig"

Expand Down
2 changes: 1 addition & 1 deletion ci/x86_64-macos-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -e
ZIGDIR="$PWD"
TARGET="$ARCH-macos-none"
MCPU="baseline"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
CACHE_BASENAME="zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
PREFIX="$HOME/$CACHE_BASENAME"
JOBS="-j3"
ZIG="$PREFIX/bin/zig"
Expand Down
2 changes: 1 addition & 1 deletion ci/x86_64-windows-debug.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$TARGET = "$($Env:ARCH)-windows-gnu"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
$MCPU = "baseline"
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
Expand Down
2 changes: 1 addition & 1 deletion ci/x86_64-windows-release.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$TARGET = "$($Env:ARCH)-windows-gnu"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.14.0-dev.1622+2ac543388"
$ZIG_LLVM_CLANG_LLD_NAME = "zig+llvm+lld+clang-$TARGET-0.15.0-dev.233+7c85dc460"
$MCPU = "baseline"
$ZIG_LLVM_CLANG_LLD_URL = "https://ziglang.org/deps/$ZIG_LLVM_CLANG_LLD_NAME.zip"
$PREFIX_PATH = "$($Env:USERPROFILE)\$ZIG_LLVM_CLANG_LLD_NAME"
Expand Down
8 changes: 4 additions & 4 deletions cmake/Findclang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
if(${LLVM_LINK_MODE} STREQUAL "shared")
find_library(CLANG_LIBRARIES
NAMES
libclang-cpp.so.19
libclang-cpp.so.19.1
clang-cpp-19.0
clang-cpp190
libclang-cpp.so.20
libclang-cpp.so.20.1
clang-cpp-20.0
clang-cpp200
clang-cpp
NAMES_PER_DIR
HINTS "${LLVM_LIBDIRS}"
Expand Down
32 changes: 16 additions & 16 deletions cmake/Findlld.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
HINTS ${LLVM_INCLUDE_DIRS}
PATHS
/usr/lib/llvm-19/include
/usr/local/llvm190/include
/usr/local/llvm19/include
/usr/local/opt/lld@19/include
/opt/homebrew/opt/lld@19/include
/usr/lib/llvm-20/include
/usr/local/llvm200/include
/usr/local/llvm20/include
/usr/local/opt/lld@20/include
/opt/homebrew/opt/lld@20/include
/mingw64/include)

find_library(LLD_LIBRARY NAMES lld-19.0 lld190 lld NAMES_PER_DIR
find_library(LLD_LIBRARY NAMES lld-20.0 lld200 lld NAMES_PER_DIR
HINTS ${LLVM_LIBDIRS}
PATHS
/usr/lib/llvm-19/lib
/usr/local/llvm190/lib
/usr/local/llvm19/lib
/usr/local/opt/lld@19/lib
/opt/homebrew/opt/lld@19/lib
/usr/lib/llvm-20/lib
/usr/local/llvm200/lib
/usr/local/llvm20/lib
/usr/local/opt/lld@20/lib
/opt/homebrew/opt/lld@20/lib
)
if(EXISTS ${LLD_LIBRARY})
set(LLD_LIBRARIES ${LLD_LIBRARY})
Expand All @@ -34,11 +34,11 @@ else()
HINTS ${LLVM_LIBDIRS}
PATHS
${LLD_LIBDIRS}
/usr/lib/llvm-19/lib
/usr/local/llvm190/lib
/usr/local/llvm19/lib
/usr/local/opt/lld@19/lib
/opt/homebrew/opt/lld@19/lib
/usr/lib/llvm-20/lib
/usr/local/llvm200/lib
/usr/local/llvm20/lib
/usr/local/opt/lld@20/lib
/opt/homebrew/opt/lld@20/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:/msys64/mingw64/lib)
Expand Down
Loading