zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 235e6ac05df95e5dc2656cfb1a33d7b18c45a603 (tree)
parent 6f0a613b6f2d070196d47cb2932f7c728c63542a
Author: kcbanner <kcbanner@gmail.com>
Date:   Sun, 30 Jul 2023 10:43:12 -0400

test: fix missing _start symbol warning by linking libc in compiler_rt_panic

Diffstat:
Mtest/standalone/compiler_rt_panic/build.zig | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/standalone/compiler_rt_panic/build.zig b/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;