From c5cbb9bd4f4eb556542cf2c8e8f7bf9f7a58084a Mon Sep 17 00:00:00 2001 From: Egor Chesakov Date: Wed, 29 Aug 2018 19:51:51 -0700 Subject: [PATCH] Define T_RUNTIME_FUNCTION in cross-bitness crossgen ARM32 (dotnet/coreclr#19718) * Allow 'Non-ARM Host managing ARM related code' scenario in src/inc/crosscomp.h * Restrict RtlUnwindEx RtlVirtualUnwind to X86 || FEATURE_PAL in src/inc/clrnt.h * Define PTR_RUNTIME_FUNCTION via T_RUNTIME_FUNCTION in src/inc/daccess.h Commit migrated from https://github.com/dotnet/coreclr/commit/398caa5c90173f90bcfc8275670a1fcaa7ad6e41 --- src/coreclr/src/inc/clrnt.h | 2 ++ src/coreclr/src/inc/crosscomp.h | 13 +++++++++++-- src/coreclr/src/inc/daccess.h | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/coreclr/src/inc/clrnt.h b/src/coreclr/src/inc/clrnt.h index 95f7458..1356666 100644 --- a/src/coreclr/src/inc/clrnt.h +++ b/src/coreclr/src/inc/clrnt.h @@ -933,6 +933,7 @@ typedef struct _UNWIND_INFO { // dummy } UNWIND_INFO, *PUNWIND_INFO; +#if defined(FEATURE_PAL) || defined(_X86_) EXTERN_C NTSYSAPI VOID @@ -960,6 +961,7 @@ RtlVirtualUnwind ( __out PDWORD EstablisherFrame, __inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers ); +#endif // FEATURE_PAL || _X86_ #define UNW_FLAG_NHANDLER 0x0 diff --git a/src/coreclr/src/inc/crosscomp.h b/src/coreclr/src/inc/crosscomp.h index 1476895..62d1175 100644 --- a/src/coreclr/src/inc/crosscomp.h +++ b/src/coreclr/src/inc/crosscomp.h @@ -12,7 +12,7 @@ #define CROSSBITNESS_COMPILE #endif -#if defined(_X86_) && defined(_TARGET_ARM_) // Host X86 managing ARM related code +#if !defined(_ARM_) && defined(_TARGET_ARM_) // Non-ARM Host managing ARM related code #ifndef CROSS_COMPILE #define CROSS_COMPILE @@ -93,6 +93,7 @@ typedef struct DECLSPEC_ALIGN(8) _T_CONTEXT { // #ifndef FEATURE_PAL +#ifdef _X86_ typedef struct _RUNTIME_FUNCTION { DWORD BeginAddress; DWORD UnwindData; @@ -119,6 +120,7 @@ typedef struct _UNWIND_HISTORY_TABLE { DWORD HighAddress; UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE]; } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE; +#endif // _X86_ #endif // !FEATURE_PAL @@ -175,8 +177,15 @@ typedef struct _T_DISPATCHER_CONTEXT { PUCHAR NonVolatileRegisters; } T_DISPATCHER_CONTEXT, *PT_DISPATCHER_CONTEXT; +#if defined(FEATURE_PAL) || defined(_X86_) #define T_RUNTIME_FUNCTION RUNTIME_FUNCTION #define PT_RUNTIME_FUNCTION PRUNTIME_FUNCTION +#else +typedef struct _T_RUNTIME_FUNCTION { + DWORD BeginAddress; + DWORD UnwindData; +} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION; +#endif #elif defined(_AMD64_) && defined(_TARGET_ARM64_) // Host amd64 managing ARM64 related code @@ -347,7 +356,7 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS { } T_KNONVOLATILE_CONTEXT_POINTERS, *PT_KNONVOLATILE_CONTEXT_POINTERS; -#else // !(defined(_X86_) && defined(_TARGET_ARM_)) && !(defined(_AMD64_) && defined(_TARGET_ARM64_)) +#else #define T_CONTEXT CONTEXT #define PT_CONTEXT PCONTEXT diff --git a/src/coreclr/src/inc/daccess.h b/src/coreclr/src/inc/daccess.h index 67e5843..4931027 100644 --- a/src/coreclr/src/inc/daccess.h +++ b/src/coreclr/src/inc/daccess.h @@ -2408,7 +2408,7 @@ typedef DPTR(union _UNWIND_CODE) PTR_UNWIND_CODE; #endif // _TARGET_64BIT_ #ifdef _TARGET_ARM_ -typedef DPTR(RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION; +typedef DPTR(T_RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION; #endif //---------------------------------------------------------------------------- -- 2.7.4