Skip to content

Commit

Permalink
macho: test entry in archive with -dead_strip
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Dec 4, 2023
1 parent 3e7b45d commit 957ac46
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions test/macho.zig
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,23 @@ fn testEntryPointArchive(b: *Build, opts: Options) *Step {
const lib = ar(b);
lib.addFileSource(obj.out);

const exe = cc(b, opts);
exe.addArg("-lmain");
exe.addPrefixedDirectorySource("-L", lib.saveOutputAs("libmain.a").dir);
{
const exe = cc(b, opts);
exe.addArg("-lmain");
exe.addPrefixedDirectorySource("-L", lib.saveOutputAs("libmain.a").dir);

const run = exe.run();
test_step.dependOn(run.step());
const run = exe.run();
test_step.dependOn(run.step());
}

{
const exe = cc(b, opts);
exe.addArgs(&.{ "-lmain", "-Wl,-dead_strip" });
exe.addPrefixedDirectorySource("-L", lib.saveOutputAs("libmain.a").dir);

const run = exe.run();
test_step.dependOn(run.step());
}

return test_step;
}
Expand Down

0 comments on commit 957ac46

Please sign in to comment.