From c154fe7559ef8e078628ebb63ddd189ec0a323d6 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 25 Dec 2024 22:49:41 +0100 Subject: [PATCH] macho: fix x86_64 tests --- test/macho.zig | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/macho.zig b/test/macho.zig index c09b9f4d..54b75f67 100644 --- a/test/macho.zig +++ b/test/macho.zig @@ -3968,8 +3968,8 @@ fn testUnwindInfoNoSubsectionsX64(b: *Build, opts: Options) *Step { ); a_o.addArg("-c"); - const exe = cc(b, "a.out", opts); - exe.addCSource( + const main_o = cc(b, "main.o", opts); + main_o.addCSource( \\#include \\int foo(); \\int main() { @@ -3977,6 +3977,10 @@ fn testUnwindInfoNoSubsectionsX64(b: *Build, opts: Options) *Step { \\ return 0; \\} ); + main_o.addArg("-c"); + + const exe = cc(b, "a.out", opts); + exe.addFileSource(main_o.getFile()); exe.addFileSource(a_o.getFile()); const run = exe.run(); @@ -4028,8 +4032,8 @@ fn testWeakBind(b: *Build, opts: Options) *Step { test_step.dependOn(&check.step); } - const exe = cc(b, "a.out", opts); - exe.addAsmSource( + const main_o = cc(b, "main.o", opts); + main_o.addAsmSource( \\.globl _main, _weak_external, _weak_external_for_gotpcrel, _weak_external_fn \\.weak_definition _weak_external, _weak_external_for_gotpcrel, _weak_external_fn, _weak_internal, _weak_internal_for_gotpcrel, _weak_internal_fn \\ @@ -4086,6 +4090,10 @@ fn testWeakBind(b: *Build, opts: Options) *Step { \\ .quad 0 \\ .quad _weak_internal_tlv$tlv$init ); + main_o.addArg("-c"); + + const exe = cc(b, "a.out", opts); + exe.addFileSource(main_o.getFile()); exe.addFileSource(lib.getFile()); exe.addPrefixedDirectorySource("-Wl,-rpath,", lib.getDir());