From 05fb9dc97bf3fef438b0c1beb000c7adea686a67 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Thu, 24 Oct 2024 19:33:14 +0000 Subject: [PATCH 1/2] Add support for building with Clang 19 --- src/coreclr/vm/comreflectioncache.hpp | 4 ++++ src/native/libs/CMakeLists.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/coreclr/vm/comreflectioncache.hpp b/src/coreclr/vm/comreflectioncache.hpp index 08d173e61648c6..12db55251d80d2 100644 --- a/src/coreclr/vm/comreflectioncache.hpp +++ b/src/coreclr/vm/comreflectioncache.hpp @@ -26,6 +26,7 @@ template class ReflectionCache void Init(); +#ifndef DACCESS_COMPILE BOOL GetFromCache(Element *pElement, CacheType& rv) { CONTRACTL @@ -102,6 +103,7 @@ template class ReflectionCache AdjustStamp(TRUE); this->LeaveWrite(); } +#endif // !DACCESS_COMPILE private: // Lock must have been taken before calling this. @@ -141,6 +143,7 @@ template class ReflectionCache return CacheSize; } +#ifndef DACCESS_COMPILE void AdjustStamp(BOOL hasWriterLock) { CONTRACTL @@ -170,6 +173,7 @@ template class ReflectionCache if (!hasWriterLock) this->LeaveWrite(); } +#endif // !DACCESS_COMPILE void UpdateHashTable(SIZE_T hash, int slot) { diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index b8ec2cf654cf1b..ca8590985d6c82 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -128,6 +128,8 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) add_compile_options(-Wno-cast-align) add_compile_options(-Wno-typedef-redefinition) add_compile_options(-Wno-c11-extensions) + add_compile_options(-Wno-pre-c11-compat) # fixes build on Debian + add_compile_options(-Wno-unknown-warning-option) # unknown warning option '-Wno-pre-c11-compat' add_compile_options(-Wno-thread-safety-analysis) if (CLR_CMAKE_TARGET_BROWSER) add_compile_options(-Wno-unsafe-buffer-usage) From 163004a149812a226207ca7fff9477f75d697baf Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Fri, 25 Oct 2024 11:29:51 -0500 Subject: [PATCH 2/2] Update src/native/libs/CMakeLists.txt Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> --- src/native/libs/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/native/libs/CMakeLists.txt b/src/native/libs/CMakeLists.txt index ca8590985d6c82..67f2858647e0fa 100644 --- a/src/native/libs/CMakeLists.txt +++ b/src/native/libs/CMakeLists.txt @@ -128,8 +128,12 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) add_compile_options(-Wno-cast-align) add_compile_options(-Wno-typedef-redefinition) add_compile_options(-Wno-c11-extensions) - add_compile_options(-Wno-pre-c11-compat) # fixes build on Debian - add_compile_options(-Wno-unknown-warning-option) # unknown warning option '-Wno-pre-c11-compat' + + check_c_compiler_flag(-Wpre-c11-compat COMPILER_SUPPORTS_W_PRE_C11_COMPAT) + if (COMPILER_SUPPORTS_W_PRE_C11_COMPAT) + add_compile_options(-Wno-pre-c11-compat) + endif() + add_compile_options(-Wno-thread-safety-analysis) if (CLR_CMAKE_TARGET_BROWSER) add_compile_options(-Wno-unsafe-buffer-usage)