mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
test: fix missing _start symbol warning by linking libc in compiler_rt_panic
This commit is contained in:
parent
6f0a613b6f
commit
235e6ac05d
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user