aboutsummaryrefslogtreecommitdiff
path: root/lib/std/build.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-12-16 16:17:52 -0500
committerGitHub <noreply@github.com>2019-12-16 16:17:52 -0500
commit13cdc137e6389af83f225ab851bf8ef768ebcc69 (patch)
tree34675041bfef45efd3c294f7df9fb244674c6dbf /lib/std/build.zig
parentde0d8885b4623dab14c379fc844ae0b18d9f8405 (diff)
parent839b3a61ad51b385ac28a0123b6cc63d90ef83f8 (diff)
downloadzig-13cdc137e6389af83f225ab851bf8ef768ebcc69.tar.gz
zig-13cdc137e6389af83f225ab851bf8ef768ebcc69.zip
Merge pull request #3570 from ziglang/c-sanitize-undef
use -fsanitize=undefined for C code in safe build modes
Diffstat (limited to 'lib/std/build.zig')
-rw-r--r--lib/std/build.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/std/build.zig b/lib/std/build.zig
index e54a23d8ab..f7e4756e90 100644
--- a/lib/std/build.zig
+++ b/lib/std/build.zig
@@ -1034,6 +1034,7 @@ pub const LibExeObjStep = struct {
disable_gen_h: bool,
bundle_compiler_rt: bool,
disable_stack_probing: bool,
+ disable_sanitize_c: bool,
c_std: Builder.CStd,
override_lib_dir: ?[]const u8,
main_pkg_path: ?[]const u8,
@@ -1183,6 +1184,7 @@ pub const LibExeObjStep = struct {
.disable_gen_h = false,
.bundle_compiler_rt = false,
.disable_stack_probing = false,
+ .disable_sanitize_c = false,
.output_dir = null,
.need_system_paths = false,
.single_threaded = false,
@@ -1822,6 +1824,9 @@ pub const LibExeObjStep = struct {
if (self.disable_stack_probing) {
try zig_args.append("-fno-stack-check");
}
+ if (self.disable_sanitize_c) {
+ try zig_args.append("-fno-sanitize-c");
+ }
switch (self.target) {
.Native => {},