Skip to content

Commit b63c92f

Browse files
committed
cc,wasi: do not add stack protector
1 parent 3a5d0f7 commit b63c92f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Compilation.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,7 +2896,7 @@ pub fn addCCArgs(
28962896
try argv.append("-D_DEBUG");
28972897
try argv.append("-Og");
28982898

2899-
if (comp.bin_file.options.link_libc) {
2899+
if (comp.bin_file.options.link_libc and target.os.tag != .wasi) {
29002900
try argv.append("-fstack-protector-strong");
29012901
try argv.append("--param");
29022902
try argv.append("ssp-buffer-size=4");
@@ -2908,7 +2908,7 @@ pub fn addCCArgs(
29082908
// See the comment in the BuildModeFastRelease case for why we pass -O2 rather
29092909
// than -O3 here.
29102910
try argv.append("-O2");
2911-
if (comp.bin_file.options.link_libc) {
2911+
if (comp.bin_file.options.link_libc and target.os.tag != .wasi) {
29122912
try argv.append("-D_FORTIFY_SOURCE=2");
29132913
try argv.append("-fstack-protector-strong");
29142914
try argv.append("--param");

src/wasi_libc.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ fn addCCArgs(
234234
try args.appendSlice(&[_][]const u8{
235235
"-std=gnu17",
236236
"-fno-trapping-math",
237+
"-fno-stack-protector",
237238
"-w", // ignore all warnings
238239

239240
o_arg,

0 commit comments

Comments
 (0)