diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index 6a564e7ff9..f0f30fbf3c 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -383,9 +383,11 @@ switch $(HAIKU_ARCH) { } case x86_64 : { - # Kernel lives in the top 2GB of the address space, use kernel code model. - HAIKU_KERNEL_CCFLAGS += -mcmodel=kernel ; - HAIKU_KERNEL_C++FLAGS += -mcmodel=kernel ; + # Kernel lives in the top 2GB of the address space, use kernel code + # model. Also disable the red zone, which cannot be used in kernel + # code due to interrupts. + HAIKU_KERNEL_CCFLAGS += -mcmodel=kernel -mno-red-zone ; + HAIKU_KERNEL_C++FLAGS += -mcmodel=kernel -mno-red-zone ; # Bootloader is 32-bit. HAIKU_BOOT_LINKFLAGS += -m elf_i386_haiku ;