From 9a58ab8761bffb11400bd699728a5459ec5518d3 Mon Sep 17 00:00:00 2001 From: Gleb Balykov Date: Mon, 6 Apr 2020 18:40:10 +0300 Subject: [PATCH] Fix Linux x86 build (#34548) * Fix Linux x86 build Related to #33005 * Fix Linux x86 build Related to #33653, #33005 * Fix Linux x86 build Related to #32250 --- src/coreclr/src/vm/comdelegate.cpp | 4 ++-- src/coreclr/src/vm/comdelegate.h | 6 +++--- src/coreclr/src/vm/exceptionhandling.cpp | 4 ++++ src/coreclr/src/vm/i386/asmhelpers.S | 2 +- src/coreclr/src/vm/prestub.cpp | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/coreclr/src/vm/comdelegate.cpp b/src/coreclr/src/vm/comdelegate.cpp index ac3c4d0083ea5..958a2202a35d1 100644 --- a/src/coreclr/src/vm/comdelegate.cpp +++ b/src/coreclr/src/vm/comdelegate.cpp @@ -1132,7 +1132,7 @@ void COMDelegate::BindToMethod(DELEGATEREF *pRefThis, GCPROTECT_END(); } -#if defined(TARGET_X86) && defined(TARGET_WINDOWS) +#if defined(TARGET_X86) // Marshals a managed method to an unmanaged callback provided the // managed method is static and it's parameters require no marshalling. PCODE COMDelegate::ConvertToCallback(MethodDesc* pMD) @@ -1189,7 +1189,7 @@ PCODE COMDelegate::ConvertToCallback(MethodDesc* pMD) _ASSERTE(pCode != NULL); return pCode; } -#endif // defined(TARGET_X86) && defined(TARGET_WINDOWS) +#endif // defined(TARGET_X86) // Marshals a delegate to a unmanaged callback. LPVOID COMDelegate::ConvertToCallback(OBJECTREF pDelegateObj) diff --git a/src/coreclr/src/vm/comdelegate.h b/src/coreclr/src/vm/comdelegate.h index a87845dbe0ce8..d11d79f9a830a 100644 --- a/src/coreclr/src/vm/comdelegate.h +++ b/src/coreclr/src/vm/comdelegate.h @@ -84,11 +84,11 @@ class COMDelegate // Marshals a delegate to a unmanaged callback. static LPVOID ConvertToCallback(OBJECTREF pDelegate); -#if defined(TARGET_X86) && defined(TARGET_WINDOWS) +#if defined(TARGET_X86) // Marshals a managed method to an unmanaged callback. - // This is only used on x86 Windows. See usage for further details. + // This is only used on x86. See usage for further details. static PCODE ConvertToCallback(MethodDesc* pMD); -#endif // defined(TARGET_X86) && defined(TARGET_WINDOWS) +#endif // defined(TARGET_X86) // Marshals an unmanaged callback to Delegate static OBJECTREF ConvertToDelegate(LPVOID pCallback, MethodTable* pMT); diff --git a/src/coreclr/src/vm/exceptionhandling.cpp b/src/coreclr/src/vm/exceptionhandling.cpp index cd33b0fbd8860..bdf1bda9a6c7c 100644 --- a/src/coreclr/src/vm/exceptionhandling.cpp +++ b/src/coreclr/src/vm/exceptionhandling.cpp @@ -1257,6 +1257,7 @@ lExit: ; if ((ExceptionContinueSearch == returnDisposition)) { +#ifdef USE_GC_INFO_DECODER if (dwExceptionFlags & EXCEPTION_UNWINDING) { EECodeInfo codeInfo(pDispatcherContext->ControlPc); @@ -1272,6 +1273,7 @@ lExit: ; } } } +#endif // USE_GC_INFO_DECODER GCX_PREEMP_NO_DTOR(); } @@ -4663,6 +4665,7 @@ VOID DECLSPEC_NORETURN UnwindManagedExceptionPass1(PAL_SEHException& ex, CONTEXT controlPc = Thread::VirtualUnwindLeafCallFrame(frameContext); } +#ifdef USE_GC_INFO_DECODER GcInfoDecoder gcInfoDecoder(codeInfo.GetGCInfoToken(), DECODE_REVERSE_PINVOKE_VAR); if (gcInfoDecoder.GetReversePInvokeFrameStackSlot() != NO_REVERSE_PINVOKE_FRAME) @@ -4676,6 +4679,7 @@ VOID DECLSPEC_NORETURN UnwindManagedExceptionPass1(PAL_SEHException& ex, CONTEXT TerminateProcess(GetCurrentProcess(), 1); UNREACHABLE(); } +#endif // USE_GC_INFO_DECODER // Check whether we are crossing managed-to-native boundary while (!ExecutionManager::IsManagedCode(controlPc)) diff --git a/src/coreclr/src/vm/i386/asmhelpers.S b/src/coreclr/src/vm/i386/asmhelpers.S index c318dc3903096..7ed9d6bd3512a 100644 --- a/src/coreclr/src/vm/i386/asmhelpers.S +++ b/src/coreclr/src/vm/i386/asmhelpers.S @@ -1401,7 +1401,7 @@ NESTED_ENTRY OnCallCountThresholdReachedStub2, _TEXT, NoHandler // Align the stack for the call lea ebx, [esp - 8] - and ebx, 0fh + and ebx, 0x0f sub esp, ebx push eax // stub-identifying token, see OnCallCountThresholdReachedStub diff --git a/src/coreclr/src/vm/prestub.cpp b/src/coreclr/src/vm/prestub.cpp index e75bc9f1ce7df..cd25aaa0f90e7 100644 --- a/src/coreclr/src/vm/prestub.cpp +++ b/src/coreclr/src/vm/prestub.cpp @@ -439,7 +439,7 @@ PCODE MethodDesc::GetPrecompiledCode(PrepareCodeConfig* pConfig) #ifdef FEATURE_TIERED_COMPILATION bool shouldTier = pConfig->GetMethodDesc()->IsEligibleForTieredCompilation(); -#if !defined(TARGET_X86) || !defined(TARGET_WINDOWS) +#if !defined(TARGET_X86) CallerGCMode callerGcMode = pConfig->GetCallerGCMode(); // If the method is eligible for tiering but is being // called from a Preemptive GC Mode thread or the method @@ -458,7 +458,7 @@ PCODE MethodDesc::GetPrecompiledCode(PrepareCodeConfig* pConfig) codeVersion.SetOptimizationTier(NativeCodeVersion::OptimizationTierOptimized); shouldTier = false; } -#endif // !TARGET_X86 || !TARGET_WINDOWS +#endif // !TARGET_X86 #endif // FEATURE_TIERED_COMPILATION if (pConfig->SetNativeCode(pCode, &pCode))