Define T_RUNTIME_FUNCTION in cross-bitness crossgen ARM32 (dotnet/coreclr#19718)
authorEgor Chesakov <Egor.Chesakov@microsoft.com>
Thu, 30 Aug 2018 02:51:51 +0000 (19:51 -0700)
committerGitHub <noreply@github.com>
Thu, 30 Aug 2018 02:51:51 +0000 (19:51 -0700)
* 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
src/coreclr/src/inc/crosscomp.h
src/coreclr/src/inc/daccess.h

index 95f7458..1356666 100644 (file)
@@ -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
 
index 1476895..62d1175 100644 (file)
@@ -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
index 67e5843..4931027 100644 (file)
@@ -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
 
 //----------------------------------------------------------------------------