| author | |
| committer | |
| log | 3542dcad33f5e2021caeb897857b7cc3a57f2c23 |
| tree | 0745077b440b586424582e47854e60c564c607d6 |
| parent | 9b97edb01223d83095df35d5651572d796baae39 |
Prior to this change, even if the use specified the sysroot on the
compiler line like so
```
zig cc --sysroot=/path/to/sdk
```
it would only be used as a prefix to include paths and not as a prefix
for `zig ld` linker.3 files changed, 10 insertions(+), 2 deletions(-)
src/clang_options_data.zig+2-2| ... | ... | @@ -1983,7 +1983,7 @@ flagpsl("MT"), |
| 1983 | 1983 | .{ |
| 1984 | 1984 | .name = "sysroot", |
| 1985 | 1985 | .syntax = .separate, |
| 1986 | .zig_equivalent = .other, | |
| 1986 | .zig_equivalent = .sysroot, | |
| 1987 | 1987 | .pd1 = false, |
| 1988 | 1988 | .pd2 = true, |
| 1989 | 1989 | .psl = false, |
| ... | ... | @@ -5970,7 +5970,7 @@ jspd1("undefined"), |
| 5970 | 5970 | .{ |
| 5971 | 5971 | .name = "sysroot=", |
| 5972 | 5972 | .syntax = .joined, |
| 5973 | .zig_equivalent = .other, | |
| 5973 | .zig_equivalent = .sysroot, | |
| 5974 | 5974 | .pd1 = false, |
| 5975 | 5975 | .pd2 = true, |
| 5976 | 5976 | .psl = false, |
src/main.zig+4| ... | ... | @@ -1468,6 +1468,9 @@ fn buildOutputType( |
| 1468 | 1468 | fatal("expected [command|reactor] for -mexec-mode=[value], found '{s}'", .{it.only_arg}); |
| 1469 | 1469 | }; |
| 1470 | 1470 | }, |
| 1471 | .sysroot => { | |
| 1472 | sysroot = it.only_arg; | |
| 1473 | }, | |
| 1471 | 1474 | } |
| 1472 | 1475 | } |
| 1473 | 1476 | // Parse linker args. |
| ... | ... | @@ -4115,6 +4118,7 @@ pub const ClangArgIterator = struct { |
| 4115 | 4118 | strip, |
| 4116 | 4119 | exec_model, |
| 4117 | 4120 | emit_llvm, |
| 4121 | sysroot, | |
| 4118 | 4122 | }; |
| 4119 | 4123 | |
| 4120 | 4124 | const Args = struct { |
tools/update_clang_options.zig+4| ... | ... | @@ -412,6 +412,10 @@ const known_options = [_]KnownOpt{ |
| 412 | 412 | .name = "emit-llvm", |
| 413 | 413 | .ident = "emit_llvm", |
| 414 | 414 | }, |
| 415 | .{ | |
| 416 | .name = "sysroot", | |
| 417 | .ident = "sysroot", | |
| 418 | }, | |
| 415 | 419 | }; |
| 416 | 420 | |
| 417 | 421 | const blacklisted_options = [_][]const u8{}; |