zig build: use stack protector for C code in debug mode
This commit is contained in:
parent
c7d80cc421
commit
c5ca8b51f9
@ -1343,7 +1343,11 @@ pub const CLibExeObjStep = struct {
|
|||||||
%%args.append("-g");
|
%%args.append("-g");
|
||||||
}
|
}
|
||||||
switch (self.build_mode) {
|
switch (self.build_mode) {
|
||||||
builtin.Mode.Debug => {},
|
builtin.Mode.Debug => {
|
||||||
|
%%args.append("-fstack-protector-strong");
|
||||||
|
%%args.append("--param");
|
||||||
|
%%args.append("ssp-buffer-size=4");
|
||||||
|
},
|
||||||
builtin.Mode.ReleaseSafe => {
|
builtin.Mode.ReleaseSafe => {
|
||||||
%%args.append("-O2");
|
%%args.append("-O2");
|
||||||
%%args.append("-D_FORTIFY_SOURCE=2");
|
%%args.append("-D_FORTIFY_SOURCE=2");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user