Fix build with clang 10

This commit is contained in:
Omair Majid 2020-02-26 21:56:12 -05:00
parent b18622e4ac
commit 39697ab889
2 changed files with 58 additions and 0 deletions

54
coreclr-clang10.patch Normal file
View File

@ -0,0 +1,54 @@
diff --git a/configurecompiler.cmake b/configurecompiler.cmake
index d769e82f57..4936c8b00d 100644
--- a/configurecompiler.cmake
+++ b/configurecompiler.cmake
@@ -474,6 +474,7 @@ if (CLR_CMAKE_PLATFORM_UNIX)
add_compile_options(-Wno-unused-variable)
add_compile_options(-Wno-unused-value)
add_compile_options(-Wno-unused-function)
+ add_compile_options(-Wno-error=misleading-indentation)
#These seem to indicate real issues
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-invalid-offsetof>)
diff --git a/src/inc/slist.h b/src/inc/slist.h
index f05d763dc6..abebe04d47 100644
--- a/src/inc/slist.h
+++ b/src/inc/slist.h
@@ -160,13 +160,13 @@ public:
void Init()
{
LIMITED_METHOD_CONTRACT;
- m_pHead = &m_link;
+ m_pHead = PTR_SLink(&m_link);
// NOTE :: fHead variable is template argument
// the following code is a compiled in, only if the fHead flag
// is set to false,
if (!fHead)
{
- m_pTail = &m_link;
+ m_pTail = PTR_SLink(&m_link);
}
}
@@ -274,7 +274,7 @@ public:
SLink *ret = SLink::FindAndRemove(m_pHead, GetLink(pObj), &prior);
if (ret == m_pTail)
- m_pTail = prior;
+ m_pTail = PTR_SLink(prior);
return GetObject(ret);
}
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index 08a35c8f62..43eb648a14 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -145,7 +145,7 @@ typedef PVOID NATIVE_LIBRARY_HANDLE;
/******************* Compiler-specific glue *******************************/
#ifndef THROW_DECL
-#if defined(_MSC_VER) || defined(__llvm__) || !defined(__cplusplus)
+#if defined(_MSC_VER) || !defined(__cplusplus)
#define THROW_DECL
#else
#define THROW_DECL throw()

View File

@ -78,6 +78,8 @@ Patch103: corefx-39633-cgroupv2-mountpoints.patch
# Build with with hardening flags, including -pie
Patch200: coreclr-hardening-flags.patch
# Fix build with clang 10
Patch201: coreclr-clang10.patch
# Build with with hardening flags, including -pie
Patch300: core-setup-hardening-flags.patch
@ -112,6 +114,7 @@ BuildRequires: lttng-ust-devel
BuildRequires: make
BuildRequires: openssl-devel
BuildRequires: python3
BuildRequires: systemtap-sdt-devel
BuildRequires: tar
BuildRequires: zlib-devel
@ -347,6 +350,7 @@ popd
pushd src/coreclr.*
%patch200 -p1
%patch201 -p1
popd
pushd src/dotnet-core-setup.*