zig cc: integrate with -fstack-check, -fno-stack-check

This commit is contained in:
Andrew Kelley 2022-03-04 18:10:37 -07:00
parent d486a7b811
commit d3648cc030
3 changed files with 28 additions and 2 deletions

View file

@ -3274,7 +3274,14 @@ flagpd1("fno-split-lto-unit"),
flagpd1("fno-split-machine-functions"), flagpd1("fno-split-machine-functions"),
flagpd1("fno-split-stack"), flagpd1("fno-split-stack"),
flagpd1("fno-stack-arrays"), flagpd1("fno-stack-arrays"),
flagpd1("fno-stack-check"), .{
.name = "fno-stack-check",
.syntax = .flag,
.zig_equivalent = .no_stack_check,
.pd1 = true,
.pd2 = false,
.psl = false,
},
flagpd1("fno-stack-clash-protection"), flagpd1("fno-stack-clash-protection"),
flagpd1("fno-stack-protector"), flagpd1("fno-stack-protector"),
flagpd1("fno-stack-size-section"), flagpd1("fno-stack-size-section"),
@ -3555,7 +3562,14 @@ flagpd1("fsplit-lto-unit"),
flagpd1("fsplit-machine-functions"), flagpd1("fsplit-machine-functions"),
flagpd1("fsplit-stack"), flagpd1("fsplit-stack"),
flagpd1("fstack-arrays"), flagpd1("fstack-arrays"),
flagpd1("fstack-check"), .{
.name = "fstack-check",
.syntax = .flag,
.zig_equivalent = .stack_check,
.pd1 = true,
.pd2 = false,
.psl = false,
},
flagpd1("fstack-clash-protection"), flagpd1("fstack-clash-protection"),
flagpd1("fstack-protector"), flagpd1("fstack-protector"),
flagpd1("fstack-protector-all"), flagpd1("fstack-protector-all"),

View file

@ -1393,6 +1393,8 @@ fn buildOutputType(
.no_function_sections => function_sections = false, .no_function_sections => function_sections = false,
.color_diagnostics => color = .on, .color_diagnostics => color = .on,
.no_color_diagnostics => color = .off, .no_color_diagnostics => color = .off,
.stack_check => want_stack_check = true,
.no_stack_check => want_stack_check = false,
.unwind_tables => want_unwind_tables = true, .unwind_tables => want_unwind_tables = true,
.no_unwind_tables => want_unwind_tables = false, .no_unwind_tables => want_unwind_tables = false,
.nostdlib => ensure_libc_on_non_freestanding = false, .nostdlib => ensure_libc_on_non_freestanding = false,
@ -4360,6 +4362,8 @@ pub const ClangArgIterator = struct {
no_function_sections, no_function_sections,
color_diagnostics, color_diagnostics,
no_color_diagnostics, no_color_diagnostics,
stack_check,
no_stack_check,
strip, strip,
exec_model, exec_model,
emit_llvm, emit_llvm,

View file

@ -332,6 +332,14 @@ const known_options = [_]KnownOpt{
.name = "fno-caret-diagnostics", .name = "fno-caret-diagnostics",
.ident = "no_color_diagnostics", .ident = "no_color_diagnostics",
}, },
.{
.name = "fstack-check",
.ident = "stack_check",
},
.{
.name = "fno-stack-check",
.ident = "no_stack_check",
},
.{ .{
.name = "MD", .name = "MD",
.ident = "dep_file", .ident = "dep_file",