summaryrefslogtreecommitdiff
path: root/Kernel/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/CMakeLists.txt')
-rw-r--r--Kernel/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt
index 5059dde24b..eee0c68e9d 100644
--- a/Kernel/CMakeLists.txt
+++ b/Kernel/CMakeLists.txt
@@ -10,6 +10,7 @@ set(KERNEL_SOURCES
ACPI/Initialize.cpp
ACPI/MultiProcessorParser.cpp
ACPI/Parser.cpp
+ AddressSanitizer.cpp
Arch/i386/CPU.cpp
Arch/i386/ProcessorInfo.cpp
Arch/i386/SafeMem.cpp
@@ -307,6 +308,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-asynchronous-unwind-tables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib -nostdinc -nostdinc++")
+# Kernel Address Sanitize (KASAN) implementation is still a work in progress, this option
+# is not currently meant to be used, besides when developing Kernel ASAN support.
+#
+if (ENABLE_KERNEL_ADDRESS_SANITIZER)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=kernel-address")
+endif()
+
add_compile_definitions(KERNEL)
# HACK: This is a workaround for CLion to grok the kernel sources.