Skip to content

Commit cf1a7bb

Browse files
authored
Merge pull request #24193 from jacobly0/x86_64-spring-cleaning
x86_64: increase passing test coverage on windows
2 parents f5a327c + 1f98c98 commit cf1a7bb

File tree

145 files changed

+13032
-8489
lines changed

Some content is hidden

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

145 files changed

+13032
-8489
lines changed

build.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ pub fn build(b: *std.Build) !void {
203203
exe.pie = pie;
204204
exe.entitlements = entitlements;
205205

206+
const use_llvm = b.option(bool, "use-llvm", "Use the llvm backend");
207+
exe.use_llvm = use_llvm;
208+
exe.use_lld = use_llvm;
209+
206210
if (no_bin) {
207211
b.getInstallStep().dependOn(&exe.step);
208212
} else {
@@ -214,10 +218,6 @@ pub fn build(b: *std.Build) !void {
214218

215219
test_step.dependOn(&exe.step);
216220

217-
const use_llvm = b.option(bool, "use-llvm", "Use the llvm backend");
218-
exe.use_llvm = use_llvm;
219-
exe.use_lld = use_llvm;
220-
221221
const exe_options = b.addOptions();
222222
exe.root_module.addOptions("build_options", exe_options);
223223

@@ -759,7 +759,7 @@ fn addCmakeCfgOptionsToExe(
759759
use_zig_libcxx: bool,
760760
) !void {
761761
const mod = exe.root_module;
762-
const target = mod.resolved_target.?.result;
762+
const target = &mod.resolved_target.?.result;
763763

764764
if (target.os.tag.isDarwin()) {
765765
// useful for package maintainers

lib/compiler/resinator/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ fn getIncludePaths(arena: std.mem.Allocator, auto_includes_option: cli.Options.A
525525
};
526526
const target = std.zig.resolveTargetQueryOrFatal(target_query);
527527
const is_native_abi = target_query.isNativeAbi();
528-
const detected_libc = std.zig.LibCDirs.detect(arena, zig_lib_dir, target, is_native_abi, true, null) catch {
528+
const detected_libc = std.zig.LibCDirs.detect(arena, zig_lib_dir, &target, is_native_abi, true, null) catch {
529529
if (includes == .any) {
530530
// fall back to mingw
531531
includes = .gnu;
@@ -550,7 +550,7 @@ fn getIncludePaths(arena: std.mem.Allocator, auto_includes_option: cli.Options.A
550550
};
551551
const target = std.zig.resolveTargetQueryOrFatal(target_query);
552552
const is_native_abi = target_query.isNativeAbi();
553-
const detected_libc = std.zig.LibCDirs.detect(arena, zig_lib_dir, target, is_native_abi, true, null) catch |err| switch (err) {
553+
const detected_libc = std.zig.LibCDirs.detect(arena, zig_lib_dir, &target, is_native_abi, true, null) catch |err| switch (err) {
554554
error.OutOfMemory => |e| return e,
555555
else => return error.MingwIncludesNotFound,
556556
};

lib/compiler_rt/common.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ else
1616
/// Determines the symbol's visibility to other objects.
1717
/// For WebAssembly this allows the symbol to be resolved to other modules, but will not
1818
/// export it to the host runtime.
19-
pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal)
20-
.hidden
19+
pub const visibility: std.builtin.SymbolVisibility = if (linkage == .internal or builtin.link_mode == .dynamic)
20+
.default
2121
else
22-
.default;
22+
.hidden;
2323

2424
pub const PreferredLoadStoreElement = element: {
2525
if (std.simd.suggestVectorLength(u8)) |vec_size| {

lib/compiler_rt/divmodei4.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn divmod(q: ?[]u32, r: ?[]u32, u: []u32, v: []u32) !void {
3535

3636
pub fn __divei4(q_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) void {
3737
@setRuntimeSafety(builtin.is_test);
38-
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
38+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
3939
const q: []u32 = @ptrCast(@alignCast(q_p[0..byte_size]));
4040
const u: []u32 = @ptrCast(@alignCast(u_p[0..byte_size]));
4141
const v: []u32 = @ptrCast(@alignCast(v_p[0..byte_size]));
@@ -44,7 +44,7 @@ pub fn __divei4(q_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) vo
4444

4545
pub fn __modei4(r_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) void {
4646
@setRuntimeSafety(builtin.is_test);
47-
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
47+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
4848
const r: []u32 = @ptrCast(@alignCast(r_p[0..byte_size]));
4949
const u: []u32 = @ptrCast(@alignCast(u_p[0..byte_size]));
5050
const v: []u32 = @ptrCast(@alignCast(v_p[0..byte_size]));

lib/compiler_rt/fixdfei.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ comptime {
1010
}
1111

1212
pub fn __fixdfei(r: [*]u8, bits: usize, a: f64) callconv(.c) void {
13-
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
13+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
1414
return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a);
1515
}

lib/compiler_rt/fixhfei.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ comptime {
1010
}
1111

1212
pub fn __fixhfei(r: [*]u8, bits: usize, a: f16) callconv(.c) void {
13-
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
13+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
1414
return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a);
1515
}

lib/compiler_rt/fixsfei.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ comptime {
1010
}
1111

1212
pub fn __fixsfei(r: [*]u8, bits: usize, a: f32) callconv(.c) void {
13-
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
13+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
1414
return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a);
1515
}

lib/compiler_rt/fixtfei.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ comptime {
1010
}
1111

1212
pub fn __fixtfei(r: [*]u8, bits: usize, a: f128) callconv(.c) void {
13-
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
13+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
1414
return bigIntFromFloat(.signed, @ptrCast(@alignCast(r[0..byte_size])), a);
1515
}

lib/compiler_rt/fixunsdfei.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ comptime {
1010
}
1111

1212
pub fn __fixunsdfei(r: [*]u8, bits: usize, a: f64) callconv(.c) void {
13-
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
13+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
1414
return bigIntFromFloat(.unsigned, @ptrCast(@alignCast(r[0..byte_size])), a);
1515
}

lib/compiler_rt/fixunshfei.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ comptime {
1010
}
1111

1212
pub fn __fixunshfei(r: [*]u8, bits: usize, a: f16) callconv(.c) void {
13-
const byte_size = std.zig.target.intByteSize(builtin.target, @intCast(bits));
13+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
1414
return bigIntFromFloat(.unsigned, @ptrCast(@alignCast(r[0..byte_size])), a);
1515
}

0 commit comments

Comments
 (0)