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 {...@@ -1167,7 +1167,9 @@ pub const LibExeObjStep = struct {
1167 }1167 }
1168 switch (self.build_mode) {1168 switch (self.build_mode) {
1169 builtin.Mode.Debug => {1169 builtin.Mode.Debug => {
1170 if (!self.disable_libc) {1170 if (self.disable_libc) {
1171 %%args.append("-fno-stack-protector");
1172 } else {
1171 %%args.append("-fstack-protector-strong");1173 %%args.append("-fstack-protector-strong");
1172 %%args.append("--param");1174 %%args.append("--param");
1173 %%args.append("ssp-buffer-size=4");1175 %%args.append("ssp-buffer-size=4");
...@@ -1175,7 +1177,9 @@ pub const LibExeObjStep = struct {...@@ -1175,7 +1177,9 @@ pub const LibExeObjStep = struct {
1175 },1177 },
1176 builtin.Mode.ReleaseSafe => {1178 builtin.Mode.ReleaseSafe => {
1177 %%args.append("-O2");1179 %%args.append("-O2");
1178 if (!self.disable_libc) {1180 if (self.disable_libc) {
1181 %%args.append("-fno-stack-protector");
1182 } else {
1179 %%args.append("-D_FORTIFY_SOURCE=2");1183 %%args.append("-D_FORTIFY_SOURCE=2");
1180 %%args.append("-fstack-protector-strong");1184 %%args.append("-fstack-protector-strong");
1181 %%args.append("--param");1185 %%args.append("--param");
...@@ -1184,6 +1188,7 @@ pub const LibExeObjStep = struct {...@@ -1184,6 +1188,7 @@ pub const LibExeObjStep = struct {
1184 },1188 },
1185 builtin.Mode.ReleaseFast => {1189 builtin.Mode.ReleaseFast => {
1186 %%args.append("-O2");1190 %%args.append("-O2");
1191 %%args.append("-fno-stack-protector");
1187 },1192 },
1188 }1193 }
11891194