commit 945111ae92c28f8ad642a64af4dc83acd3bef4a5 (tree)
parent 7b8cc599d997759201a945d05b91c24f5cfe29d7
Author: Jakub Konka <kubkon@jakubkonka.com>
Date: Tue, 6 Sep 2022 17:53:21 +0200
enable testing of x86_64-windows-gnu using self-hosted backend and linker
Diffstat:
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/lib/std/build.zig b/lib/std/build.zig
@@ -1623,6 +1623,7 @@ pub const LibExeObjStep = struct {
/// Overrides the default stack size
stack_size: ?u64 = null,
+ use_unwind_tables: ?bool = null,
want_lto: ?bool = null,
use_stage1: ?bool = null,
use_llvm: ?bool = null,
@@ -2505,6 +2506,14 @@ pub const LibExeObjStep = struct {
}
}
+ if (self.use_unwind_tables) |use_unwind_tables| {
+ if (use_unwind_tables) {
+ try zig_args.append("-funwind-tables");
+ } else {
+ try zig_args.append("-fno-unwind-tables");
+ }
+ }
+
if (self.ofmt) |ofmt| {
try zig_args.append(try std.fmt.allocPrint(builder.allocator, "-ofmt={s}", .{@tagName(ofmt)}));
}
diff --git a/test/tests.zig b/test/tests.zig
@@ -108,6 +108,14 @@ const test_targets = blk: {
},
.backend = .stage2_x86_64,
},
+ .{
+ .target = .{
+ .cpu_arch = .x86_64,
+ .os_tag = .windows,
+ .abi = .gnu,
+ },
+ .backend = .stage2_x86_64,
+ },
.{
.target = .{
@@ -693,6 +701,13 @@ pub fn addPkgTests(
else => {
these_tests.use_stage1 = false;
these_tests.use_llvm = false;
+
+ if (test_target.target.getOsTag() == .windows) {
+ // TODO: We set these to no so that we don't fallback to LLD for incremental linking context. This is because
+ // our own COFF linker doesn't yet support these options.
+ these_tests.emit_implib = .no_emit;
+ these_tests.use_unwind_tables = false;
+ }
},
};