| author | |
| committer | |
| log | 874b4618ca0a8fcde347e9cbca8e3a0de82d9b4b |
| tree | d90e1a1cd90a9ce1abc6910f16c9790ca81a079b |
| parent | b0b29b8a2fe57cb501248c1022a24092f4f56f82 |
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'5 files changed, 18 insertions(+), 1 deletions(-)
src-self-hosted/clang_options_data.zig+8-1| ... | @@ -4255,7 +4255,14 @@ flagpd1("fno-whole-file"), | ... | @@ -4255,7 +4255,14 @@ flagpd1("fno-whole-file"), |
| 4255 | flagpd1("fwhole-program"), | 4255 | flagpd1("fwhole-program"), |
| 4256 | flagpd1("fno-whole-program"), | 4256 | flagpd1("fno-whole-program"), |
| 4257 | flagpd1("whyload"), | 4257 | flagpd1("whyload"), |
| 4258 | sepd1("z"), | 4258 | .{ |
| 4259 | .name = "z", | ||
| 4260 | .syntax = .separate, | ||
| 4261 | .zig_equivalent = .linker_input_z, | ||
| 4262 | .pd1 = true, | ||
| 4263 | .pd2 = false, | ||
| 4264 | .psl = false, | ||
| 4265 | }, | ||
| 4259 | joinpd1("fsanitize-undefined-strip-path-components="), | 4266 | joinpd1("fsanitize-undefined-strip-path-components="), |
| 4260 | joinpd1("fopenmp-cuda-teams-reduction-recs-num="), | 4267 | joinpd1("fopenmp-cuda-teams-reduction-recs-num="), |
| 4261 | joinpd1("analyzer-config-compatibility-mode="), | 4268 | joinpd1("analyzer-config-compatibility-mode="), |
src-self-hosted/stage2.zig+1| ... | @@ -1290,6 +1290,7 @@ pub const ClangArgIterator = extern struct { | ... | @@ -1290,6 +1290,7 @@ pub const ClangArgIterator = extern struct { |
| 1290 | rtti, | 1290 | rtti, |
| 1291 | no_rtti, | 1291 | no_rtti, |
| 1292 | for_linker, | 1292 | for_linker, |
| 1293 | linker_input_z, | ||
| 1293 | }; | 1294 | }; |
| 1294 | 1295 | ||
| 1295 | const Args = struct { | 1296 | const Args = struct { |
src/main.cpp+4| ... | @@ -737,6 +737,10 @@ static int main0(int argc, char **argv) { | ... | @@ -737,6 +737,10 @@ static int main0(int argc, char **argv) { |
| 737 | case Stage2ClangArgForLinker: | 737 | case Stage2ClangArgForLinker: |
| 738 | linker_args.append(buf_create_from_str(it.only_arg)); | 738 | linker_args.append(buf_create_from_str(it.only_arg)); |
| 739 | break; | 739 | break; |
| 740 | case Stage2ClangArgLinkerInputZ: | ||
| 741 | linker_args.append(buf_create_from_str("-z")); | ||
| 742 | linker_args.append(buf_create_from_str(it.only_arg)); | ||
| 743 | break; | ||
| 740 | } | 744 | } |
| 741 | } | 745 | } |
| 742 | // Parse linker args | 746 | // Parse linker args |
src/stage2.h+1| ... | @@ -350,6 +350,7 @@ enum Stage2ClangArg { | ... | @@ -350,6 +350,7 @@ enum Stage2ClangArg { |
| 350 | Stage2ClangArgRtti, | 350 | Stage2ClangArgRtti, |
| 351 | Stage2ClangArgNoRtti, | 351 | Stage2ClangArgNoRtti, |
| 352 | Stage2ClangArgForLinker, | 352 | Stage2ClangArgForLinker, |
| 353 | Stage2ClangArgLinkerInputZ, | ||
| 353 | }; | 354 | }; |
| 354 | 355 | ||
| 355 | // ABI warning | 356 | // ABI warning |
tools/update_clang_options.zig+4| ... | @@ -90,6 +90,10 @@ const known_options = [_]KnownOpt{ | ... | @@ -90,6 +90,10 @@ const known_options = [_]KnownOpt{ |
| 90 | .name = "for-linker=", | 90 | .name = "for-linker=", |
| 91 | .ident = "for_linker", | 91 | .ident = "for_linker", |
| 92 | }, | 92 | }, |
| 93 | .{ | ||
| 94 | .name = "z", | ||
| 95 | .ident = "linker_input_z", | ||
| 96 | }, | ||
| 93 | .{ | 97 | .{ |
| 94 | .name = "E", | 98 | .name = "E", |
| 95 | .ident = "preprocess", | 99 | .ident = "preprocess", |