[SDK][NDK] Fix clang 12 compilation

This commit is contained in:
Victor Perevertkin 2021-04-09 03:51:32 +03:00
parent 2587d72ef7
commit c7d1ff4a9d
2 changed files with 9 additions and 4 deletions

View file

@ -47,16 +47,23 @@ add_compile_options("$<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-nostdinc>")
add_compile_options(-mstackrealign)
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
add_compile_options(-fno-aggressive-loop-optimizations)
if (DBG)
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wold-style-declaration>")
endif()
else()
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_compile_options("$<$<COMPILE_LANGUAGE:C>:-Wno-microsoft>")
add_compile_options(-Wno-pragma-pack)
add_compile_options(-fno-associative-math)
add_compile_options(-fcommon)
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0)
# disable "libcall optimization"
# see https://mudongliang.github.io/2020/12/02/undefined-reference-to-stpcpy.html
add_compile_options(-fno-builtin-stpcpy)
endif()
set(CMAKE_LINK_DEF_FILE_FLAG "")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_LINK_LIBRARY_SUFFIX "")

View file

@ -245,7 +245,6 @@ KeSignalCallDpcSynchronize(
// ARC Configuration Functions. Only enabled if you have ARC Support
//
#ifdef _ARC_
CODE_SEG("INIT")
PCONFIGURATION_COMPONENT_DATA
NTAPI
KeFindConfigurationNextEntry(
@ -256,7 +255,6 @@ KeFindConfigurationNextEntry(
_In_ PCONFIGURATION_COMPONENT_DATA *NextLink
);
CODE_SEG("INIT")
PCONFIGURATION_COMPONENT_DATA
NTAPI
KeFindConfigurationEntry(