Better assembly dump experience on OSX.
authorRodrigo Kumpera <kumpera@gmail.com>
Thu, 19 Jan 2012 21:28:58 +0000 (19:28 -0200)
committerRodrigo Kumpera <kumpera@gmail.com>
Mon, 23 Jan 2012 18:12:42 +0000 (16:12 -0200)
mono/mini/helpers.c

index 13952b49d0744c5c130da60110986af4380f02db..2a0b7d9e0e1d826125da9451cad191f441d99ec8 100644 (file)
@@ -66,6 +66,13 @@ opnames[] = {
 #define emit_debug_info  FALSE
 #endif
 
+/*This enables us to use the right tooling when building the cross compiler for iOS.*/
+#if defined (__APPLE__) && defined (TARGET_ARM) && (defined(__i386__) || defined(__x86_64__))
+
+#define ARCH_PREFIX "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/"
+
+#endif
+
 #define ARCH_PREFIX ""
 //#define ARCH_PREFIX "powerpc64-linux-gnu-"
 
@@ -204,12 +211,24 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id)
 
 #if defined(sparc)
 #define AS_CMD "as -xarch=v9"
-#elif defined(__i386__) || defined(__x86_64__)
+#elif defined (TARGET_X86)
 #  if defined(__APPLE__)
-#    define AS_CMD "as"
+#    define AS_CMD "as -arch i386"
 #  else
 #    define AS_CMD "as -gstabs"
-#endif
+#  endif
+#elif defined (TARGET_AMD64)
+#  if defined (__APPLE__)
+#    define AS_CMD "as -arch x86_64"
+#  else
+#    define AS_CMD "as -gstabs"
+#  endif
+#elif defined (TARGET_ARM)
+#  if defined (__APPLE__)
+#    define AS_CMD "as -arch arm"
+#  else
+#    define AS_CMD "as -gstabs"
+#  endif
 #elif defined(__mips__) && (_MIPS_SIM == _ABIO32)
 #define AS_CMD "as -mips32"
 #elif defined(__ppc64__)