Skip to content

Commit

Permalink
work around more CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexicon226 committed Jan 16, 2025
1 parent 4acc809 commit 19d1ec1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/ubsan_rt.zig
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ const Value = extern struct {
) !void {
comptime assert(fmt.len == 0);

if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) {
try writer.writeAll("(unknown)");
return;
}

switch (value.td.kind) {
.integer => {
if (value.td.isSigned()) {
Expand Down Expand Up @@ -626,22 +631,24 @@ fn exportHandler(
handler: anytype,
comptime sym_name: []const u8,
) void {
const linkage = if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) .internal else .weak;
const N = "__ubsan_handle_" ++ sym_name;
@export(handler, .{ .name = N, .linkage = .weak });
@export(handler, .{ .name = N, .linkage = linkage });
}

fn exportHandlerWithAbort(
handler: anytype,
abort_handler: anytype,
comptime sym_name: []const u8,
) void {
const linkage = if (builtin.zig_backend == .stage2_x86_64 and builtin.os.tag == .windows) .internal else .weak;
{
const N = "__ubsan_handle_" ++ sym_name;
@export(handler, .{ .name = N, .linkage = .weak });
@export(handler, .{ .name = N, .linkage = linkage });
}
{
const N = "__ubsan_handle_" ++ sym_name ++ "_abort";
@export(abort_handler, .{ .name = N, .linkage = .weak });
@export(abort_handler, .{ .name = N, .linkage = linkage });
}
}

Expand Down
1 change: 1 addition & 0 deletions test/link/wasm/export/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
no_export.entry = .disabled;
no_export.use_llvm = false;
no_export.use_lld = false;
no_export.bundle_ubsan_rt = false;

const dynamic_export = b.addExecutable(.{
.name = "dynamic",
Expand Down
2 changes: 2 additions & 0 deletions test/link/wasm/function-table/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
export_table.use_lld = false;
export_table.export_table = true;
export_table.link_gc_sections = false;
export_table.bundle_ubsan_rt = false;

const regular_table = b.addExecutable(.{
.name = "regular_table",
Expand All @@ -34,6 +35,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
regular_table.use_llvm = false;
regular_table.use_lld = false;
regular_table.link_gc_sections = false; // Ensure function table is not empty
regular_table.bundle_ubsan_rt = false;

const check_export = export_table.checkObject();
const check_regular = regular_table.checkObject();
Expand Down
1 change: 1 addition & 0 deletions test/link/wasm/shared-memory/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize_mode: std.builtin.Opt
exe.shared_memory = true;
exe.max_memory = 67108864;
exe.root_module.export_symbol_names = &.{"foo"};
exe.bundle_ubsan_rt = false;

const check_exe = exe.checkObject();

Expand Down
1 change: 1 addition & 0 deletions test/link/wasm/type/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize
exe.use_llvm = false;
exe.use_lld = false;
exe.root_module.export_symbol_names = &.{"foo"};
exe.bundle_ubsan_rt = false;
b.installArtifact(exe);

const check_exe = exe.checkObject();
Expand Down

0 comments on commit 19d1ec1

Please sign in to comment.