From 9f3303c869ea9327defc1297b654ee0ee8bb062a Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Sat, 14 May 2022 13:50:07 +0200 Subject: [PATCH] Kernel: Add -mgeneral-regs-only flag to aarch64 Kernel build With the update to GCC 12.1.0, the compiler now vectorizes code with -O2. This causes vector ops to be emitted, which are not supported in the Kernel. Add the -mgeneral-regs-only flag to force the compiler to not emit floating-point and SIMD ops. --- Kernel/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index 3e38eeaca2..cbefd82de2 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -461,9 +461,13 @@ endif() add_compile_options(-fsigned-char) add_compile_options(-Wno-unknown-warning-option -Wvla -Wnull-dereference) add_compile_options(-fno-rtti -ffreestanding -fbuiltin) + if ("${SERENITY_ARCH}" STREQUAL "i686" OR "${SERENITY_ARCH}" STREQUAL "x86_64") add_compile_options(-mno-80387 -mno-mmx -mno-sse -mno-sse2) +elseif("${SERENITY_ARCH}" STREQUAL "aarch64") + add_compile_options(-mgeneral-regs-only) endif() + add_compile_options(-fno-asynchronous-unwind-tables) add_compile_options(-fstack-protector-strong) add_compile_options(-fno-exceptions)