[runtime] Add runtime support for explicit offset files.
authorRodrigo Kumpera <kumpera@gmail.com>
Mon, 16 Nov 2015 05:22:56 +0000 (00:22 -0500)
committerRodrigo Kumpera <kumpera@gmail.com>
Mon, 28 Mar 2016 19:48:20 +0000 (12:48 -0700)
Explicit offset files are provided by configuring mono with --with-cross-offsets

List of original contributors:

Joao Matos <joao@tritao.eu>
Zoltan Varga <vargaz@gmail.com>
Rolf Bjarne Kvinge <rolf@xamarin.com>
Rodrigo Kumpera <kumpera@gmail.com>

mono/metadata/object-offsets.h

index a79e3508e0f74967146ae3c0006d437f669a64a8..b4737b3b7927635a141f21c74019668e80f4c450 100644 (file)
@@ -17,17 +17,22 @@ Output defines:
 
 HAS_CROSS_COMPILER_OFFSETS - if set, it means we found some cross offsets, it doesnt mean we'll use it.
 USED_CROSS_COMPILER_OFFSETS - if set, it means we used the cross offsets
+
+Environment defines (from config.h and CFLAGS):
+
+MONO_GENERATING_OFFSETS - Set by an offsets generating tool to disable the usage of any (possibly non-existing) generated header.
+MONO_OFFSETS_FILE - Name of the header file containing the offsets to be used.
+
 */
 
 
 #undef HAS_CROSS_COMPILER_OFFSETS
 #undef USED_CROSS_COMPILER_OFFSETS
 
-#ifdef ENABLE_EXTENSION_MODULE
-#include "../../../mono-extensions/mono/metadata/object-offsets.h"
+#if !defined (MONO_GENERATING_OFFSETS) && defined (MONO_OFFSETS_FILE)
+#include MONO_OFFSETS_FILE
 #endif
 
-
 #ifndef USED_CROSS_COMPILER_OFFSETS
 
 DECL_ALIGN(gint8)