Skip to content

Commit

Permalink
[automated] Merge branch 'release/8.0.3xx' => 'release/8.0.4xx' (#20263)
Browse files Browse the repository at this point in the history
  • Loading branch information
v-wuzhai authored Dec 5, 2024
2 parents 5ec6e67 + 591f61e commit eb963a6
Showing 1 changed file with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nikola Milosavljevic <[email protected]>
Date: Tue, 3 Dec 2024 19:24:39 +0000
Subject: [PATCH] Add support for building with Clang 19

Backport: https://github.com/dotnet/runtime/pull/109198
---
src/coreclr/vm/comreflectioncache.hpp | 4 ++++
src/native/libs/CMakeLists.txt | 6 ++++++
2 files changed, 10 insertions(+)

diff --git a/src/coreclr/vm/comreflectioncache.hpp b/src/coreclr/vm/comreflectioncache.hpp
index 08d173e6164..12db55251d8 100644
--- a/src/coreclr/vm/comreflectioncache.hpp
+++ b/src/coreclr/vm/comreflectioncache.hpp
@@ -26,6 +26,7 @@ public:

void Init();

+#ifndef DACCESS_COMPILE
BOOL GetFromCache(Element *pElement, CacheType& rv)
{
CONTRACTL
@@ -102,6 +103,7 @@ public:
AdjustStamp(TRUE);
this->LeaveWrite();
}
+#endif // !DACCESS_COMPILE

private:
// Lock must have been taken before calling this.
@@ -141,6 +143,7 @@ private:
return CacheSize;
}

+#ifndef DACCESS_COMPILE
void AdjustStamp(BOOL hasWriterLock)
{
CONTRACTL
@@ -170,6 +173,7 @@ private:
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 b8ec2cf654c..67f2858647e 100644
--- a/src/native/libs/CMakeLists.txt
+++ b/src/native/libs/CMakeLists.txt
@@ -128,6 +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)
+
+ 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)

0 comments on commit eb963a6

Please sign in to comment.