mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
zig cc: Add support for -z
This is only the first step; it makes zig cc recognize -z and append it to the linker args, but the linker arg parsing doesn't support -z yet so it will just give the warning 'unsupported linker arg: -z'
This commit is contained in:
parent
b0b29b8a2f
commit
874b4618ca
@ -4255,7 +4255,14 @@ flagpd1("fno-whole-file"),
|
||||
flagpd1("fwhole-program"),
|
||||
flagpd1("fno-whole-program"),
|
||||
flagpd1("whyload"),
|
||||
sepd1("z"),
|
||||
.{
|
||||
.name = "z",
|
||||
.syntax = .separate,
|
||||
.zig_equivalent = .linker_input_z,
|
||||
.pd1 = true,
|
||||
.pd2 = false,
|
||||
.psl = false,
|
||||
},
|
||||
joinpd1("fsanitize-undefined-strip-path-components="),
|
||||
joinpd1("fopenmp-cuda-teams-reduction-recs-num="),
|
||||
joinpd1("analyzer-config-compatibility-mode="),
|
||||
|
||||
@ -1290,6 +1290,7 @@ pub const ClangArgIterator = extern struct {
|
||||
rtti,
|
||||
no_rtti,
|
||||
for_linker,
|
||||
linker_input_z,
|
||||
};
|
||||
|
||||
const Args = struct {
|
||||
|
||||
@ -737,6 +737,10 @@ static int main0(int argc, char **argv) {
|
||||
case Stage2ClangArgForLinker:
|
||||
linker_args.append(buf_create_from_str(it.only_arg));
|
||||
break;
|
||||
case Stage2ClangArgLinkerInputZ:
|
||||
linker_args.append(buf_create_from_str("-z"));
|
||||
linker_args.append(buf_create_from_str(it.only_arg));
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Parse linker args
|
||||
|
||||
@ -350,6 +350,7 @@ enum Stage2ClangArg {
|
||||
Stage2ClangArgRtti,
|
||||
Stage2ClangArgNoRtti,
|
||||
Stage2ClangArgForLinker,
|
||||
Stage2ClangArgLinkerInputZ,
|
||||
};
|
||||
|
||||
// ABI warning
|
||||
|
||||
@ -90,6 +90,10 @@ const known_options = [_]KnownOpt{
|
||||
.name = "for-linker=",
|
||||
.ident = "for_linker",
|
||||
},
|
||||
.{
|
||||
.name = "z",
|
||||
.ident = "linker_input_z",
|
||||
},
|
||||
.{
|
||||
.name = "E",
|
||||
.ident = "preprocess",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user