#error: unrecognized parameter: '-fno-red-zone' when trying to build an executable with build.zig

1 messages · Page 1 of 1 (latest)

plucky turtle
#

So I updated master and I get this error. Maybe it's a cache error but I deleted zig-cache and ~/.cache/zig...
Zig version: 0.11.0-dev.1430+ce6de2df8

Possible problematic commit: https://github.com/ziglang/zig/commit/7ea3937c5a6f63557db99c8a8f7b3f6d3de8c38b

GitHub
  • no longer repeat -lc on the linker line redundantly
  • when using linkLibrary() with a static library, it will now also put
    the static library's static library dependencies on the lin...
velvet basin
#

I just gave you the reasoning why it failed

#

The CLI expects -mno-red-zone but the build step passes -fno-red-zone

plucky turtle
velvet basin
#

It's literally in the code you posted here. Look at the function addFlag, it will prepend the flag with -f. But that's incorrect for red-zone. The CLI should however be updated to also accept -f to make it consistant with other flags.

plucky turtle
#

oh I see, thanks. I should file an issue, right?

velvet basin
#

Or better, a PR to fix it 😛

plucky turtle
#

ok so I do append -mno-red-zone right?

velvet basin
plucky turtle
velvet basin
#

In that case make the build step pass -mno-red-zone instead

plucky turtle
#

done 🙂

#

thank you for the help