https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e00922a0fe09687bbd7518aa95a9142e457d82d3
commit e00922a0fe09687bbd7518aa95a9142e457d82d3 Author: Jérôme Gardou <jerome.gar...@reactos.org> AuthorDate: Mon Nov 9 09:41:48 2020 +0100 Commit: Jérôme Gardou <zefk...@users.noreply.github.com> CommitDate: Mon Nov 16 16:58:10 2020 +0100 [NTOSKRNL] Link memcmp to the import lib when using CLang CLang performs some optimisations on e.g. strcmp, but memcmp is not exported by ntoskrnl --- ntoskrnl/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ntoskrnl/CMakeLists.txt b/ntoskrnl/CMakeLists.txt index 13ca75e351a..84125c75c9b 100644 --- a/ntoskrnl/CMakeLists.txt +++ b/ntoskrnl/CMakeLists.txt @@ -12,6 +12,11 @@ set(NTKRNLMP_ASM_SOURCE ${ASM_SOURCE}) spec2def(ntoskrnl.exe ntoskrnl.spec ADD_IMPORTLIB) add_asm_files(ntoskrnl_asm ${NTOSKRNL_ASM_SOURCE}) +if (GCC AND CLANG) + # Clang optimises strcmp calls to memcmp. + target_link_libraries(libntoskrnl INTERFACE memcmp) +endif() + list(APPEND PCH_SKIP_SOURCE guid.c)