zig cc: support -T linker script option

This commit is contained in:
Andrew Kelley 2020-03-25 12:05:33 -04:00
parent 3869e80331
commit 6cbe589b51
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
5 changed files with 17 additions and 1 deletions

View File

@ -5614,7 +5614,14 @@ jspd1("L"),
.psl = false,
},
joinpd1("R"),
jspd1("T"),
.{
.name = "T",
.syntax = .joined_or_separate,
.zig_equivalent = .linker_script,
.pd1 = true,
.pd2 = false,
.psl = false,
},
jspd1("U"),
jspd1("V"),
joinpd1("W"),

View File

@ -1278,6 +1278,7 @@ pub const ClangArgIterator = extern struct {
optimize,
debug,
sanitize,
linker_script,
};
fn init(argv: []const [*:0]const u8) ClangArgIterator {

View File

@ -704,6 +704,9 @@ static int main0(int argc, char **argv) {
}
}
break;
case Stage2ClangArgLinkerScript:
linker_script = it.only_arg;
break;
}
}
// Parse linker args

View File

@ -340,6 +340,7 @@ enum Stage2ClangArg {
Stage2ClangArgOptimize,
Stage2ClangArgDebug,
Stage2ClangArgSanitize,
Stage2ClangArgLinkerScript,
};
// ABI warning

View File

@ -146,6 +146,10 @@ const known_options = [_]KnownOpt{
.name = "fsanitize",
.ident = "sanitize",
},
.{
.name = "T",
.ident = "linker_script",
},
};
const blacklisted_options = [_][]const u8{};