[NTOSKRNL] DO not disable optimisations when compiling with CLang

This commit is contained in:
Jérôme Gardou 2020-11-09 17:01:07 +01:00 committed by Jérôme Gardou
parent 7a52db76c5
commit 9e7071e8fb

View file

@ -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()