authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2020-03-27 23:23:56-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2020-03-27 23:32:01-07:00
logb0b29b8a2fe57cb501248c1022a24092f4f56f82
tree5be4cbcad8dff6e3c186629b8b8229ea8c12df88
parent12e1c6e21c1d21238450903ad7f8fa4ce52ee758

zig cc: Add support for -Xlinker, --for-linker, --for-linker=


5 files changed, 27 insertions(+), 3 deletions(-)

src-self-hosted/clang_options_data.zig+10-3
...@@ -80,7 +80,14 @@ sepd1("Xassembler"),...@@ -80,7 +80,14 @@ sepd1("Xassembler"),
80sepd1("Xclang"),80sepd1("Xclang"),
81sepd1("Xcuda-fatbinary"),81sepd1("Xcuda-fatbinary"),
82sepd1("Xcuda-ptxas"),82sepd1("Xcuda-ptxas"),
83sepd1("Xlinker"),83.{
84 .name = "Xlinker",
85 .syntax = .separate,
86 .zig_equivalent = .for_linker,
87 .pd1 = true,
88 .pd2 = false,
89 .psl = false,
90},
84sepd1("Xopenmp-target"),91sepd1("Xopenmp-target"),
85sepd1("Xpreprocessor"),92sepd1("Xpreprocessor"),
86flagpd1("Z"),93flagpd1("Z"),
...@@ -1563,7 +1570,7 @@ sepd1("Zlinker-input"),...@@ -1563,7 +1570,7 @@ sepd1("Zlinker-input"),
1563.{1570.{
1564 .name = "for-linker",1571 .name = "for-linker",
1565 .syntax = .separate,1572 .syntax = .separate,
1566 .zig_equivalent = .other,1573 .zig_equivalent = .for_linker,
1567 .pd1 = false,1574 .pd1 = false,
1568 .pd2 = true,1575 .pd2 = true,
1569 .psl = false,1576 .psl = false,
...@@ -4887,7 +4894,7 @@ jspd1("sub_umbrella"),...@@ -4887,7 +4894,7 @@ jspd1("sub_umbrella"),
4887.{4894.{
4888 .name = "for-linker=",4895 .name = "for-linker=",
4889 .syntax = .joined,4896 .syntax = .joined,
4890 .zig_equivalent = .other,4897 .zig_equivalent = .for_linker,
4891 .pd1 = false,4898 .pd1 = false,
4892 .pd2 = true,4899 .pd2 = true,
4893 .psl = false,4900 .psl = false,
src-self-hosted/stage2.zig+1
...@@ -1289,6 +1289,7 @@ pub const ClangArgIterator = extern struct {...@@ -1289,6 +1289,7 @@ pub const ClangArgIterator = extern struct {
1289 no_exceptions,1289 no_exceptions,
1290 rtti,1290 rtti,
1291 no_rtti,1291 no_rtti,
1292 for_linker,
1292 };1293 };
12931294
1294 const Args = struct {1295 const Args = struct {
src/main.cpp+3
...@@ -734,6 +734,9 @@ static int main0(int argc, char **argv) {...@@ -734,6 +734,9 @@ static int main0(int argc, char **argv) {
734 case Stage2ClangArgNoRtti:734 case Stage2ClangArgNoRtti:
735 cpp_rtti = false;735 cpp_rtti = false;
736 break;736 break;
737 case Stage2ClangArgForLinker:
738 linker_args.append(buf_create_from_str(it.only_arg));
739 break;
737 }740 }
738 }741 }
739 // Parse linker args742 // Parse linker args
src/stage2.h+1
...@@ -349,6 +349,7 @@ enum Stage2ClangArg {...@@ -349,6 +349,7 @@ enum Stage2ClangArg {
349 Stage2ClangArgNoExceptions,349 Stage2ClangArgNoExceptions,
350 Stage2ClangArgRtti,350 Stage2ClangArgRtti,
351 Stage2ClangArgNoRtti,351 Stage2ClangArgNoRtti,
352 Stage2ClangArgForLinker,
352};353};
353354
354// ABI warning355// ABI warning
tools/update_clang_options.zig+12
...@@ -78,6 +78,18 @@ const known_options = [_]KnownOpt{...@@ -78,6 +78,18 @@ const known_options = [_]KnownOpt{
78 .name = "Wl,",78 .name = "Wl,",
79 .ident = "wl",79 .ident = "wl",
80 },80 },
81 .{
82 .name = "Xlinker",
83 .ident = "for_linker",
84 },
85 .{
86 .name = "for-linker",
87 .ident = "for_linker",
88 },
89 .{
90 .name = "for-linker=",
91 .ident = "for_linker",
92 },
81 .{93 .{
82 .name = "E",94 .name = "E",
83 .ident = "preprocess",95 .ident = "preprocess",