authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-09-18 15:30:07-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-09-18 15:30:07-04:00
log24b6dcc507c6598351ab817e03027cc60f220f19
tree3064ca3080dc84a75f9265926c993853d79f3902
parent8cb6694752b780035b65b8d8720bac826d0ebea6

std.build: explicitly disable stack protector when nostdlib


1 files changed, 7 insertions(+), 2 deletions(-)

std/build.zig+7-2
......@@ -1167,7 +1167,9 @@ pub const LibExeObjStep = struct {
11671167 }
11681168 switch (self.build_mode) {
11691169 builtin.Mode.Debug => {
1170 if (!self.disable_libc) {
1170 if (self.disable_libc) {
1171 %%args.append("-fno-stack-protector");
1172 } else {
11711173 %%args.append("-fstack-protector-strong");
11721174 %%args.append("--param");
11731175 %%args.append("ssp-buffer-size=4");
......@@ -1175,7 +1177,9 @@ pub const LibExeObjStep = struct {
11751177 },
11761178 builtin.Mode.ReleaseSafe => {
11771179 %%args.append("-O2");
1178 if (!self.disable_libc) {
1180 if (self.disable_libc) {
1181 %%args.append("-fno-stack-protector");
1182 } else {
11791183 %%args.append("-D_FORTIFY_SOURCE=2");
11801184 %%args.append("-fstack-protector-strong");
11811185 %%args.append("--param");
......@@ -1184,6 +1188,7 @@ pub const LibExeObjStep = struct {
11841188 },
11851189 builtin.Mode.ReleaseFast => {
11861190 %%args.append("-O2");
1191 %%args.append("-fno-stack-protector");
11871192 },
11881193 }
11891194