authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-04 18:10:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-03-04 18:10:37-07:00
logd3648cc0305ee94e24dd4378376e204587bc6f51
tree473ae60f5a798dad89d64094b37d06c5542915b8
parentd486a7b81188ea1e027334c81589157efde2ad23

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


3 files changed, 28 insertions(+), 2 deletions(-)

src/clang_options_data.zig+16-2
......@@ -3274,7 +3274,14 @@ flagpd1("fno-split-lto-unit"),
32743274flagpd1("fno-split-machine-functions"),
32753275flagpd1("fno-split-stack"),
32763276flagpd1("fno-stack-arrays"),
3277flagpd1("fno-stack-check"),
3277.{
3278 .name = "fno-stack-check",
3279 .syntax = .flag,
3280 .zig_equivalent = .no_stack_check,
3281 .pd1 = true,
3282 .pd2 = false,
3283 .psl = false,
3284},
32783285flagpd1("fno-stack-clash-protection"),
32793286flagpd1("fno-stack-protector"),
32803287flagpd1("fno-stack-size-section"),
......@@ -3555,7 +3562,14 @@ flagpd1("fsplit-lto-unit"),
35553562flagpd1("fsplit-machine-functions"),
35563563flagpd1("fsplit-stack"),
35573564flagpd1("fstack-arrays"),
3558flagpd1("fstack-check"),
3565.{
3566 .name = "fstack-check",
3567 .syntax = .flag,
3568 .zig_equivalent = .stack_check,
3569 .pd1 = true,
3570 .pd2 = false,
3571 .psl = false,
3572},
35593573flagpd1("fstack-clash-protection"),
35603574flagpd1("fstack-protector"),
35613575flagpd1("fstack-protector-all"),
src/main.zig+4
......@@ -1393,6 +1393,8 @@ fn buildOutputType(
13931393 .no_function_sections => function_sections = false,
13941394 .color_diagnostics => color = .on,
13951395 .no_color_diagnostics => color = .off,
1396 .stack_check => want_stack_check = true,
1397 .no_stack_check => want_stack_check = false,
13961398 .unwind_tables => want_unwind_tables = true,
13971399 .no_unwind_tables => want_unwind_tables = false,
13981400 .nostdlib => ensure_libc_on_non_freestanding = false,
......@@ -4360,6 +4362,8 @@ pub const ClangArgIterator = struct {
43604362 no_function_sections,
43614363 color_diagnostics,
43624364 no_color_diagnostics,
4365 stack_check,
4366 no_stack_check,
43634367 strip,
43644368 exec_model,
43654369 emit_llvm,
tools/update_clang_options.zig+8
......@@ -332,6 +332,14 @@ const known_options = [_]KnownOpt{
332332 .name = "fno-caret-diagnostics",
333333 .ident = "no_color_diagnostics",
334334 },
335 .{
336 .name = "fstack-check",
337 .ident = "stack_check",
338 },
339 .{
340 .name = "fno-stack-check",
341 .ident = "no_stack_check",
342 },
335343 .{
336344 .name = "MD",
337345 .ident = "dep_file",