From 78b29e923459ec517075f9a17eb8f314b05b4237 Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Thu, 30 May 2024 19:20:15 +0300 Subject: [PATCH] Delete -fms-extensions from coreclr native build --- eng/native/configurecompiler.cmake | 5 --- src/coreclr/binder/bindertracing.cpp | 8 ++--- src/coreclr/binder/inc/bindertracing.h | 2 +- src/coreclr/binder/inc/bindresult.hpp | 4 +-- src/coreclr/binder/inc/bindresult.inl | 6 ++-- .../debug/createdump/dumpwritermacho.cpp | 8 ++--- src/coreclr/debug/daccess/daccess.cpp | 4 +-- src/coreclr/debug/daccess/dacimpl.h | 2 +- src/coreclr/debug/di/rsthread.cpp | 4 +++ src/coreclr/debug/di/valuehome.cpp | 12 +++++++ src/coreclr/debug/ee/debugger.cpp | 4 +++ src/coreclr/debug/ee/stdafx.h | 1 - src/coreclr/inc/check.h | 27 ++++++-------- src/coreclr/jit/codegenarmarch.cpp | 18 +++++----- src/coreclr/jit/gentree.h | 2 +- src/coreclr/jit/inductionvariableopts.cpp | 2 +- src/coreclr/jit/jitstd/allocator.h | 4 +-- src/coreclr/jit/utils.cpp | 4 +-- src/coreclr/minipal/minipal.h | 6 ++++ .../nativeaot/Runtime/eventpipe/ds-rt-aot.cpp | 2 +- src/coreclr/nativeaot/Runtime/stressLog.cpp | 10 +++++- src/coreclr/pal/inc/mbusafecrt.h | 10 +----- src/coreclr/pal/inc/pal.h | 36 ++++++------------- src/coreclr/pal/inc/rt/safecrt.h | 23 ------------ .../pal/src/exception/remote-unwind.cpp | 10 ------ src/coreclr/pal/src/exception/seh-unwind.cpp | 10 ------ src/coreclr/pal/src/file/file.cpp | 1 + src/coreclr/pal/src/safecrt/memcpy_s.cpp | 2 +- src/coreclr/pal/src/thread/process.cpp | 2 +- src/coreclr/pal/src/thread/thread.cpp | 9 +---- src/coreclr/tools/superpmi/mcs/verbildump.cpp | 2 +- .../superpmi-shared/errorhandling.cpp | 4 +-- .../superpmi/superpmi-shared/lightweightmap.h | 6 ++-- .../superpmi/superpmi-shared/logging.cpp | 2 +- .../superpmi-shared/methodcontext.cpp | 2 +- .../superpmi/superpmi-shared/simpletimer.cpp | 6 ++-- .../superpmi/superpmi-shared/spmiutil.cpp | 4 +-- .../superpmi/superpmi-shared/standardpch.h | 13 ++++--- .../tools/superpmi/superpmi/cycletimer.cpp | 4 +-- .../tools/superpmi/superpmi/neardiffer.cpp | 2 +- .../tools/superpmi/superpmi/superpmi.cpp | 2 +- src/coreclr/utilcode/md5.cpp | 10 +++--- src/coreclr/utilcode/stacktrace.cpp | 8 ++++- src/coreclr/utilcode/stdafx.h | 1 - src/coreclr/utilcode/stresslog.cpp | 20 +++++++++-- src/coreclr/vm/callconvbuilder.hpp | 2 +- src/coreclr/vm/callsiteinspect.h | 4 +-- src/coreclr/vm/common.h | 9 ----- src/coreclr/vm/dynamicmethod.h | 2 +- src/coreclr/vm/eventtrace.cpp | 4 +++ src/coreclr/vm/gcenv.ee.cpp | 2 +- src/coreclr/vm/gchelpers.cpp | 2 +- src/coreclr/vm/methodtable.cpp | 13 +++++++ src/coreclr/vm/precode.h | 2 +- src/coreclr/vm/spinlock.h | 11 +++--- src/coreclr/vm/tailcallhelp.cpp | 2 +- src/native/external/libunwind-version.txt | 1 + .../external/libunwind/src/os-solaris.c | 2 +- .../libs/System.Native/pal_networking.c | 2 ++ 59 files changed, 179 insertions(+), 203 deletions(-) diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index 8decaa84fe9ad..76c441de6f2f5 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -520,11 +520,6 @@ if (CLR_CMAKE_HOST_UNIX) # Disable frame pointer optimizations so profilers can get better call stacks add_compile_options(-fno-omit-frame-pointer) - # The -fms-extensions enable the stuff like __declspec(uuid()), etc. - add_compile_options(-fms-extensions) - #-fms-compatibility Enable full Microsoft Visual C++ compatibility - #-fms-extensions Accept some non-standard constructs supported by the Microsoft compiler - # Make signed arithmetic overflow of addition, subtraction, and multiplication wrap around # using twos-complement representation (this is normally undefined according to the C++ spec). add_compile_options(-fwrapv) diff --git a/src/coreclr/binder/bindertracing.cpp b/src/coreclr/binder/bindertracing.cpp index 82b31932bd030..66354d16b0197 100644 --- a/src/coreclr/binder/bindertracing.cpp +++ b/src/coreclr/binder/bindertracing.cpp @@ -82,7 +82,7 @@ namespace void PopulateBindRequest(/*inout*/ BinderTracing::AssemblyBindOperation::BindRequest &request) { - AssemblySpec *spec = request.AssemblySpec; + AssemblySpec *spec = request.AssemblySpecPtr; _ASSERTE(spec != nullptr); if (spec->GetName() != nullptr) @@ -172,7 +172,7 @@ namespace BinderTracing // ActivityTracker or EventSource may have triggered the system satellite load, or load of System.Private.CoreLib // Don't track such bindings to avoid potential infinite recursion. - m_ignoreBind = t_AssemblyLoadStartInProgress && (m_bindRequest.AssemblySpec->IsCoreLib() || m_bindRequest.AssemblySpec->IsCoreLibSatellite()); + m_ignoreBind = t_AssemblyLoadStartInProgress && (m_bindRequest.AssemblySpecPtr->IsCoreLib() || m_bindRequest.AssemblySpecPtr->IsCoreLibSatellite()); m_checkedIgnoreBind = true; return m_ignoreBind; } @@ -234,12 +234,12 @@ namespace BinderTracing bool isLastAttempt = appAssembliesAttempt == nullptr; TraceStage(Stage::FindInLoadContext, isLastAttempt && FAILED(m_hr) && SUCCEEDED(inContextAttempt->HResult) ? m_hr : inContextAttempt->HResult, - inContextAttempt->Assembly, + inContextAttempt->AssemblyHolder, mvidMismatch && isLastAttempt ? errorMsg.GetUnicode() : nullptr); } if (appAssembliesAttempt != nullptr) - TraceStage(Stage::ApplicationAssemblies, FAILED(m_hr) && SUCCEEDED(appAssembliesAttempt->HResult) ? m_hr : appAssembliesAttempt->HResult, appAssembliesAttempt->Assembly, mvidMismatch ? errorMsg.GetUnicode() : nullptr); + TraceStage(Stage::ApplicationAssemblies, FAILED(m_hr) && SUCCEEDED(appAssembliesAttempt->HResult) ? m_hr : appAssembliesAttempt->HResult, appAssembliesAttempt->AssemblyHolder, mvidMismatch ? errorMsg.GetUnicode() : nullptr); } void ResolutionAttemptedOperation::TraceStage(Stage stage, HRESULT hr, BINDER_SPACE::Assembly *resultAssembly, const WCHAR *customError) diff --git a/src/coreclr/binder/inc/bindertracing.h b/src/coreclr/binder/inc/bindertracing.h index d4442086ffcfc..d7c1f8cad5cb1 100644 --- a/src/coreclr/binder/inc/bindertracing.h +++ b/src/coreclr/binder/inc/bindertracing.h @@ -34,7 +34,7 @@ namespace BinderTracing struct BindRequest { - AssemblySpec *AssemblySpec; + AssemblySpec *AssemblySpecPtr; SString AssemblyName; SString AssemblyPath; SString RequestingAssembly; diff --git a/src/coreclr/binder/inc/bindresult.hpp b/src/coreclr/binder/inc/bindresult.hpp index 88d1a2f4b221c..5309a3d5cffae 100644 --- a/src/coreclr/binder/inc/bindresult.hpp +++ b/src/coreclr/binder/inc/bindresult.hpp @@ -39,14 +39,14 @@ namespace BINDER_SPACE struct AttemptResult { HRESULT HResult; - ReleaseHolder Assembly; + ReleaseHolder AssemblyHolder; bool Attempted = false; void Set(const AttemptResult *result); void Reset() { - Assembly = nullptr; + AssemblyHolder = nullptr; Attempted = false; } }; diff --git a/src/coreclr/binder/inc/bindresult.inl b/src/coreclr/binder/inc/bindresult.inl index ab4a61c24fbd4..900c8e60658b8 100644 --- a/src/coreclr/binder/inc/bindresult.inl +++ b/src/coreclr/binder/inc/bindresult.inl @@ -99,7 +99,7 @@ void BindResult::SetAttemptResult(HRESULT hr, Assembly *pAssembly, bool isInCont pAssembly->AddRef(); BindResult::AttemptResult &result = isInContext ? m_inContextAttempt : m_applicationAssembliesAttempt; - result.Assembly = pAssembly; + result.AssemblyHolder = pAssembly; result.HResult = hr; result.Attempted = true; } @@ -112,11 +112,11 @@ const BindResult::AttemptResult* BindResult::GetAttempt(bool foundInContext) con void BindResult::AttemptResult::Set(const BindResult::AttemptResult *result) { - BINDER_SPACE::Assembly *assembly = result->Assembly; + BINDER_SPACE::Assembly *assembly = result->AssemblyHolder; if (assembly != nullptr) assembly->AddRef(); - Assembly = assembly; + AssemblyHolder = assembly; HResult = result->HResult; Attempted = result->Attempted; } diff --git a/src/coreclr/debug/createdump/dumpwritermacho.cpp b/src/coreclr/debug/createdump/dumpwritermacho.cpp index 277adadf7a0cc..61fa49259c76b 100644 --- a/src/coreclr/debug/createdump/dumpwritermacho.cpp +++ b/src/coreclr/debug/createdump/dumpwritermacho.cpp @@ -93,7 +93,7 @@ DumpWriter::BuildSegmentLoadCommands() for (const MemoryRegion& memoryRegion : m_crashInfo.MemoryRegions()) { uint64_t size = memoryRegion.Size(); - uint32_t prot = ConvertFlags(memoryRegion.Permissions()); + int32_t prot = ConvertFlags(memoryRegion.Permissions()); segment_command_64 segment = { LC_SEGMENT_64, // uint32_t cmd; @@ -240,8 +240,8 @@ DumpWriter::WriteSegments() // Write the header SpecialThreadInfoHeader header = { {SPECIAL_THREADINFO_SIGNATURE}, - m_crashInfo.Pid(), - m_crashInfo.Threads().size() + static_cast(m_crashInfo.Pid()), + static_cast(m_crashInfo.Threads().size()) }; if (!WriteData(&header, sizeof(header))) { @@ -252,7 +252,7 @@ DumpWriter::WriteSegments() for (const ThreadInfo* thread : m_crashInfo.Threads()) { SpecialThreadInfoEntry entry = { - thread->Tid(), + static_cast(thread->Tid()), thread->GetStackPointer() }; diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp index 09c41e2c84bf9..a50f9f243c2d4 100644 --- a/src/coreclr/debug/daccess/daccess.cpp +++ b/src/coreclr/debug/daccess/daccess.cpp @@ -7913,7 +7913,7 @@ void DacStackReferenceWalker::WalkStack() // Setup GCCONTEXT structs for the stackwalk. GCCONTEXT gcctx = {0}; DacScanContext dsc(this, &mList, mResolvePointers); - dsc.pEnumFunc = DacStackReferenceWalker::GCEnumCallback; + dsc.pEnumFunc = DacStackReferenceWalker::GCEnumCallbackFunc; gcctx.f = DacStackReferenceWalker::GCReportCallback; gcctx.sc = &dsc; @@ -7960,7 +7960,7 @@ CLRDATA_ADDRESS DacStackReferenceWalker::ReadPointer(TADDR addr) } -void DacStackReferenceWalker::GCEnumCallback(LPVOID hCallback, OBJECTREF *pObject, uint32_t flags, DacSlotLocation loc) +void DacStackReferenceWalker::GCEnumCallbackFunc(LPVOID hCallback, OBJECTREF *pObject, uint32_t flags, DacSlotLocation loc) { GCCONTEXT *gcctx = (GCCONTEXT *)hCallback; DacScanContext *dsc = (DacScanContext*)gcctx->sc; diff --git a/src/coreclr/debug/daccess/dacimpl.h b/src/coreclr/debug/daccess/dacimpl.h index 8b1771d7132e3..371999cef323f 100644 --- a/src/coreclr/debug/daccess/dacimpl.h +++ b/src/coreclr/debug/daccess/dacimpl.h @@ -2056,7 +2056,7 @@ class DacStackReferenceWalker : public DefaultCOMImpl 0) { td = popArea[--i]; + #ifdef _MSC_VER __asm fld td + #else + __asm("fldl %0" : "=m" (td)); + #endif } // Save out the modified float area. diff --git a/src/coreclr/debug/ee/debugger.cpp b/src/coreclr/debug/ee/debugger.cpp index 1d15dd9576073..cf091ceaaf58a 100644 --- a/src/coreclr/debug/ee/debugger.cpp +++ b/src/coreclr/debug/ee/debugger.cpp @@ -13962,7 +13962,11 @@ void GenericHijackFuncHelper() // must be naked. // #if defined(TARGET_X86) +#ifdef TARGET_WINDOWS __declspec(naked) +#else +__attribute__((naked)) +#endif #endif // defined (_x86_) void Debugger::GenericHijackFunc(void) { diff --git a/src/coreclr/debug/ee/stdafx.h b/src/coreclr/debug/ee/stdafx.h index 21ef5f0efa329..7a93a1d8e2580 100644 --- a/src/coreclr/debug/ee/stdafx.h +++ b/src/coreclr/debug/ee/stdafx.h @@ -36,4 +36,3 @@ #include "frameinfo.h" #include #include "../inc/common.h" - diff --git a/src/coreclr/inc/check.h b/src/coreclr/inc/check.h index 4e8a6fd42307a..21d717c13e6bb 100644 --- a/src/coreclr/inc/check.h +++ b/src/coreclr/inc/check.h @@ -162,7 +162,6 @@ class CHECK #endif }; - //-------------------------------------------------------------------------------- // These CHECK macros are the correct way to propagate an assertion. These // routines are designed for use inside "Check" routines. Such routines may @@ -535,11 +534,9 @@ CHECK CheckValue(TYPENAME &val) #endif // _PREFAST_ || _PREFIX_ - #define COMPILER_ASSUME(_condition) \ COMPILER_ASSUME_MSG(_condition, "") - //-------------------------------------------------------------------------------- // PREFIX_ASSUME_MSG and PREFAST_ASSUME_MSG are just another name // for COMPILER_ASSUME_MSG @@ -576,18 +573,17 @@ CHECK CheckValue(TYPENAME &val) #define UNREACHABLE() \ UNREACHABLE_MSG("") -#ifdef __llvm__ - -// LLVM complains if a function does not return what it says. -#define UNREACHABLE_RET() do { UNREACHABLE(); return 0; } while (0) -#define UNREACHABLE_MSG_RET(_message) UNREACHABLE_MSG(_message); return 0; - -#else // __llvm__ +#define UNREACHABLE_RET() \ + do { \ + UNREACHABLE(); \ + return 0; \ + } while (0) -#define UNREACHABLE_RET() UNREACHABLE() -#define UNREACHABLE_MSG_RET(_message) UNREACHABLE_MSG(_message) - -#endif // __llvm__ else +#define UNREACHABLE_MSG_RET(_message) \ + do { \ + UNREACHABLE_MSG(_message); \ + return 0; \ + } while (0) #ifdef _DEBUG_IMPL @@ -606,7 +602,6 @@ CHECK CheckValue(TYPENAME &val) #endif - //-------------------------------------------------------------------------------- // STRESS_CHECK represents a check which is included in a free build // @todo: behavior on trigger @@ -704,8 +699,6 @@ CHECK CheckValue(TYPENAME &val) #endif - - //-------------------------------------------------------------------------------- // Common base level checks //-------------------------------------------------------------------------------- diff --git a/src/coreclr/jit/codegenarmarch.cpp b/src/coreclr/jit/codegenarmarch.cpp index 6684939017646..080fe514f25e4 100644 --- a/src/coreclr/jit/codegenarmarch.cpp +++ b/src/coreclr/jit/codegenarmarch.cpp @@ -2120,10 +2120,10 @@ class ProducingStreamBaseInstrs } private: - const regNumber intReg1; - const regNumber intReg2; - const regNumber addrReg; - emitter* const emitter; + const regNumber intReg1; + const regNumber intReg2; + const regNumber addrReg; + class emitter* const emitter; }; class ProducingStream @@ -2213,11 +2213,11 @@ class ProducingStream } private: - const regNumber intReg1; - const regNumber simdReg1; - const regNumber simdReg2; - const regNumber addrReg; - emitter* const emitter; + const regNumber intReg1; + const regNumber simdReg1; + const regNumber simdReg2; + const regNumber addrReg; + class emitter* const emitter; }; class BlockUnrollHelper diff --git a/src/coreclr/jit/gentree.h b/src/coreclr/jit/gentree.h index 578b2f43b349b..21a2e5193b377 100644 --- a/src/coreclr/jit/gentree.h +++ b/src/coreclr/jit/gentree.h @@ -4668,7 +4668,7 @@ struct NewCallArg // The class handle if SignatureType == TYP_STRUCT. CORINFO_CLASS_HANDLE SignatureClsHnd = NO_CLASS_HANDLE; // The type of well known arg - WellKnownArg WellKnownArg = ::WellKnownArg::None; + enum class WellKnownArg WellKnownArg = ::WellKnownArg::None; NewCallArg WellKnown(::WellKnownArg type) const { diff --git a/src/coreclr/jit/inductionvariableopts.cpp b/src/coreclr/jit/inductionvariableopts.cpp index a3487de6757b9..9f9f410ca2f09 100644 --- a/src/coreclr/jit/inductionvariableopts.cpp +++ b/src/coreclr/jit/inductionvariableopts.cpp @@ -39,7 +39,7 @@ class LoopLocalOccurrences struct Occurrence { BasicBlock* Block; - Statement* Statement; + struct Statement* Statement; GenTreeLclVarCommon* Node; Occurrence* Next; }; diff --git a/src/coreclr/jit/jitstd/allocator.h b/src/coreclr/jit/jitstd/allocator.h index b0f0c25293ba2..93d4851f7702a 100644 --- a/src/coreclr/jit/jitstd/allocator.h +++ b/src/coreclr/jit/jitstd/allocator.h @@ -24,7 +24,7 @@ class allocator template struct rebind { - typedef allocator allocator; + typedef class allocator allocator; }; private: @@ -105,7 +105,7 @@ class allocator template struct rebind { - typedef allocator allocator; + typedef class allocator allocator; }; private: diff --git a/src/coreclr/jit/utils.cpp b/src/coreclr/jit/utils.cpp index 7ea584267e900..747082cd5d5c4 100644 --- a/src/coreclr/jit/utils.cpp +++ b/src/coreclr/jit/utils.cpp @@ -1217,8 +1217,8 @@ void NodeCounts::record(genTreeOps oper) struct DumpOnShutdownEntry { - const char* Name; - Dumpable* Dumpable; + const char* Name; + class Dumpable* Dumpable; }; static DumpOnShutdownEntry s_dumpOnShutdown[16]; diff --git a/src/coreclr/minipal/minipal.h b/src/coreclr/minipal/minipal.h index 38ab07ec63c54..f0fa9478c4637 100644 --- a/src/coreclr/minipal/minipal.h +++ b/src/coreclr/minipal/minipal.h @@ -3,6 +3,12 @@ // #include +#ifdef _MSC_VER +#define DEBUG_BREAK __debugbreak() +#else +#define DEBUG_BREAK DebugBreak() +#endif + // Interface between the runtime and platform specific functionality class VMToOSInterface { diff --git a/src/coreclr/nativeaot/Runtime/eventpipe/ds-rt-aot.cpp b/src/coreclr/nativeaot/Runtime/eventpipe/ds-rt-aot.cpp index 06cffb449d272..cf0878f3cf20b 100644 --- a/src/coreclr/nativeaot/Runtime/eventpipe/ds-rt-aot.cpp +++ b/src/coreclr/nativeaot/Runtime/eventpipe/ds-rt-aot.cpp @@ -56,7 +56,7 @@ aot_ipc_get_process_id_disambiguation_key( // since the start of the Unix epoch). struct kinfo_proc info = {}; size_t size = sizeof (info); - int mib [4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_id }; + int mib [4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, (int)process_id }; const int result_sysctl = sysctl (mib, sizeof(mib)/sizeof(*mib), &info, &size, NULL, 0); if (result_sysctl == 0) { diff --git a/src/coreclr/nativeaot/Runtime/stressLog.cpp b/src/coreclr/nativeaot/Runtime/stressLog.cpp index e01eddd2d9133..5b165a24332c8 100644 --- a/src/coreclr/nativeaot/Runtime/stressLog.cpp +++ b/src/coreclr/nativeaot/Runtime/stressLog.cpp @@ -45,7 +45,15 @@ GPTR_IMPL(StressLog, g_pStressLog /*, &StressLog::theLog*/); variable-speed CPUs (for power management), this is not accurate, but may be good enough. */ -inline __declspec(naked) uint64_t getTimeStamp() { + +inline +#ifdef TARGET_WINDOWS +__declspec(naked) +#else +__attribute__((naked)) +#endif +uint64_t getTimeStamp() +{ __asm { RDTSC // read time stamp counter diff --git a/src/coreclr/pal/inc/mbusafecrt.h b/src/coreclr/pal/inc/mbusafecrt.h index 0dfb02752e2ee..182fa7d956914 100644 --- a/src/coreclr/pal/inc/mbusafecrt.h +++ b/src/coreclr/pal/inc/mbusafecrt.h @@ -30,14 +30,6 @@ typedef int errno_t; // define the return value for success #define SAFECRT_SUCCESS 0 -#ifndef THROW_DECL -#if defined(_MSC_VER) || defined(__llvm__) || !defined(__cplusplus) -#define THROW_DECL -#else -#define THROW_DECL throw() -#endif // !_MSC_VER -#endif // !THROW_DECL - #ifdef __cplusplus extern "C" { #endif @@ -75,7 +67,7 @@ extern int _vsnprintf_s( char* string, size_t sizeInBytes, size_t count, const c extern int sscanf_s( const char *string, const char *format, ... ); extern int swscanf_s( const WCHAR *string, const WCHAR *format, ... ); -extern errno_t memcpy_s( void * dst, size_t sizeInBytes, const void * src, size_t count ) THROW_DECL; +extern errno_t memcpy_s( void * dst, size_t sizeInBytes, const void * src, size_t count ); extern errno_t memmove_s( void * dst, size_t sizeInBytes, const void * src, size_t count ); extern errno_t _wcslwr_s(char16_t *string, size_t sz); diff --git a/src/coreclr/pal/inc/pal.h b/src/coreclr/pal/inc/pal.h index c64cf8ee020ad..920c44f98cd4c 100644 --- a/src/coreclr/pal/inc/pal.h +++ b/src/coreclr/pal/inc/pal.h @@ -49,6 +49,12 @@ Module Name: #include #include #include +#if defined(__has_include) + +#if __has_include() +#include +#endif // __has_include(alloca.h) +#endif // defined(__has_include) #ifdef __cplusplus extern "C++" @@ -118,20 +124,6 @@ extern bool g_arm64_atomics_present; #define LANG_ENGLISH 0x09 /******************* Compiler-specific glue *******************************/ -#ifndef THROW_DECL -#if defined(_MSC_VER) || !defined(__cplusplus) -#define THROW_DECL -#else -#define THROW_DECL throw() -#endif // !_MSC_VER -#endif // !THROW_DECL - -#ifdef __sun -#define MATH_THROW_DECL -#else -#define MATH_THROW_DECL THROW_DECL -#endif - #if defined(_MSC_VER) #define DECLSPEC_ALIGN(x) __declspec(align(x)) #else @@ -167,19 +159,11 @@ extern bool g_arm64_atomics_present; #ifndef NOOPT_ATTRIBUTE #if defined(__llvm__) #define NOOPT_ATTRIBUTE optnone -#elif defined(__GNUC__) +#else #define NOOPT_ATTRIBUTE optimize("O0") #endif #endif -#ifndef NODEBUG_ATTRIBUTE -#if defined(__llvm__) -#define NODEBUG_ATTRIBUTE __nodebug__ -#elif defined(__GNUC__) -#define NODEBUG_ATTRIBUTE __artificial__ -#endif -#endif - #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) (0) #endif @@ -3854,7 +3838,7 @@ PAL_GetCurrentThreadAffinitySet(SIZE_T size, UINT_PTR* data); // errno_t is only defined when the Secure CRT Extensions library is available (which no standard library that we build with implements anyway) typedef int errno_t; -PALIMPORT DLLEXPORT errno_t __cdecl memcpy_s(void *, size_t, const void *, size_t) THROW_DECL; +PALIMPORT DLLEXPORT errno_t __cdecl memcpy_s(void *, size_t, const void *, size_t); PALIMPORT errno_t __cdecl memmove_s(void *, size_t, const void *, size_t); PALIMPORT DLLEXPORT int __cdecl _wcsicmp(const WCHAR *, const WCHAR*); PALIMPORT int __cdecl _wcsnicmp(const WCHAR *, const WCHAR *, size_t); @@ -3914,7 +3898,7 @@ inline WCHAR *PAL_wcsstr(WCHAR* S, const WCHAR* P) } #endif -#if !__has_builtin(_rotl) +#if !__has_builtin(_rotl) && !defined(_rotl) /*++ Function: _rotl @@ -3934,7 +3918,7 @@ unsigned int __cdecl _rotl(unsigned int value, int shift) } #endif // !__has_builtin(_rotl) -#if !__has_builtin(_rotr) +#if !__has_builtin(_rotr) && !defined(_rotr) /*++ Function: diff --git a/src/coreclr/pal/inc/rt/safecrt.h b/src/coreclr/pal/inc/rt/safecrt.h index df31623d903c8..4ee17f4fef126 100644 --- a/src/coreclr/pal/inc/rt/safecrt.h +++ b/src/coreclr/pal/inc/rt/safecrt.h @@ -1097,29 +1097,6 @@ errno_t __cdecl _wcsnset_s(WCHAR *_Dst, size_t _SizeInWords, WCHAR _Value, size_ #endif -/* wcsnlen */ -extern -size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize); - -#if _SAFECRT_USE_INLINES || _SAFECRT_IMPL - -_SAFECRT__INLINE -size_t __cdecl wcsnlen(const WCHAR *inString, size_t inMaxSize) -{ - size_t n; - - /* Note that we do not check if s == nullptr, because we do not - * return errno_t... - */ - - for (n = 0; n < inMaxSize && *inString; n++, inString++) - ; - - return n; -} - -#endif - /* _wmakepath_s */ _SAFECRT__EXTERN_C errno_t __cdecl _wmakepath_s(WCHAR *_Dst, size_t _SizeInWords, const WCHAR *_Drive, const WCHAR *_Dir, const WCHAR *_Filename, const WCHAR *_Ext); diff --git a/src/coreclr/pal/src/exception/remote-unwind.cpp b/src/coreclr/pal/src/exception/remote-unwind.cpp index 4322143e2b737..4713d1efaffee 100644 --- a/src/coreclr/pal/src/exception/remote-unwind.cpp +++ b/src/coreclr/pal/src/exception/remote-unwind.cpp @@ -60,17 +60,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define MACOS_ARM64_POINTER_AUTH_MASK 0x7fffffffffffull #endif -// Sub-headers included from the libunwind.h contain an empty struct -// and clang issues a warning. Until the libunwind is fixed, disable -// the warning. -#ifdef __llvm__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wextern-c-compat" -#endif #include -#ifdef __llvm__ -#pragma clang diagnostic pop -#endif SET_DEFAULT_DEBUG_CHANNEL(EXCEPT); diff --git a/src/coreclr/pal/src/exception/seh-unwind.cpp b/src/coreclr/pal/src/exception/seh-unwind.cpp index 5b12af8aa027b..71e94f929cf33 100644 --- a/src/coreclr/pal/src/exception/seh-unwind.cpp +++ b/src/coreclr/pal/src/exception/seh-unwind.cpp @@ -24,17 +24,7 @@ Module Name: #include #define UNW_LOCAL_ONLY -// Sub-headers included from the libunwind.h contain an empty struct -// and clang issues a warning. Until the libunwind is fixed, disable -// the warning. -#ifdef __llvm__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wextern-c-compat" -#endif #include -#ifdef __llvm__ -#pragma clang diagnostic pop -#endif #else // HOST_UNIX #include diff --git a/src/coreclr/pal/src/file/file.cpp b/src/coreclr/pal/src/file/file.cpp index 23910c83fe0c1..23d99e4dbd497 100644 --- a/src/coreclr/pal/src/file/file.cpp +++ b/src/coreclr/pal/src/file/file.cpp @@ -35,6 +35,7 @@ SET_DEFAULT_DEBUG_CHANNEL(FILE); // some headers have code with asserts, so do t #include #include #include +#include using namespace CorUnix; diff --git a/src/coreclr/pal/src/safecrt/memcpy_s.cpp b/src/coreclr/pal/src/safecrt/memcpy_s.cpp index b4b83da74cc80..cef208affbcdc 100644 --- a/src/coreclr/pal/src/safecrt/memcpy_s.cpp +++ b/src/coreclr/pal/src/safecrt/memcpy_s.cpp @@ -53,7 +53,7 @@ DLLEXPORT errno_t __cdecl memcpy_s( size_t sizeInBytes, const void * src, size_t count -) THROW_DECL +) { if (count == 0) { diff --git a/src/coreclr/pal/src/thread/process.cpp b/src/coreclr/pal/src/thread/process.cpp index 033996645cb5e..d0e9b8d871a30 100644 --- a/src/coreclr/pal/src/thread/process.cpp +++ b/src/coreclr/pal/src/thread/process.cpp @@ -1629,7 +1629,7 @@ GetProcessIdDisambiguationKey(DWORD processId, UINT64 *disambiguationKey) // since the start of the Unix epoch). struct kinfo_proc info = {}; size_t size = sizeof(info); - int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, processId }; + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, (int)processId }; int ret = ::sysctl(mib, sizeof(mib)/sizeof(*mib), &info, &size, nullptr, 0); if (ret == 0) diff --git a/src/coreclr/pal/src/thread/thread.cpp b/src/coreclr/pal/src/thread/thread.cpp index 07be09edaf252..efdea21f79d0a 100644 --- a/src/coreclr/pal/src/thread/thread.cpp +++ b/src/coreclr/pal/src/thread/thread.cpp @@ -2,19 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. /*++ - - - Module Name: - thread.cpp Abstract: - Thread object and core APIs - - - --*/ #include "pal/dbgmsg.h" @@ -48,6 +40,7 @@ SET_DEFAULT_DEBUG_CHANNEL(THREAD); // some headers have code with asserts, so do #define UNDEF_KERNEL #endif #include +#include #ifdef UNDEF_KERNEL #undef _KERNEL #endif diff --git a/src/coreclr/tools/superpmi/mcs/verbildump.cpp b/src/coreclr/tools/superpmi/mcs/verbildump.cpp index 3619fe6fbc6b2..b5d80c9a21084 100644 --- a/src/coreclr/tools/superpmi/mcs/verbildump.cpp +++ b/src/coreclr/tools/superpmi/mcs/verbildump.cpp @@ -103,7 +103,7 @@ void DumpPrimToConsoleBare(MethodContext* mc, CorInfoType prim, DWORDLONG classH return; default: LogWarning("unknown type in PrimToString(0x%x)", prim); - __debugbreak(); + DEBUG_BREAK; return; } } diff --git a/src/coreclr/tools/superpmi/superpmi-shared/errorhandling.cpp b/src/coreclr/tools/superpmi/superpmi-shared/errorhandling.cpp index ceba2ef3ea286..69ce2106cf7ad 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/errorhandling.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/errorhandling.cpp @@ -16,7 +16,7 @@ void MSC_ONLY(__declspec(noreturn)) ThrowSpmiException(DWORD exceptionCode, va_l _vsnprintf_s(buffer, 8192, 8191, message, args); if (BreakOnException()) - __debugbreak(); + DEBUG_BREAK; ULONG_PTR exArgs[1]; exArgs[0] = (ULONG_PTR)buffer; @@ -42,7 +42,7 @@ void MSC_ONLY(__declspec(noreturn)) ThrowSpmiException(DWORD exceptionCode, cons void MSC_ONLY(__declspec(noreturn)) ThrowRecordedException(DWORD innerExceptionCode) { if (BreakOnException()) - __debugbreak(); + DEBUG_BREAK; ULONG_PTR args[1]; args[0] = (ULONG_PTR)innerExceptionCode; diff --git a/src/coreclr/tools/superpmi/superpmi-shared/lightweightmap.h b/src/coreclr/tools/superpmi/superpmi-shared/lightweightmap.h index 28b61e6eb8eb4..9cad6233ea354 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/lightweightmap.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/lightweightmap.h @@ -59,7 +59,7 @@ class LightWeightMapBuffer if (locked) { LogError("Added item that extended the buffer after it was locked by a call to GetBuffer()"); - __debugbreak(); + DEBUG_BREAK; } unsigned int newbuffsize = bufferLength + sizeof(unsigned int) + len; @@ -86,7 +86,7 @@ class LightWeightMapBuffer if (locked) { LogError("Added item that extended the buffer after it was locked by a call to GetBuffer()"); - __debugbreak(); + DEBUG_BREAK; } unsigned int newbuffsize = bufferLength + sizeof(unsigned int) + len; @@ -380,7 +380,7 @@ class LightWeightMap : public LightWeightMapBuffer if (insert != (unsigned int)first) { LogDebug("index = %u f %u mid = %u l %u***************************", insert, first, mid, last); - __debugbreak(); + DEBUG_BREAK; } if (numItems > 0) diff --git a/src/coreclr/tools/superpmi/superpmi-shared/logging.cpp b/src/coreclr/tools/superpmi/superpmi-shared/logging.cpp index 99da9e364de5a..e72e9b130275e 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/logging.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/logging.cpp @@ -171,7 +171,7 @@ void Logger::LogVprintf( if (!s_initialized) { fprintf(stderr, "ERROR: [Logger::LogVprintf] Invoked the logging system before initializing it.\n"); - __debugbreak(); + DEBUG_BREAK; } // Early out if we're not logging at this level. diff --git a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp index 0500096cef9df..c4ce663817f5f 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp @@ -638,7 +638,7 @@ unsigned int toCorInfoSize(CorInfoType cit) case CORINFO_TYPE_UNDEF: case CORINFO_TYPE_VOID: default: - __debugbreak(); + DEBUG_BREAK; return 0; } return -1; diff --git a/src/coreclr/tools/superpmi/superpmi-shared/simpletimer.cpp b/src/coreclr/tools/superpmi/superpmi-shared/simpletimer.cpp index cad98f4048ce7..3a21e77029e12 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/simpletimer.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/simpletimer.cpp @@ -14,7 +14,7 @@ SimpleTimer::SimpleTimer() if (retVal == FALSE) { LogDebug("SimpleTimer::SimpleTimer unable to QPF. error was 0x%08x", ::GetLastError()); - ::__debugbreak(); + DEBUG_BREAK; } } @@ -28,7 +28,7 @@ void SimpleTimer::Start() if (retVal == FALSE) { LogDebug("SimpleTimer::Start unable to QPC. error was 0x%08x", ::GetLastError()); - ::__debugbreak(); + DEBUG_BREAK; } } @@ -38,7 +38,7 @@ void SimpleTimer::Stop() if (retVal == FALSE) { LogDebug("SimpleTimer::Stop unable to QPC. error was 0x%08x", ::GetLastError()); - ::__debugbreak(); + DEBUG_BREAK; } } diff --git a/src/coreclr/tools/superpmi/superpmi-shared/spmiutil.cpp b/src/coreclr/tools/superpmi/superpmi-shared/spmiutil.cpp index bb3c93e6e50b6..b8dd629bb6c9b 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/spmiutil.cpp +++ b/src/coreclr/tools/superpmi/superpmi-shared/spmiutil.cpp @@ -38,9 +38,9 @@ void DebugBreakorAV(int val) if (IsDebuggerPresent()) { if (val == 0) - __debugbreak(); + DEBUG_BREAK; if (BreakOnDebugBreakorAV()) - __debugbreak(); + DEBUG_BREAK; } int exception_code = EXCEPTIONCODE_DebugBreakorAV + val; diff --git a/src/coreclr/tools/superpmi/superpmi-shared/standardpch.h b/src/coreclr/tools/superpmi/superpmi-shared/standardpch.h index 9b926556fdbb6..e18cb57a76a00 100644 --- a/src/coreclr/tools/superpmi/superpmi-shared/standardpch.h +++ b/src/coreclr/tools/superpmi/superpmi-shared/standardpch.h @@ -9,6 +9,12 @@ // itself are probably inappropriate, because if you change them, the entire // project will require a recompile. Generally just put SDK style stuff here... +#ifdef _MSC_VER +#define DEBUG_BREAK __debugbreak() +#else +#define DEBUG_BREAK DebugBreak() +#endif + #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif // WIN32_LEAN_AND_MEAN @@ -110,13 +116,6 @@ #define DEFAULT_REAL_JIT_NAME_A MAKEDLLNAME_A("clrjit2") #define DEFAULT_REAL_JIT_NAME_W MAKEDLLNAME_W("clrjit2") -#if !defined(_MSC_VER) && !defined(__llvm__) -static inline void __debugbreak() -{ - DebugBreak(); -} -#endif - using std::min; using std::max; diff --git a/src/coreclr/tools/superpmi/superpmi/cycletimer.cpp b/src/coreclr/tools/superpmi/superpmi/cycletimer.cpp index d5f44c2f67c02..6e0e8a9adc5e4 100644 --- a/src/coreclr/tools/superpmi/superpmi/cycletimer.cpp +++ b/src/coreclr/tools/superpmi/superpmi/cycletimer.cpp @@ -22,7 +22,7 @@ void CycleTimer::Start() if (retVal == FALSE) { LogError("CycleTimer::Start unable to QPC. error was 0x%08x", ::GetLastError()); - ::__debugbreak(); + DEBUG_BREAK; } } @@ -33,7 +33,7 @@ void CycleTimer::Stop() if (retVal == FALSE) { LogError("CycleTimer::Stop unable to QPC. error was 0x%08x", ::GetLastError()); - ::__debugbreak(); + DEBUG_BREAK; } } diff --git a/src/coreclr/tools/superpmi/superpmi/neardiffer.cpp b/src/coreclr/tools/superpmi/superpmi/neardiffer.cpp index 93e9dc25f78a6..aacf90707fdb5 100644 --- a/src/coreclr/tools/superpmi/superpmi/neardiffer.cpp +++ b/src/coreclr/tools/superpmi/superpmi/neardiffer.cpp @@ -1129,7 +1129,7 @@ bool NearDiffer::compareVars(MethodContext* mc, CompileResult* cr1, CompileResul if (ftn_1 != ftn_2) { // We would like to find out this situation - __debugbreak(); + DEBUG_BREAK; LogVerbose("compareVars found non-matching CORINFO_METHOD_HANDLE %p %p", ftn_1, ftn_2); return false; } diff --git a/src/coreclr/tools/superpmi/superpmi/superpmi.cpp b/src/coreclr/tools/superpmi/superpmi/superpmi.cpp index f0b4b76fcc1c1..1286a06ef03b3 100644 --- a/src/coreclr/tools/superpmi/superpmi/superpmi.cpp +++ b/src/coreclr/tools/superpmi/superpmi/superpmi.cpp @@ -518,7 +518,7 @@ int __cdecl main(int argc, char* argv[]) { if (o.indexCount == -1) LogInfo("HINT: to repro add '-c %d' to cmdline", reader->GetMethodContextIndex()); - __debugbreak(); + DEBUG_BREAK; } } diff --git a/src/coreclr/utilcode/md5.cpp b/src/coreclr/utilcode/md5.cpp index cc86a48bedc2c..1a68e66455e74 100644 --- a/src/coreclr/utilcode/md5.cpp +++ b/src/coreclr/utilcode/md5.cpp @@ -12,6 +12,7 @@ #include "stdmacros.h" #include "md5.h" #include "contract.h" +#include void MD5::Init(BOOL fConstructed) { @@ -141,11 +142,12 @@ void MD5::GetHashValue(MD5HASHDATA* phash) // // but our compiler has an intrinsic! - #if (defined(HOST_X86) || defined(HOST_ARM) || !defined(__clang__)) && defined(TARGET_UNIX) - #define ROL(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - #define ROTATE_LEFT(x,n) (x) = ROL(x,n) + #if defined(TARGET_WINDOWS) + #define ROTATE_LEFT(x, n) (x) = _lrotl(x, n) + #elif __has_builtin(__builtin_rotateleft) + #define ROTATE_LEFT(x, n) ((x) = __builtin_rotateleft(x, n)) #else - #define ROTATE_LEFT(x,n) (x) = _lrotl(x,n) + #define ROTATE_LEFT(x, n) ((x) = ((x << (n)) | (x >> (sizeof(x) * 8 - (n))))) #endif //////////////////////////////////////////////////////////////// diff --git a/src/coreclr/utilcode/stacktrace.cpp b/src/coreclr/utilcode/stacktrace.cpp index 028ca7d60aa40..62493db0c81ca 100644 --- a/src/coreclr/utilcode/stacktrace.cpp +++ b/src/coreclr/utilcode/stacktrace.cpp @@ -955,7 +955,13 @@ void MagicDeinit(void) * Exactly the contents of RtlCaptureContext for Win7 - Win2K doesn't * support this, so we need it for CoreCLR 4, if we require Win2K support ****************************************************************************/ -extern "C" __declspec(naked) void __stdcall +extern "C" +#ifdef TARGET_WINDOWS +__declspec(naked) +#else +__attribute__((naked)) +#endif +void __stdcall ClrCaptureContext(_Out_ PCONTEXT ctx) { __asm { diff --git a/src/coreclr/utilcode/stdafx.h b/src/coreclr/utilcode/stdafx.h index 78e9840575819..3f721e1de2fab 100644 --- a/src/coreclr/utilcode/stdafx.h +++ b/src/coreclr/utilcode/stdafx.h @@ -22,4 +22,3 @@ using std::max; #include "volatile.h" #include "static_assert.h" - diff --git a/src/coreclr/utilcode/stresslog.cpp b/src/coreclr/utilcode/stresslog.cpp index 5e1fb037e144c..0767907cbf30b 100644 --- a/src/coreclr/utilcode/stresslog.cpp +++ b/src/coreclr/utilcode/stresslog.cpp @@ -34,13 +34,27 @@ thread_local bool t_triedToCreateThreadStressLog; variable-speed CPUs (for power management), this is not accurate, but may be good enough. */ -__forceinline __declspec(naked) uint64_t getTimeStamp() { +__forceinline +#ifdef HOST_WINDOWS +__declspec(naked) +#else +__attribute__((naked)) +#endif +uint64_t getTimeStamp() { STATIC_CONTRACT_LEAF; - __asm { +#ifdef HOST_WINDOWS + __asm { RDTSC // read time stamp counter ret - }; + } +#else + __asm ( + "rdtsc\n\t" // read time stamp counter + "ret\n\t" + ); +#endif + } #else // HOST_X86 diff --git a/src/coreclr/vm/callconvbuilder.hpp b/src/coreclr/vm/callconvbuilder.hpp index 75fff6933fa4f..a2ecd43fc2581 100644 --- a/src/coreclr/vm/callconvbuilder.hpp +++ b/src/coreclr/vm/callconvbuilder.hpp @@ -24,7 +24,7 @@ class CallConvBuilder final struct State { CorInfoCallConvExtension CallConvBase; - CallConvModifiers CallConvModifiers; + enum CallConvModifiers CallConvModifiers; }; private: diff --git a/src/coreclr/vm/callsiteinspect.h b/src/coreclr/vm/callsiteinspect.h index 4ca66eca9feba..eed2f722bebf3 100644 --- a/src/coreclr/vm/callsiteinspect.h +++ b/src/coreclr/vm/callsiteinspect.h @@ -6,13 +6,13 @@ struct CallsiteDetails { // The signature of the current call - MetaSig MetaSig; + class MetaSig MetaSig; // The current call frame FramedMethodFrame *Frame; // The relevant method for the callsite - MethodDesc *MethodDesc; + class MethodDesc *MethodDesc; // Is the callsite for a delegate // Note the relevant method may _not_ be a delegate diff --git a/src/coreclr/vm/common.h b/src/coreclr/vm/common.h index 8b8ff9e842b3a..5d6c90e220c82 100644 --- a/src/coreclr/vm/common.h +++ b/src/coreclr/vm/common.h @@ -202,15 +202,6 @@ Thread * const CURRENT_THREAD = NULL; EXTERN_C AppDomain* STDCALL GetAppDomain(); #endif //!DACCESS_COMPILE -inline void RetailBreak() -{ -#ifdef TARGET_X86 - __asm int 3 -#else - DebugBreak(); -#endif -} - extern BOOL isMemoryReadable(const TADDR start, unsigned len); #ifndef memcpyUnsafe_f diff --git a/src/coreclr/vm/dynamicmethod.h b/src/coreclr/vm/dynamicmethod.h index a26a241006113..894bd178856ae 100644 --- a/src/coreclr/vm/dynamicmethod.h +++ b/src/coreclr/vm/dynamicmethod.h @@ -39,7 +39,7 @@ class ChunkAllocator struct ResolvedToken final { - TypeHandle TypeHandle; + class TypeHandle TypeHandle; SigPointer TypeSignature; SigPointer MethodSignature; MethodDesc* Method; diff --git a/src/coreclr/vm/eventtrace.cpp b/src/coreclr/vm/eventtrace.cpp index 86da0269b3794..ad09da8bcf7f5 100644 --- a/src/coreclr/vm/eventtrace.cpp +++ b/src/coreclr/vm/eventtrace.cpp @@ -227,10 +227,14 @@ extern "C" CallStackFrame* GetEbp() { CallStackFrame *frame=NULL; +#ifdef TARGET_WINDOWS __asm { mov frame, ebp } +#else + frame = (CallStackFrame*)__builtin_frame_address(0); +#endif return frame; } } diff --git a/src/coreclr/vm/gcenv.ee.cpp b/src/coreclr/vm/gcenv.ee.cpp index a4a538780aa4a..abcb71c381b57 100644 --- a/src/coreclr/vm/gcenv.ee.cpp +++ b/src/coreclr/vm/gcenv.ee.cpp @@ -1383,7 +1383,7 @@ struct SuspendableThreadStubArguments { void* Argument; void (*ThreadStart)(void*); - Thread* Thread; + class Thread* Thread; bool HasStarted; CLREvent ThreadStartedEvent; }; diff --git a/src/coreclr/vm/gchelpers.cpp b/src/coreclr/vm/gchelpers.cpp index 63754563b496b..63813450c5c28 100644 --- a/src/coreclr/vm/gchelpers.cpp +++ b/src/coreclr/vm/gchelpers.cpp @@ -127,7 +127,7 @@ class GlobalAllocLock { lock->Release(); } - typedef Holder Holder; + typedef class Holder Holder; }; typedef GlobalAllocLock::Holder GlobalAllocLockHolder; diff --git a/src/coreclr/vm/methodtable.cpp b/src/coreclr/vm/methodtable.cpp index 51b7d3b1d381d..229ca416b5936 100644 --- a/src/coreclr/vm/methodtable.cpp +++ b/src/coreclr/vm/methodtable.cpp @@ -4000,12 +4000,25 @@ static void FastCallFinalize(Object *obj, PCODE funcPtr, BOOL fCriticalCall) #if defined(TARGET_X86) +#ifdef TARGET_WINDOWS __asm { mov ecx, [obj] call [funcPtr] INDEBUG(nop) // Mark the fact that we can call managed code } +#else + __asm + ( + "mov %%ecx, %[obj]\n\t" + "call *%[funcPtr]\n\t" + INDEBUG("nop\n\t") + : + : [obj] "m" (obj), [funcPtr] "m" (funcPtr) + : "ecx" + ); +#endif + #else // TARGET_X86 diff --git a/src/coreclr/vm/precode.h b/src/coreclr/vm/precode.h index fac2433c7428a..3093ff80a2865 100644 --- a/src/coreclr/vm/precode.h +++ b/src/coreclr/vm/precode.h @@ -209,7 +209,7 @@ typedef DPTR(NDirectImportPrecode) PTR_NDirectImportPrecode; struct FixupPrecodeData { PCODE Target; - MethodDesc *MethodDesc; + class MethodDesc *MethodDesc; PCODE PrecodeFixupThunk; }; diff --git a/src/coreclr/vm/spinlock.h b/src/coreclr/vm/spinlock.h index b407d1c135569..bb67a02ed0b7f 100644 --- a/src/coreclr/vm/spinlock.h +++ b/src/coreclr/vm/spinlock.h @@ -12,14 +12,11 @@ //#error I am a part of util.hpp Please don't include me alone ! //#endif - - #ifndef _H_SPINLOCK_ #define _H_SPINLOCK_ #include - // #SwitchToThreadSpinning // // If you call __SwitchToThread in a loop waiting for a condition to be met, @@ -112,12 +109,12 @@ class DangerousNonHostedSpinLock return (BOOL)m_value; } - typedef Holder Holder; - typedef ConditionalStateHolder TryHolder; + typedef Holder LockHolder; + typedef ConditionalStateHolder LockTryHolder; }; -typedef DangerousNonHostedSpinLock::Holder DangerousNonHostedSpinLockHolder; -typedef DangerousNonHostedSpinLock::TryHolder DangerousNonHostedSpinLockTryHolder; +typedef DangerousNonHostedSpinLock::LockHolder DangerousNonHostedSpinLockHolder; +typedef DangerousNonHostedSpinLock::LockTryHolder DangerousNonHostedSpinLockTryHolder; class SpinLock; diff --git a/src/coreclr/vm/tailcallhelp.cpp b/src/coreclr/vm/tailcallhelp.cpp index 03e35ca73364d..e9fb3a75852ea 100644 --- a/src/coreclr/vm/tailcallhelp.cpp +++ b/src/coreclr/vm/tailcallhelp.cpp @@ -81,7 +81,7 @@ struct TailCallInfo TypeHandle RetTyHnd; ArgBufferLayout ArgBufLayout; bool HasGCDescriptor; - GCRefMapBuilder GCRefMapBuilder; + class GCRefMapBuilder GCRefMapBuilder; TailCallInfo( MethodDesc* pCallerMD, MethodDesc* pCalleeMD, diff --git a/src/native/external/libunwind-version.txt b/src/native/external/libunwind-version.txt index fd56a772b51c2..82cbcf4866c0a 100644 --- a/src/native/external/libunwind-version.txt +++ b/src/native/external/libunwind-version.txt @@ -9,3 +9,4 @@ Revert https://github.com/libunwind/libunwind/pull/503 # issue: https://github.c Apply https://github.com/libunwind/libunwind/pull/714 Revert https://github.com/libunwind/libunwind/commit/ec03043244082b8f552881ba9fb790aa49c85468 and follow up changes in the same file # issue: https://github.com/libunwind/libunwind/issues/715 Apply https://github.com/libunwind/libunwind/pull/734 +Apply https://github.com/libunwind/libunwind/pull/758 diff --git a/src/native/external/libunwind/src/os-solaris.c b/src/native/external/libunwind/src/os-solaris.c index 032bacf6711fd..2123b35d45742 100644 --- a/src/native/external/libunwind/src/os-solaris.c +++ b/src/native/external/libunwind/src/os-solaris.c @@ -63,7 +63,7 @@ tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip, if (ei) rc = elf_map_image (ei, mi.path); else - rc = strlen(mi.path) >= pathlen ? -UNW_ENOMEM : UNW_ESUCCESS:; + rc = strlen(mi.path) >= pathlen ? -UNW_ENOMEM : UNW_ESUCCESS; maps_close (&mi); return rc; diff --git a/src/native/libs/System.Native/pal_networking.c b/src/native/libs/System.Native/pal_networking.c index 0deae01d8bff2..3afb88bbce9b5 100644 --- a/src/native/libs/System.Native/pal_networking.c +++ b/src/native/libs/System.Native/pal_networking.c @@ -2005,9 +2005,11 @@ static bool TryGetPlatformSocketOption(int32_t socketOptionLevel, int32_t socket *optName = TCP_KEEPINTVL; return true; +#ifdef TCP_FASTOPEN_CONNECT case SocketOptionName_SO_TCP_FASTOPEN: *optName = TCP_FASTOPEN; return true; +#endif default: return false;