From dfcedfdca0b1e26d8a735327fe8e42d7887b21b2 Mon Sep 17 00:00:00 2001 From: David Gonzalez Martin Date: Tue, 24 Jan 2023 07:45:33 -0600 Subject: [PATCH] build: Fix red zone flag --- lib/std/build/LibExeObjStep.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/std/build/LibExeObjStep.zig b/lib/std/build/LibExeObjStep.zig index 124fb36a10..d79bd937c0 100644 --- a/lib/std/build/LibExeObjStep.zig +++ b/lib/std/build/LibExeObjStep.zig @@ -1415,7 +1415,13 @@ fn make(step: *Step) !void { try zig_args.append("-fno-stack-check"); } try addFlag(&zig_args, "stack-protector", self.stack_protector); - try addFlag(&zig_args, "red-zone", self.red_zone); + if (self.red_zone) |red_zone| { + if (red_zone) { + try zig_args.append("-mred-zone"); + } else { + try zig_args.append("-mno-red-zone"); + } + } try addFlag(&zig_args, "omit-frame-pointer", self.omit_frame_pointer); try addFlag(&zig_args, "dll-export-fns", self.dll_export_fns);