Skip to content

Commit 235e6ac

Browse files
kcbannerandrewrk
authored andcommitted
test: fix missing _start symbol warning by linking libc in compiler_rt_panic
1 parent 6f0a613 commit 235e6ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/standalone/compiler_rt_panic/build.zig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ pub fn build(b: *std.Build) void {
77
const target = b.standardTargetOptions(.{});
88
const optimize = b.standardOptimizeOption(.{});
99

10-
if (target.getObjectFormat() != .elf) return;
10+
const abi = target.getAbi();
11+
if (target.getObjectFormat() != .elf or !(abi.isMusl() or abi.isGnu())) return;
1112

1213
const exe = b.addExecutable(.{
1314
.name = "main",
1415
.optimize = optimize,
1516
.target = target,
1617
});
18+
exe.linkLibC();
1719
exe.addCSourceFile("main.c", &.{});
1820
exe.link_gc_sections = false;
1921
exe.bundle_compiler_rt = true;

0 commit comments

Comments
 (0)