aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-03-04 18:10:37 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-03-04 18:10:37 -0700
commitd3648cc0305ee94e24dd4378376e204587bc6f51 (patch)
tree473ae60f5a798dad89d64094b37d06c5542915b8 /src
parentd486a7b81188ea1e027334c81589157efde2ad23 (diff)
downloadzig-d3648cc0305ee94e24dd4378376e204587bc6f51.tar.gz
zig-d3648cc0305ee94e24dd4378376e204587bc6f51.zip
zig cc: integrate with -fstack-check, -fno-stack-check
Diffstat (limited to 'src')
-rw-r--r--src/clang_options_data.zig18
-rw-r--r--src/main.zig4
2 files changed, 20 insertions, 2 deletions
diff --git a/src/clang_options_data.zig b/src/clang_options_data.zig
index dbcf0f749f..25cdd04f82 100644
--- a/src/clang_options_data.zig
+++ b/src/clang_options_data.zig
@@ -3274,7 +3274,14 @@ flagpd1("fno-split-lto-unit"),
flagpd1("fno-split-machine-functions"),
flagpd1("fno-split-stack"),
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-protector"),
flagpd1("fno-stack-size-section"),
@@ -3555,7 +3562,14 @@ flagpd1("fsplit-lto-unit"),
flagpd1("fsplit-machine-functions"),
flagpd1("fsplit-stack"),
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-protector"),
flagpd1("fstack-protector-all"),
diff --git a/src/main.zig b/src/main.zig
index cdda56e8ad..ebbbe6da25 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -1393,6 +1393,8 @@ fn buildOutputType(
.no_function_sections => function_sections = false,
.color_diagnostics => color = .on,
.no_color_diagnostics => color = .off,
+ .stack_check => want_stack_check = true,
+ .no_stack_check => want_stack_check = false,
.unwind_tables => want_unwind_tables = true,
.no_unwind_tables => want_unwind_tables = false,
.nostdlib => ensure_libc_on_non_freestanding = false,
@@ -4360,6 +4362,8 @@ pub const ClangArgIterator = struct {
no_function_sections,
color_diagnostics,
no_color_diagnostics,
+ stack_check,
+ no_stack_check,
strip,
exec_model,
emit_llvm,