From b63c92f0b9ce7b3876c5f51e12a6ae249dfa4bac Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Thu, 20 May 2021 14:08:28 +0200 Subject: cc,wasi: do not add stack protector --- src/Compilation.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 2af35b7d66..6fd1a2f874 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2896,7 +2896,7 @@ pub fn addCCArgs( try argv.append("-D_DEBUG"); try argv.append("-Og"); - if (comp.bin_file.options.link_libc) { + if (comp.bin_file.options.link_libc and target.os.tag != .wasi) { try argv.append("-fstack-protector-strong"); try argv.append("--param"); try argv.append("ssp-buffer-size=4"); @@ -2908,7 +2908,7 @@ pub fn addCCArgs( // See the comment in the BuildModeFastRelease case for why we pass -O2 rather // than -O3 here. try argv.append("-O2"); - if (comp.bin_file.options.link_libc) { + if (comp.bin_file.options.link_libc and target.os.tag != .wasi) { try argv.append("-D_FORTIFY_SOURCE=2"); try argv.append("-fstack-protector-strong"); try argv.append("--param"); -- cgit v1.2.3