mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 08:33:15 +00:00
Linker: -z<arg> should be equivalent to -z <arg> (#14680)
lld accepts both syntaxes, but we were rejecting (and, before 3f7e9ff597a3514bb1c4f1900027c40682ac9f13, ignoring) the former. In particular, "cargo-zigbuild" was broken since Rust unconditionally adds "-znoexecstack" (not "-z noexecstack") on non-Windows platforms. Co-authored-by: Andrew Kelley <andrew@ziglang.org>
This commit is contained in:
parent
99c11cc8cf
commit
5a7d80a5e7
13
src/main.zig
13
src/main.zig
@ -1955,12 +1955,15 @@ fn buildOutputType(
|
||||
linker_compress_debug_sections = std.meta.stringToEnum(link.CompressDebugSections, arg1) orelse {
|
||||
fatal("expected [none|zlib] after --compress-debug-sections, found '{s}'", .{arg1});
|
||||
};
|
||||
} else if (mem.eql(u8, arg, "-z")) {
|
||||
i += 1;
|
||||
if (i >= linker_args.items.len) {
|
||||
fatal("expected linker extension flag after '{s}'", .{arg});
|
||||
} else if (mem.startsWith(u8, arg, "-z")) {
|
||||
var z_arg = arg[2..];
|
||||
if (z_arg.len == 0) {
|
||||
i += 1;
|
||||
if (i >= linker_args.items.len) {
|
||||
fatal("expected linker extension flag after '{s}'", .{arg});
|
||||
}
|
||||
z_arg = linker_args.items[i];
|
||||
}
|
||||
const z_arg = linker_args.items[i];
|
||||
if (mem.eql(u8, z_arg, "nodelete")) {
|
||||
linker_z_nodelete = true;
|
||||
} else if (mem.eql(u8, z_arg, "notext")) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user