Replace local @(no_red_zone) with global -disable-red-zone

This commit is contained in:
gingerBill
2022-02-23 11:29:36 +00:00
parent 493bc653b5
commit 196bd735d4
7 changed files with 17 additions and 18 deletions

View File

@@ -278,6 +278,7 @@ struct BuildContext {
bool copy_file_contents;
RelocMode reloc_mode;
bool disable_red_zone;
u32 cmd_doc_flags;
@@ -1002,6 +1003,13 @@ void init_build_context(TargetMetrics *cross_target) {
bc->threaded_checker = true;
#endif
if (bc->disable_red_zone) {
if (!(bc->metrics.os == TargetOs_freestanding && !is_arch_wasm())) {
gb_printf_err("-disable-red-zone is not support for this target");
gb_exit(1);
}
}
// NOTE(zangent): The linker flags to set the build architecture are different
// across OSs. It doesn't make sense to allocate extra data on the heap