Commit 235e6ac05d

kcbanner <kcbanner@gmail.com>
2023-07-30 16:43:12
test: fix missing _start symbol warning by linking libc in compiler_rt_panic
1 parent 6f0a613
Changed files (1)
test
standalone
compiler_rt_panic
test/standalone/compiler_rt_panic/build.zig
@@ -7,13 +7,15 @@ pub fn build(b: *std.Build) void {
     const target = b.standardTargetOptions(.{});
     const optimize = b.standardOptimizeOption(.{});
 
-    if (target.getObjectFormat() != .elf) return;
+    const abi = target.getAbi();
+    if (target.getObjectFormat() != .elf or !(abi.isMusl() or abi.isGnu())) return;
 
     const exe = b.addExecutable(.{
         .name = "main",
         .optimize = optimize,
         .target = target,
     });
+    exe.linkLibC();
     exe.addCSourceFile("main.c", &.{});
     exe.link_gc_sections = false;
     exe.bundle_compiler_rt = true;