Skip to content

Commit 5acd1c4

Browse files
committed
update zig sources to 0.15.0-dev.203+53270f008
1 parent 03a95ef commit 5acd1c4

File tree

2,434 files changed

+148028
-72669
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,434 files changed

+148028
-72669
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ to find and inspect the patch diffs.
1111
* LLVM, LLD, Clang 19.1.7
1212
* zlib 1.3.1
1313
* zstd 1.5.2
14-
* zig 0.14.0-dev.3299+31f353cd9
14+
* zig 0.15.0-dev.203+53270f008
1515

1616
For other versions, check the git tags of this repository.
1717

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TARGET="$1" # Example: riscv64-linux-gnu
77
MCPU="$2" # Examples: `baseline`, `native`, `generic+v7a`, or `arm1176jzf_s`
88

99
ROOTDIR="$(pwd)"
10-
ZIG_VERSION="0.14.0-dev.3299+31f353cd9"
10+
ZIG_VERSION="0.15.0-dev.203+53270f008"
1111

1212
TARGET_OS_AND_ABI=${TARGET#*-} # Example: linux-gnu
1313

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if "%VSCMD_ARG_HOST_ARCH%"=="x86" set OUTDIR=out-win-x86
3535

3636
set ROOTDIR=%~dp0
3737
set "ROOTDIR_CMAKE=%ROOTDIR:\=/%"
38-
set ZIG_VERSION="0.14.0-dev.3299+31f353cd9"
38+
set ZIG_VERSION="0.15.0-dev.203+53270f008"
3939
set JOBS_ARG=
4040

4141
pushd %ROOTDIR%

zig/CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ project(zig
3838
)
3939

4040
set(ZIG_VERSION_MAJOR 0)
41-
set(ZIG_VERSION_MINOR 14)
41+
set(ZIG_VERSION_MINOR 15)
4242
set(ZIG_VERSION_PATCH 0)
4343
set(ZIG_VERSION "" CACHE STRING "Override Zig version string. Default is to find out with git.")
4444

@@ -132,9 +132,9 @@ else()
132132
set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")
133133
endif()
134134

135-
find_package(llvm 19)
136-
find_package(clang 19)
137-
find_package(lld 19)
135+
find_package(llvm 20)
136+
find_package(clang 20)
137+
find_package(lld 20)
138138

139139
if(ZIG_STATIC_ZLIB)
140140
if (MSVC)
@@ -500,6 +500,11 @@ set(ZIG_STAGE2_SOURCES
500500
lib/std/zig/system/NativePaths.zig
501501
lib/std/zig/system/x86.zig
502502
lib/std/zig/tokenizer.zig
503+
lib/std/zig/llvm.zig
504+
lib/std/zig/llvm/BitcodeReader.zig
505+
lib/std/zig/llvm/Builder.zig
506+
lib/std/zig/llvm/bitcode_writer.zig
507+
lib/std/zig/llvm/ir.zig
503508
src/Air.zig
504509
src/Builtin.zig
505510
src/Compilation.zig
@@ -559,19 +564,15 @@ set(ZIG_STAGE2_SOURCES
559564
src/arch/x86_64/abi.zig
560565
src/arch/x86_64/bits.zig
561566
src/arch/x86_64/encoder.zig
562-
src/arch/x86_64/encodings.zig
567+
src/arch/x86_64/encodings.zon
563568
src/clang.zig
564569
src/clang_options.zig
565570
src/clang_options_data.zig
566571
src/codegen.zig
567572
src/codegen/c.zig
568573
src/codegen/c/Type.zig
569574
src/codegen/llvm.zig
570-
src/codegen/llvm/BitcodeReader.zig
571-
src/codegen/llvm/Builder.zig
572575
src/codegen/llvm/bindings.zig
573-
src/codegen/llvm/bitcode_writer.zig
574-
src/codegen/llvm/ir.zig
575576
src/codegen/spirv.zig
576577
src/codegen/spirv/Assembler.zig
577578
src/codegen/spirv/Module.zig

zig/bootstrap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int main(int argc, char **argv) {
123123
if (f == NULL)
124124
panic("unable to open config.zig for writing");
125125

126-
const char *zig_version = "0.14.0-dev.3299+31f353cd9";
126+
const char *zig_version = "0.15.0-dev.203+53270f008";
127127

128128
int written = fprintf(f,
129129
"pub const have_llvm = false;\n"

zig/build.zig

Lines changed: 74 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const assert = std.debug.assert;
1111
const DevEnv = @import("src/dev.zig").Env;
1212
const ValueInterpretMode = enum { direct, by_name };
1313

14-
const zig_version: std.SemanticVersion = .{ .major = 0, .minor = 14, .patch = 0 };
14+
const zig_version: std.SemanticVersion = .{ .major = 0, .minor = 15, .patch = 0 };
1515
const stack_size = 46 * 1024 * 1024;
1616

1717
pub fn build(b: *std.Build) !void {
@@ -214,11 +214,6 @@ pub fn build(b: *std.Build) !void {
214214

215215
test_step.dependOn(&exe.step);
216216

217-
if (target.result.os.tag == .windows and target.result.abi == .gnu) {
218-
// LTO is currently broken on mingw, this can be removed when it's fixed.
219-
exe.want_lto = false;
220-
}
221-
222217
const use_llvm = b.option(bool, "use-llvm", "Use the llvm backend");
223218
exe.use_llvm = use_llvm;
224219
exe.use_lld = use_llvm;
@@ -257,13 +252,10 @@ pub fn build(b: *std.Build) !void {
257252
var code: u8 = undefined;
258253
const git_describe_untrimmed = b.runAllowFail(&[_][]const u8{
259254
"git",
260-
"-C",
261-
b.build_root.path orelse ".",
262-
"describe",
263-
"--match",
264-
"*.*.*",
265-
"--tags",
266-
"--abbrev=9",
255+
"-C", b.build_root.path orelse ".", // affects the --git-dir argument
256+
"--git-dir", ".git", // affected by the -C argument
257+
"describe", "--match", "*.*.*", //
258+
"--tags", "--abbrev=9",
267259
}, &code, .Ignore) catch {
268260
break :v version_string;
269261
};
@@ -334,7 +326,12 @@ pub fn build(b: *std.Build) !void {
334326
try addCmakeCfgOptionsToExe(b, cfg, exe, use_zig_libcxx);
335327
} else {
336328
// Here we are -Denable-llvm but no cmake integration.
337-
try addStaticLlvmOptionsToModule(exe.root_module);
329+
try addStaticLlvmOptionsToModule(exe.root_module, .{
330+
.llvm_has_m68k = llvm_has_m68k,
331+
.llvm_has_csky = llvm_has_csky,
332+
.llvm_has_arc = llvm_has_arc,
333+
.llvm_has_xtensa = llvm_has_xtensa,
334+
});
338335
}
339336
if (target.result.os.tag == .windows) {
340337
// LLVM depends on networking as of version 18.
@@ -362,11 +359,7 @@ pub fn build(b: *std.Build) !void {
362359
&[_][]const u8{ tracy_path, "public", "TracyClient.cpp" },
363360
);
364361

365-
// On mingw, we need to opt into windows 7+ to get some features required by tracy.
366-
const tracy_c_flags: []const []const u8 = if (target.result.os.tag == .windows and target.result.abi == .gnu)
367-
&[_][]const u8{ "-DTRACY_ENABLE=1", "-fno-sanitize=undefined", "-D_WIN32_WINNT=0x601" }
368-
else
369-
&[_][]const u8{ "-DTRACY_ENABLE=1", "-fno-sanitize=undefined" };
362+
const tracy_c_flags: []const []const u8 = &.{ "-DTRACY_ENABLE=1", "-fno-sanitize=undefined" };
370363

371364
exe.root_module.addIncludePath(.{ .cwd_relative = tracy_path });
372365
exe.root_module.addCSourceFile(.{ .file = .{ .cwd_relative = client_cpp }, .flags = tracy_c_flags });
@@ -383,7 +376,7 @@ pub fn build(b: *std.Build) !void {
383376

384377
const test_filters = b.option([]const []const u8, "test-filter", "Skip tests that do not match any filter") orelse &[0][]const u8{};
385378
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{};
386-
const test_slow_targets = b.option(bool, "test-slow-targets", "Enable running module tests for targets that have a slow compiler backend") orelse false;
379+
const test_extra_targets = b.option(bool, "test-extra-targets", "Enable running module tests for additional targets") orelse false;
387380

388381
var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined;
389382
var chosen_mode_index: usize = 0;
@@ -440,7 +433,7 @@ pub fn build(b: *std.Build) !void {
440433
test_modules_step.dependOn(tests.addModuleTests(b, .{
441434
.test_filters = test_filters,
442435
.test_target_filters = test_target_filters,
443-
.test_slow_targets = test_slow_targets,
436+
.test_extra_targets = test_extra_targets,
444437
.root_src = "test/behavior.zig",
445438
.name = "behavior",
446439
.desc = "Run the behavior tests",
@@ -456,7 +449,7 @@ pub fn build(b: *std.Build) !void {
456449
test_modules_step.dependOn(tests.addModuleTests(b, .{
457450
.test_filters = test_filters,
458451
.test_target_filters = test_target_filters,
459-
.test_slow_targets = test_slow_targets,
452+
.test_extra_targets = test_extra_targets,
460453
.root_src = "test/c_import.zig",
461454
.name = "c-import",
462455
.desc = "Run the @cImport tests",
@@ -471,7 +464,7 @@ pub fn build(b: *std.Build) !void {
471464
test_modules_step.dependOn(tests.addModuleTests(b, .{
472465
.test_filters = test_filters,
473466
.test_target_filters = test_target_filters,
474-
.test_slow_targets = test_slow_targets,
467+
.test_extra_targets = test_extra_targets,
475468
.root_src = "lib/compiler_rt.zig",
476469
.name = "compiler-rt",
477470
.desc = "Run the compiler_rt tests",
@@ -487,7 +480,7 @@ pub fn build(b: *std.Build) !void {
487480
test_modules_step.dependOn(tests.addModuleTests(b, .{
488481
.test_filters = test_filters,
489482
.test_target_filters = test_target_filters,
490-
.test_slow_targets = test_slow_targets,
483+
.test_extra_targets = test_extra_targets,
491484
.root_src = "lib/c.zig",
492485
.name = "universal-libc",
493486
.desc = "Run the universal libc tests",
@@ -503,7 +496,7 @@ pub fn build(b: *std.Build) !void {
503496
test_modules_step.dependOn(tests.addModuleTests(b, .{
504497
.test_filters = test_filters,
505498
.test_target_filters = test_target_filters,
506-
.test_slow_targets = test_slow_targets,
499+
.test_extra_targets = test_extra_targets,
507500
.root_src = "lib/std/std.zig",
508501
.name = "std",
509502
.desc = "Run the standard library tests",
@@ -513,8 +506,8 @@ pub fn build(b: *std.Build) !void {
513506
.skip_non_native = skip_non_native,
514507
.skip_libc = skip_libc,
515508
.use_llvm = use_llvm,
516-
// I observed a value of 5136793600 on the M2 CI.
517-
.max_rss = 5368709120,
509+
// I observed a value of 5605064704 on the M2 CI.
510+
.max_rss = 6165571174,
518511
}));
519512

520513
const unit_tests_step = b.step("test-unit", "Run the compiler source unit tests");
@@ -821,7 +814,12 @@ fn addCmakeCfgOptionsToExe(
821814
}
822815
}
823816

824-
fn addStaticLlvmOptionsToModule(mod: *std.Build.Module) !void {
817+
fn addStaticLlvmOptionsToModule(mod: *std.Build.Module, options: struct {
818+
llvm_has_m68k: bool,
819+
llvm_has_csky: bool,
820+
llvm_has_arc: bool,
821+
llvm_has_xtensa: bool,
822+
}) !void {
825823
// Adds the Zig C++ sources which both stage1 and stage2 need.
826824
//
827825
// We need this because otherwise zig_clang_cc1_main.cpp ends up pulling
@@ -845,6 +843,22 @@ fn addStaticLlvmOptionsToModule(mod: *std.Build.Module) !void {
845843
mod.linkSystemLibrary(lib_name, .{});
846844
}
847845

846+
if (options.llvm_has_m68k) for (llvm_libs_m68k) |lib_name| {
847+
mod.linkSystemLibrary(lib_name, .{});
848+
};
849+
850+
if (options.llvm_has_csky) for (llvm_libs_csky) |lib_name| {
851+
mod.linkSystemLibrary(lib_name, .{});
852+
};
853+
854+
if (options.llvm_has_arc) for (llvm_libs_arc) |lib_name| {
855+
mod.linkSystemLibrary(lib_name, .{});
856+
};
857+
858+
if (options.llvm_has_xtensa) for (llvm_libs_xtensa) |lib_name| {
859+
mod.linkSystemLibrary(lib_name, .{});
860+
};
861+
848862
mod.linkSystemLibrary("z", .{});
849863
mod.linkSystemLibrary("zstd", .{});
850864

@@ -1152,10 +1166,10 @@ const llvm_libs = [_][]const u8{
11521166
"LLVMXRay",
11531167
"LLVMLibDriver",
11541168
"LLVMDlltoolDriver",
1169+
"LLVMTelemetry",
11551170
"LLVMTextAPIBinaryReader",
11561171
"LLVMCoverage",
11571172
"LLVMLineEditor",
1158-
"LLVMSandboxIR",
11591173
"LLVMXCoreDisassembler",
11601174
"LLVMXCoreCodeGen",
11611175
"LLVMXCoreDesc",
@@ -1280,18 +1294,19 @@ const llvm_libs = [_][]const u8{
12801294
"LLVMCoroutines",
12811295
"LLVMipo",
12821296
"LLVMVectorize",
1297+
"LLVMSandboxIR",
12831298
"LLVMLinker",
12841299
"LLVMInstrumentation",
12851300
"LLVMFrontendOpenMP",
12861301
"LLVMFrontendOffloading",
12871302
"LLVMFrontendOpenACC",
12881303
"LLVMFrontendHLSL",
12891304
"LLVMFrontendDriver",
1305+
"LLVMFrontendAtomic",
12901306
"LLVMExtensions",
12911307
"LLVMDWARFLinkerParallel",
12921308
"LLVMDWARFLinkerClassic",
12931309
"LLVMDWARFLinker",
1294-
"LLVMCodeGenData",
12951310
"LLVMGlobalISel",
12961311
"LLVMMIRParser",
12971312
"LLVMAsmPrinter",
@@ -1300,6 +1315,7 @@ const llvm_libs = [_][]const u8{
13001315
"LLVMTarget",
13011316
"LLVMObjCARCOpts",
13021317
"LLVMCodeGenTypes",
1318+
"LLVMCGData",
13031319
"LLVMIRPrinter",
13041320
"LLVMInterfaceStub",
13051321
"LLVMFileCheck",
@@ -1315,14 +1331,14 @@ const llvm_libs = [_][]const u8{
13151331
"LLVMDebugInfoBTF",
13161332
"LLVMDebugInfoPDB",
13171333
"LLVMDebugInfoMSF",
1334+
"LLVMDebugInfoCodeView",
13181335
"LLVMDebugInfoDWARF",
13191336
"LLVMObject",
13201337
"LLVMTextAPI",
13211338
"LLVMMCParser",
13221339
"LLVMIRReader",
13231340
"LLVMAsmParser",
13241341
"LLVMMC",
1325-
"LLVMDebugInfoCodeView",
13261342
"LLVMBitReader",
13271343
"LLVMFuzzerCLI",
13281344
"LLVMCore",
@@ -1333,6 +1349,33 @@ const llvm_libs = [_][]const u8{
13331349
"LLVMSupport",
13341350
"LLVMDemangle",
13351351
};
1352+
const llvm_libs_m68k = [_][]const u8{
1353+
"LLVMM68kDisassembler",
1354+
"LLVMM68kAsmParser",
1355+
"LLVMM68kCodeGen",
1356+
"LLVMM68kDesc",
1357+
"LLVMM68kInfo",
1358+
};
1359+
const llvm_libs_csky = [_][]const u8{
1360+
"LLVMCSKYDisassembler",
1361+
"LLVMCSKYAsmParser",
1362+
"LLVMCSKYCodeGen",
1363+
"LLVMCSKYDesc",
1364+
"LLVMCSKYInfo",
1365+
};
1366+
const llvm_libs_arc = [_][]const u8{
1367+
"LLVMARCDisassembler",
1368+
"LLVMARCCodeGen",
1369+
"LLVMARCDesc",
1370+
"LLVMARCInfo",
1371+
};
1372+
const llvm_libs_xtensa = [_][]const u8{
1373+
"LLVMXtensaDisassembler",
1374+
"LLVMXtensaAsmParser",
1375+
"LLVMXtensaCodeGen",
1376+
"LLVMXtensaDesc",
1377+
"LLVMXtensaInfo",
1378+
};
13361379

13371380
fn generateLangRef(b: *std.Build) std.Build.LazyPath {
13381381
const doctest_exe = b.addExecutable(.{

zig/build.zig.zon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// The Zig compiler is not intended to be consumed as a package.
22
// The sole purpose of this manifest file is to test the compiler.
33
.{
4-
.name = "zig",
4+
.name = .zig,
55
.version = "0.0.0",
66
.dependencies = .{
77
.standalone_test_cases = .{
@@ -12,4 +12,5 @@
1212
},
1313
},
1414
.paths = .{""},
15+
.fingerprint = 0xc1ce108124179e16,
1516
}

zig/cmake/Findclang.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
1717
if(${LLVM_LINK_MODE} STREQUAL "shared")
1818
find_library(CLANG_LIBRARIES
1919
NAMES
20-
libclang-cpp.so.19
21-
libclang-cpp.so.19.1
22-
clang-cpp-19.0
23-
clang-cpp190
20+
libclang-cpp.so.20
21+
libclang-cpp.so.20.1
22+
clang-cpp-20.0
23+
clang-cpp200
2424
clang-cpp
2525
NAMES_PER_DIR
2626
HINTS "${LLVM_LIBDIRS}"

0 commit comments

Comments
 (0)