Skip to content

Commit d2daf1c

Browse files
committed
update zig sources to 0.16.0-dev.660+27aba2d77
1 parent 47f663a commit d2daf1c

File tree

464 files changed

+39030
-31381
lines changed

Some content is hidden

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

464 files changed

+39030
-31381
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 21.1.0
1212
* zlib 1.3.1
1313
* zstd 1.5.2
14-
* zig 0.16.0-dev.452+1f7ee99b3
14+
* zig 0.16.0-dev.660+27aba2d77
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.16.0-dev.452+1f7ee99b3"
10+
ZIG_VERSION="0.16.0-dev.660+27aba2d77"
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
@@ -36,7 +36,7 @@ if "%VSCMD_ARG_HOST_ARCH%"=="x86" set OUTDIR=out-win-x86
3636

3737
set ROOTDIR=%~dp0
3838
set "ROOTDIR_CMAKE=%ROOTDIR:\=/%"
39-
set ZIG_VERSION="0.16.0-dev.452+1f7ee99b3"
39+
set ZIG_VERSION="0.16.0-dev.660+27aba2d77"
4040
set JOBS_ARG=
4141

4242
pushd %ROOTDIR%

zig/.forgejo/workflows/ci.yaml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: ci
2+
on:
3+
pull_request:
4+
# push:
5+
# branches:
6+
# - master
7+
workflow_dispatch:
8+
concurrency:
9+
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
10+
cancel-in-progress: true
11+
permissions:
12+
contents: read
13+
env:
14+
# https://codeberg.org/forgejo/forgejo/issues/9244
15+
TERM: dumb
16+
jobs:
17+
aarch64-linux-debug:
18+
runs-on: [self-hosted, aarch64-linux]
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
- name: Build and Test
25+
run: sh ci/aarch64-linux-debug.sh
26+
timeout-minutes: 120
27+
aarch64-linux-release:
28+
runs-on: [self-hosted, aarch64-linux]
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
- name: Build and Test
35+
run: sh ci/aarch64-linux-release.sh
36+
timeout-minutes: 120
37+
loongarch64-linux-debug:
38+
runs-on: [self-hosted, loongarch64-linux]
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
- name: Build and Test
45+
run: sh ci/loongarch64-linux-debug.sh
46+
timeout-minutes: 180
47+
loongarch64-linux-release:
48+
runs-on: [self-hosted, loongarch64-linux]
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
- name: Build and Test
55+
run: sh ci/loongarch64-linux-release.sh
56+
timeout-minutes: 180
57+
riscv64-linux-debug:
58+
# if: github.event_name != 'pull_request'
59+
runs-on: [self-hosted, riscv64-linux]
60+
steps:
61+
- name: Checkout
62+
uses: actions/checkout@v4
63+
with:
64+
fetch-depth: 0
65+
- name: Build and Test
66+
run: sh ci/riscv64-linux-debug.sh
67+
timeout-minutes: 420
68+
riscv64-linux-release:
69+
# if: github.event_name != 'pull_request'
70+
runs-on: [self-hosted, riscv64-linux]
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v4
74+
with:
75+
fetch-depth: 0
76+
- name: Build and Test
77+
run: sh ci/riscv64-linux-release.sh
78+
timeout-minutes: 420
79+
x86_64-freebsd-debug:
80+
runs-on: [self-hosted, x86_64-freebsd]
81+
steps:
82+
- name: Checkout
83+
uses: actions/checkout@v4
84+
with:
85+
fetch-depth: 0
86+
- name: Build and Test
87+
run: sh ci/x86_64-freebsd-debug.sh
88+
timeout-minutes: 120
89+
x86_64-freebsd-release:
90+
runs-on: [self-hosted, x86_64-freebsd]
91+
steps:
92+
- name: Checkout
93+
uses: actions/checkout@v4
94+
with:
95+
fetch-depth: 0
96+
- name: Build and Test
97+
run: sh ci/x86_64-freebsd-release.sh
98+
timeout-minutes: 120
99+
x86_64-linux-debug:
100+
runs-on: [self-hosted, x86_64-linux]
101+
steps:
102+
- name: Checkout
103+
uses: actions/checkout@v4
104+
with:
105+
fetch-depth: 0
106+
- name: Build and Test
107+
run: sh ci/x86_64-linux-debug.sh
108+
timeout-minutes: 240
109+
x86_64-linux-debug-llvm:
110+
runs-on: [self-hosted, x86_64-linux]
111+
steps:
112+
- name: Checkout
113+
uses: actions/checkout@v4
114+
with:
115+
fetch-depth: 0
116+
- name: Build and Test
117+
run: sh ci/x86_64-linux-debug-llvm.sh
118+
timeout-minutes: 480
119+
x86_64-linux-release:
120+
runs-on: [self-hosted, x86_64-linux]
121+
steps:
122+
- name: Checkout
123+
uses: actions/checkout@v4
124+
with:
125+
fetch-depth: 0
126+
- name: Build and Test
127+
run: sh ci/x86_64-linux-release.sh
128+
timeout-minutes: 480
129+
x86_64-windows-debug:
130+
runs-on: [self-hosted, x86_64-windows]
131+
steps:
132+
- name: Checkout
133+
uses: actions/checkout@v4
134+
with:
135+
fetch-depth: 0
136+
- name: Build and Test
137+
run: ci/x86_64-windows-debug.ps1
138+
timeout-minutes: 180
139+
x86_64-windows-release:
140+
runs-on: [self-hosted, x86_64-windows]
141+
steps:
142+
- name: Checkout
143+
uses: actions/checkout@v4
144+
with:
145+
fetch-depth: 0
146+
- name: Build and Test
147+
run: ci/x86_64-windows-release.ps1
148+
timeout-minutes: 180

