2008-09-19 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Fri, 19 Sep 2008 17:19:18 +0000 (17:19 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Fri, 19 Sep 2008 17:19:18 +0000 (17:19 -0000)
* mono-config.c (dllmap_start): Add support for the bits keyword
on dllentry and dllmap to easily detect 32 vs 64 bit systems.

svn path=/trunk/mono/; revision=113551

man/mono-config.5
mono/metadata/ChangeLog
mono/metadata/mono-config.c

index 61bc8c4a2045950a54812863bba7f1ba7a65387b..df1675fb4f5c5687d4ed949b5c8b53da0e253a93 100644 (file)
@@ -81,7 +81,12 @@ Allowed values are: linux, osx, solaris, freebsd, openbsd, netbsd, windows, aix,
 .TP
 .I cpu
 This is the name of the architecture for which the mapping should be applied.
-Allowed values are: x86, x86-64, sparc, ppc, s390, s390x, arm, mips, alpha, hppa, ia64.
+Allowed values are: x86, x86-64, sparc, ppc, s390, s390x, arm, mips,
+alpha, hppa, ia64.
+.TP
+.I bits
+This is the size of registers on the target architecture, it can be
+either 32 or 64.  
 .PP
 The attribute value for both attributes can be a comma-separated list of the allowed
 values. Additionally, the first character may be a
index 79a5fc60c8b0e5941ba78fe6cb0c7c0fa39951d3..b42680c39db2137806dbf7c8e7405b459140336f 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-19  Miguel de Icaza  <miguel@novell.com>
+
+       * mono-config.c (dllmap_start): Add support for the bits keyword
+       on dllentry and dllmap to easily detect 32 vs 64 bit systems.
+
 2008-09-19  Mark Probst  <mark.probst@gmail.com>
 
        * reflection.c (inflate_mono_method): When the class the method is
index ef82354d93fd565e5b2086f18f3c2ea6f3012a80..3464e7fb4ac7dd9f764c95c77b6e9176fe99847a 100644 (file)
 
 #if defined(__i386__)
 #define CONFIG_CPU "x86"
+#define CONFIG_BITS "32"
 #elif defined(__x86_64__)
 #define CONFIG_CPU "x86-64"
+#define CONFIG_BITS "64"
 #elif defined(sparc) || defined(__sparc__)
 #define CONFIG_CPU "sparc"
+#define CONFIG_BITS "32"
 #elif defined(__ppc64__) || defined(__powerpc64__)
 #define CONFIG_CPU "ppc64"
+#define CONFIG_BITS "64"
 #elif defined(__ppc__) || defined(__powerpc__)
 #define CONFIG_CPU "ppc"
+#define CONFIG_BITS "32"
 #elif defined(__s390x__)
 #define CONFIG_CPU "s390x"
+#define CONFIG_BITS "64"
 #elif defined(__s390__)
 #define CONFIG_CPU "s390"
+#define CONFIG_BITS "32"
 #elif defined(__arm__)
 #define CONFIG_CPU "arm"
+#define CONFIG_BITS "32"
 #elif defined(__ia64__)
 #define CONFIG_CPU "ia64"
+#define CONFIG_BITS "64"
 #elif defined(__alpha__)
 #define CONFIG_CPU "alpha"
+#define CONFIG_BITS "64"
 #elif defined(hppa) || defined(__hppa__)
 #define CONFIG_CPU "hppa"
+#define CONFIG_BITS "32"
 #elif defined(mips) || defined(__mips) || defined(_mips)
 #define CONFIG_CPU "mips"
+#define CONFIG_BITS "32"
 #else
 #warning Unknown CPU
 #define CONFIG_CPU "unknownCPU"
@@ -247,6 +259,8 @@ dllmap_start (gpointer user_data,
                                info->ignore = TRUE;
                        else if (strcmp (attribute_names [i], "cpu") == 0 && !arch_matches (CONFIG_CPU, attribute_values [i]))
                                info->ignore = TRUE;
+                       else if (strcmp (attribute_names [i], "bits") == 0 && !arch_matches (CONFIG_BITS, attribute_values [i]))
+                               info->ignore = TRUE;
                }
                if (!info->ignore)
                        mono_dllmap_insert (info->assembly, info->dll, NULL, info->target, NULL);
@@ -264,6 +278,8 @@ dllmap_start (gpointer user_data,
                                ignore = TRUE;
                        else if (strcmp (attribute_names [i], "cpu") == 0 && !arch_matches (CONFIG_CPU, attribute_values [i]))
                                ignore = TRUE;
+                       else if (strcmp (attribute_names [i], "bits") == 0 && !arch_matches (CONFIG_BITS, attribute_values [i]))
+                               ignore = TRUE;
                }
                if (!dll)
                        dll = info->dll;