mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
zig cc: Support -rtlib=none for disabling compiler-rt.
This commit is contained in:
parent
de8cece6e7
commit
95bb53653d
3 changed files with 24 additions and 2 deletions
|
|
@ -1984,7 +1984,7 @@ flagpsl("MT"),
|
|||
.{
|
||||
.name = "rtlib",
|
||||
.syntax = .separate,
|
||||
.zig_equivalent = .other,
|
||||
.zig_equivalent = .rtlib,
|
||||
.pd1 = false,
|
||||
.pd2 = true,
|
||||
.psl = false,
|
||||
|
|
@ -7331,7 +7331,7 @@ jspd1("iquote"),
|
|||
.{
|
||||
.name = "rtlib=",
|
||||
.syntax = .joined,
|
||||
.zig_equivalent = .other,
|
||||
.zig_equivalent = .rtlib,
|
||||
.pd1 = true,
|
||||
.pd2 = true,
|
||||
.psl = false,
|
||||
|
|
|
|||
14
src/main.zig
14
src/main.zig
|
|
@ -2180,6 +2180,19 @@ fn buildOutputType(
|
|||
fatal("unsupported -undefined option '{s}'", .{it.only_arg});
|
||||
}
|
||||
},
|
||||
.rtlib => {
|
||||
// Unlike Clang, we support `none` for explicitly omitting compiler-rt.
|
||||
if (mem.eql(u8, "none", it.only_arg)) {
|
||||
want_compiler_rt = false;
|
||||
} else if (mem.eql(u8, "compiler-rt", it.only_arg) or
|
||||
mem.eql(u8, "libgcc", it.only_arg))
|
||||
{
|
||||
want_compiler_rt = true;
|
||||
} else {
|
||||
// Note that we don't support `platform`.
|
||||
fatal("unsupported -rtlib option '{s}'", .{it.only_arg});
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
// Parse linker args.
|
||||
|
|
@ -5810,6 +5823,7 @@ pub const ClangArgIterator = struct {
|
|||
san_cov_trace_pc_guard,
|
||||
san_cov,
|
||||
no_san_cov,
|
||||
rtlib,
|
||||
};
|
||||
|
||||
const Args = struct {
|
||||
|
|
|
|||
|
|
@ -548,6 +548,14 @@ const known_options = [_]KnownOpt{
|
|||
.name = "fno-sanitize-coverage",
|
||||
.ident = "no_san_cov",
|
||||
},
|
||||
.{
|
||||
.name = "rtlib",
|
||||
.ident = "rtlib",
|
||||
},
|
||||
.{
|
||||
.name = "rtlib=",
|
||||
.ident = "rtlib",
|
||||
},
|
||||
};
|
||||
|
||||
const blacklisted_options = [_][]const u8{};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue