https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e7071e8fbb3e321579d1…
commit 9e7071e8fbb3e321579d12d4390f41ad110e8427
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Mon Nov 9 17:01:07 2020 +0100
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Mon Nov 16 16:58:10 2020 +0100
[NTOSKRNL] DO not disable optimisations when compiling with CLang
---
ntoskrnl/CMakeLists.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt
index 84125c75c9b..fd093c6ca06 100644
--- a/ntoskrnl/CMakeLists.txt
+++ b/ntoskrnl/CMakeLists.txt
@@ -43,8 +43,10 @@ if(MSVC)
add_target_link_flags(ntoskrnl "/SECTION:.rsrc,!DP") #Accessed from
bugcheck code
add_target_link_flags(ntoskrnl "/SECTION:INIT,ERWD")
else()
- if(GDB)
+ if(GDB AND NOT CLANG)
# Completely disable optimizations when debugging the kernel
+ # Not for CLang, which fails as following in _SEH2_EXCEPT macro:
+ # error: inline assembly requires more registers than available
target_compile_options(ntoskrnl PRIVATE -O0)
set_image_base(ntoskrnl 0x00800000)
else()