From aa5ca8388928eb2e08f57a7c85ee3c39ec4b06dc Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 20 Nov 2023 16:18:41 -0500 Subject: [PATCH] Disable the red zone This fixes the interrupt handler from clobbering local variables. --- Rsconscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Rsconscript b/Rsconscript index 6d30ced..2b3d848 100644 --- a/Rsconscript +++ b/Rsconscript @@ -132,7 +132,7 @@ hulk_env = env "hulk", use: %w[ldc2 x86_64-elf-gcc] do |env| -sse4a -ssse3 ] - env["DFLAGS"] += %W[-g -mtriple=x86_64-unknown-elf -mattr=#{cpu_attrs.join(",")} --betterC -release -O3 --wi --enable-cross-module-inlining -code-model=large] + env["DFLAGS"] += %W[-g -mtriple=x86_64-unknown-elf -mattr=#{cpu_attrs.join(",")} --betterC -release -O3 --wi --enable-cross-module-inlining -code-model=large --disable-red-zone] env["D_IMPORT_PATH"] += %w[src] env["D_IMPORT_PATH"] << env.expand("^/src") env["LD"] = "x86_64-elf-gcc" @@ -171,7 +171,7 @@ hello_env = env "hello", use: %w[ldc2 x86_64-w64-mingw32-gcc] do |env| env.Object("^/hulk_bin.o", "^/hulk_bin.S") env.depends("^/hulk_bin.o", hulk_env.expand("^/hulk.bin")) env["sources"] << "^/hulk_bin.o" - env["DFLAGS"] += %w[-g -mtriple=x86_64-unknown-windows-coff --betterC -release -O3 --wi --enable-cross-module-inlining] + env["DFLAGS"] += %w[-g -mtriple=x86_64-unknown-windows-coff --betterC -release -O3 --wi --enable-cross-module-inlining --disable-red-zone] env["D_IMPORT_PATH"] += %w[src uefi-d/source] env["LD"] = "x86_64-w64-mingw32-gcc" env["LDFLAGS"] += %w[-g -nostdlib -Wl,-dll -shared -Wl,--subsystem,10 -e efi_main -Wl,-Map,${_TARGET}.map]