https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03506b90e09caaf44f79d0...
commit 03506b90e09caaf44f79d0930cbae1f6df7008fd Author: Victor Perevertkin victor.perevertkin@reactos.org AuthorDate: Mon Aug 2 00:19:31 2021 +0300 Commit: Victor Perevertkin victor.perevertkin@reactos.org CommitDate: Mon Aug 2 20:23:18 2021 +0300
[MSVCRTEX] Add some routines required for clang optimizations
- Include exp2* in all clang builds - Include __aulldiv for i386 ones
Those are required, at least for clang-cl Release configuration --- sdk/lib/crt/msvcrtex.cmake | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/sdk/lib/crt/msvcrtex.cmake b/sdk/lib/crt/msvcrtex.cmake index 756f0036faa..32d1afc6046 100644 --- a/sdk/lib/crt/msvcrtex.cmake +++ b/sdk/lib/crt/msvcrtex.cmake @@ -43,19 +43,24 @@ else() list(APPEND MSVCRTEX_SOURCE startup/pseudo-reloc.c startup/pseudo-reloc-list.c) - if (CLANG) - # CLang performs some optimisations requiring those funtions - list(APPEND MSVCRTEX_SOURCE - math/exp2.c - math/exp2f.c) - endif() +endif() + +if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + # Clang performs some optimizations requiring those funtions + list(APPEND MSVCRTEX_SOURCE + math/exp2.c + math/exp2f.c + ) endif()
if(ARCH STREQUAL "i386") + # Clang wants __aulldiv for its optimizations list(APPEND MSVCRTEX_ASM_SOURCE except/i386/chkstk_asm.s except/i386/chkstk_ms.s - math/i386/alldiv_asm.s) + math/i386/alldiv_asm.s + math/i386/aulldiv_asm.s + ) if (GCC AND CLANG) list(APPEND MSVCRTEX_ASM_SOURCE math/i386/ceilf.S