zig/bootstrap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ static const char *get_host_os(void) {
6464
return "linux";
6565
#elif defined(__FreeBSD__)
6666
return "freebsd";
67+
#elif defined(__DragonFly__)
68+
return "dragonfly";
6769
#elif defined(__HAIKU__)
6870
return "haiku";
6971
#else
@@ -123,7 +125,7 @@ int main(int argc, char **argv) {
123125
if (f == NULL)
124126
panic("unable to open config.zig for writing");
125127

126-
const char *zig_version = "0.16.0-dev.452+1f7ee99b3";
128+
const char *zig_version = "0.16.0-dev.660+27aba2d77";
127129

128130
int written = fprintf(f,
129131
"pub const have_llvm = false;\n"

zig/build.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ pub fn build(b: *std.Build) !void {
260260
};
261261
const git_describe = mem.trim(u8, git_describe_untrimmed, " \n\r");
262262

263-
switch (mem.count(u8, git_describe, "-")) {
263+
switch (mem.countScalar(u8, git_describe, '-')) {
264264
0 => {
265265
// Tagged release version (e.g. 0.10.0).
266266
if (!mem.eql(u8, git_describe, version_string)) {
@@ -563,7 +563,8 @@ pub fn build(b: *std.Build) !void {
563563
.skip_release = skip_release,
564564
}));
565565
test_step.dependOn(tests.addLinkTests(b, enable_macos_sdk, enable_ios_sdk, enable_symlinks_windows));
566-
test_step.dependOn(tests.addStackTraceTests(b, test_filters, optimization_modes));
566+
test_step.dependOn(tests.addStackTraceTests(b, test_filters, skip_non_native));
567+
test_step.dependOn(tests.addErrorTraceTests(b, test_filters, optimization_modes, skip_non_native));
567568
test_step.dependOn(tests.addCliTests(b));
568569
if (tests.addDebuggerTests(b, .{
569570
.test_filters = test_filters,

zig/lib/compiler/resinator/compile.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ pub const Compiler = struct {
695695
}
696696

697697
try file_reader.seekTo(entry.data_offset_from_start_of_file);
698-
var header_bytes = (file_reader.interface.takeArray(16) catch {
698+
var header_bytes: [16]u8 align(@alignOf(ico.BitmapHeader)) = (file_reader.interface.takeArray(16) catch {
699699
return self.iconReadError(
700700
error.UnexpectedEOF,
701701
filename_utf8,

zig/lib/compiler/resinator/cvtres.zig

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub fn parseNameOrOrdinal(allocator: Allocator, reader: *std.Io.Reader) !NameOrO
168168
}
169169

170170
pub const CoffOptions = struct {
171-
target: std.coff.MachineType = .X64,
171+
target: std.coff.IMAGE.FILE.MACHINE = .AMD64,
172172
/// If true, zeroes will be written to all timestamp fields
173173
reproducible: bool = true,
174174
/// If true, the MEM_WRITE flag will not be set in the .rsrc section header
@@ -210,19 +210,19 @@ pub fn writeCoff(allocator: Allocator, writer: *std.Io.Writer, resources: []cons
210210
const lengths = resource_tree.dataLengths();
211211
const byte_size_of_relocation = 10;
212212
const relocations_len: u32 = @intCast(byte_size_of_relocation * resources.len);
213-
const pointer_to_rsrc01_data = @sizeOf(std.coff.CoffHeader) + (@sizeOf(std.coff.SectionHeader) * 2);
213+
const pointer_to_rsrc01_data = @sizeOf(std.coff.Header) + (@sizeOf(std.coff.SectionHeader) * 2);
214214
const pointer_to_relocations = pointer_to_rsrc01_data + lengths.rsrc01;
215215
const pointer_to_rsrc02_data = pointer_to_relocations + relocations_len;
216216
const pointer_to_symbol_table = pointer_to_rsrc02_data + lengths.rsrc02;
217217

218218
const timestamp: i64 = if (options.reproducible) 0 else std.time.timestamp();
219219
const size_of_optional_header = 0;
220-
const machine_type: std.coff.MachineType = options.target;
221-
const flags = std.coff.CoffHeaderFlags{
222-
.@"32BIT_MACHINE" = 1,
220+
const machine_type: std.coff.IMAGE.FILE.MACHINE = options.target;
221+
const flags = std.coff.Header.Flags{
222+
.@"32BIT_MACHINE" = true,
223223
};
224224
const number_of_symbols = 5 + @as(u32, @intCast(resources.len)) + @intFromBool(options.define_external_symbol != null);
225-
const coff_header = std.coff.CoffHeader{
225+
const coff_header = std.coff.Header{
226226
.machine = machine_type,
227227
.number_of_sections = 2,
228228
.time_date_stamp = @as(u32, @truncate(@as(u64, @bitCast(timestamp)))),
@@ -245,9 +245,9 @@ pub fn writeCoff(allocator: Allocator, writer: *std.Io.Writer, resources: []cons
245245
.number_of_relocations = @intCast(resources.len),
246246
.number_of_linenumbers = 0,
247247
.flags = .{
248-
.CNT_INITIALIZED_DATA = 1,
249-
.MEM_WRITE = @intFromBool(!options.read_only),
250-
.MEM_READ = 1,
248+
.CNT_INITIALIZED_DATA = true,
249+
.MEM_WRITE = !options.read_only,
250+
.MEM_READ = true,
251251
},
252252
};
253253
try writer.writeStruct(rsrc01_header, .little);
@@ -263,9 +263,9 @@ pub fn writeCoff(allocator: Allocator, writer: *std.Io.Writer, resources: []cons
263263
.number_of_relocations = 0,
264264
.number_of_linenumbers = 0,
265265
.flags = .{
266-
.CNT_INITIALIZED_DATA = 1,
267-
.MEM_WRITE = @intFromBool(!options.read_only),
268-
.MEM_READ = 1,
266+
.CNT_INITIALIZED_DATA = true,
267+
.MEM_WRITE = !options.read_only,
268+
.MEM_READ = true,
269269
},
270270
};
271271
try writer.writeStruct(rsrc02_header, .little);
@@ -1005,9 +1005,9 @@ pub const supported_targets = struct {
10051005
x86_64,
10061006
aarch64,
10071007

1008-
pub fn toCoffMachineType(arch: Arch) std.coff.MachineType {
1008+
pub fn toCoffMachineType(arch: Arch) std.coff.IMAGE.FILE.MACHINE {
10091009
return switch (arch) {
1010-
.x64, .amd64, .x86_64 => .X64,
1010+
.x64, .amd64, .x86_64 => .AMD64,
10111011
.x86, .i386 => .I386,
10121012
.arm, .armnt => .ARMNT,
10131013
.arm64, .aarch64 => .ARM64,
@@ -1079,26 +1079,26 @@ pub const supported_targets = struct {
10791079
};
10801080

10811081
// https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#type-indicators
1082-
pub fn rvaRelocationTypeIndicator(target: std.coff.MachineType) ?u16 {
1082+
pub fn rvaRelocationTypeIndicator(target: std.coff.IMAGE.FILE.MACHINE) ?u16 {
10831083
return switch (target) {
1084-
.X64 => 0x3, // IMAGE_REL_AMD64_ADDR32NB
1085-
.I386 => 0x7, // IMAGE_REL_I386_DIR32NB
1086-
.ARMNT => 0x2, // IMAGE_REL_ARM_ADDR32NB
1087-
.ARM64, .ARM64EC, .ARM64X => 0x2, // IMAGE_REL_ARM64_ADDR32NB
1088-
.IA64 => 0x10, // IMAGE_REL_IA64_DIR32NB
1084+
.AMD64 => @intFromEnum(std.coff.IMAGE.REL.AMD64.ADDR32NB),
1085+
.I386 => @intFromEnum(std.coff.IMAGE.REL.I386.DIR32NB),
1086+
.ARMNT => @intFromEnum(std.coff.IMAGE.REL.ARM.ADDR32NB),
1087+
.ARM64, .ARM64EC, .ARM64X => @intFromEnum(std.coff.IMAGE.REL.ARM64.ADDR32NB),
1088+
.IA64 => @intFromEnum(std.coff.IMAGE.REL.IA64.DIR32NB),
10891089
.EBC => 0x1, // This is what cvtres.exe writes for this target, unsure where it comes from
10901090
else => null,
10911091
};
10921092
}
10931093

1094-
pub fn isSupported(target: std.coff.MachineType) bool {
1094+
pub fn isSupported(target: std.coff.IMAGE.FILE.MACHINE) bool {
10951095
return rvaRelocationTypeIndicator(target) != null;
10961096
}
10971097

10981098
comptime {
10991099
// Enforce two things:
11001100
// 1. Arch enum field names are all lowercase (necessary for how fromStringIgnoreCase is implemented)
1101-
// 2. All enum fields in Arch have an associated RVA relocation type when converted to a coff.MachineType
1101+
// 2. All enum fields in Arch have an associated RVA relocation type when converted to a coff.IMAGE.FILE.MACHINE
11021102
for (@typeInfo(Arch).@"enum".fields) |enum_field| {
11031103
const all_lower = all_lower: for (enum_field.name) |c| {
11041104
if (std.ascii.isUpper(c)) break :all_lower false;

zig/lib/compiler/resinator/main.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ const LazyIncludePaths = struct {
527527
arena: std.mem.Allocator,
528528
auto_includes_option: cli.Options.AutoIncludes,
529529
zig_lib_dir: []const u8,
530-
target_machine_type: std.coff.MachineType,
530+
target_machine_type: std.coff.IMAGE.FILE.MACHINE,
531531
resolved_include_paths: ?[]const []const u8 = null,
532532

533533
pub fn get(self: *LazyIncludePaths, error_handler: *ErrorHandler) ![]const []const u8 {
@@ -555,11 +555,11 @@ const LazyIncludePaths = struct {
555555
}
556556
};
557557

558-
fn getIncludePaths(arena: std.mem.Allocator, auto_includes_option: cli.Options.AutoIncludes, zig_lib_dir: []const u8, target_machine_type: std.coff.MachineType) ![]const []const u8 {
558+
fn getIncludePaths(arena: std.mem.Allocator, auto_includes_option: cli.Options.AutoIncludes, zig_lib_dir: []const u8, target_machine_type: std.coff.IMAGE.FILE.MACHINE) ![]const []const u8 {
559559
if (auto_includes_option == .none) return &[_][]const u8{};
560560

561561
const includes_arch: std.Target.Cpu.Arch = switch (target_machine_type) {
562-
.X64 => .x86_64,
562+
.AMD64 => .x86_64,
563563
.I386 => .x86,
564564
.ARMNT => .thumb,
565565
.ARM64 => .aarch64,

zig/lib/compiler/resinator/preprocess.zig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn preprocess(
1919
var driver: aro.Driver = .{ .comp = comp, .diagnostics = comp.diagnostics, .aro_name = "arocc" };
2020
defer driver.deinit();
2121

22-
var macro_buf: std.ArrayListUnmanaged(u8) = .empty;
22+
var macro_buf: std.ArrayList(u8) = .empty;
2323
defer macro_buf.deinit(comp.gpa);
2424

2525
var discard_buffer: [64]u8 = undefined;
@@ -66,9 +66,7 @@ pub fn preprocess(
6666

6767
if (hasAnyErrors(comp)) return error.PreprocessError;
6868

69-
pp.prettyPrintTokens(writer, .result_only) catch |err| switch (err) {
70-
error.WriteFailed => return error.OutOfMemory,
71-
};
69+
try pp.prettyPrintTokens(writer, .result_only);
7270

7371
if (maybe_dependencies) |dependencies| {
7472
for (comp.sources.values()) |comp_source| {

0 commit comments

Comments
 (0)