authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-25 12:05:33-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-25 12:05:48-04:00
log6cbe589b51c9404a0f485733cbc4e3b46499d480
tree9a11aed02c3a9fe4f6c0ccd5d8160a8d3652a173
parent3869e803318721134170ca8e90190cdfbadbe475
signaturelock-open Commit is signed but in an unrecognized format.

zig cc: support -T linker script option


5 files changed, 17 insertions(+), 1 deletions(-)

src-self-hosted/clang_options_data.zig+8-1
...@@ -5614,7 +5614,14 @@ jspd1("L"),...@@ -5614,7 +5614,14 @@ jspd1("L"),
5614 .psl = false,5614 .psl = false,
5615},5615},
5616joinpd1("R"),5616joinpd1("R"),
5617jspd1("T"),5617.{
5618 .name = "T",
5619 .syntax = .joined_or_separate,
5620 .zig_equivalent = .linker_script,
5621 .pd1 = true,
5622 .pd2 = false,
5623 .psl = false,
5624},
5618jspd1("U"),5625jspd1("U"),
5619jspd1("V"),5626jspd1("V"),
5620joinpd1("W"),5627joinpd1("W"),
src-self-hosted/stage2.zig+1
...@@ -1278,6 +1278,7 @@ pub const ClangArgIterator = extern struct {...@@ -1278,6 +1278,7 @@ pub const ClangArgIterator = extern struct {
1278 optimize,1278 optimize,
1279 debug,1279 debug,
1280 sanitize,1280 sanitize,
1281 linker_script,
1281 };1282 };
12821283
1283 fn init(argv: []const [*:0]const u8) ClangArgIterator {1284 fn init(argv: []const [*:0]const u8) ClangArgIterator {
src/main.cpp+3
...@@ -704,6 +704,9 @@ static int main0(int argc, char **argv) {...@@ -704,6 +704,9 @@ static int main0(int argc, char **argv) {
704 }704 }
705 }705 }
706 break;706 break;
707 case Stage2ClangArgLinkerScript:
708 linker_script = it.only_arg;
709 break;
707 }710 }
708 }711 }
709 // Parse linker args712 // Parse linker args
src/stage2.h+1
...@@ -340,6 +340,7 @@ enum Stage2ClangArg {...@@ -340,6 +340,7 @@ enum Stage2ClangArg {
340 Stage2ClangArgOptimize,340 Stage2ClangArgOptimize,
341 Stage2ClangArgDebug,341 Stage2ClangArgDebug,
342 Stage2ClangArgSanitize,342 Stage2ClangArgSanitize,
343 Stage2ClangArgLinkerScript,
343};344};
344345
345// ABI warning346// ABI warning
tools/update_clang_options.zig+4
...@@ -146,6 +146,10 @@ const known_options = [_]KnownOpt{...@@ -146,6 +146,10 @@ const known_options = [_]KnownOpt{
146 .name = "fsanitize",146 .name = "fsanitize",
147 .ident = "sanitize",147 .ident = "sanitize",
148 },148 },
149 .{
150 .name = "T",
151 .ident = "linker_script",
152 },
149};153};
150154
151const blacklisted_options = [_][]const u8{};155const blacklisted_options = [_][]const u8{};