Ensure we are UsingTheRightCompiler (https://trac.macports.org/wiki/UsingTheRightCompiler).
Ensure we always use -m32/-m64 and -arch for all architectures.
--- mono/mini/aot-compiler.c.orig 2019-01-17 00:45:20.000000000 -0700
+++ mono/mini/aot-compiler.c 2019-02-18 05:59:15.000000000 -0700
#define AS_OPTIONS "-xarch=v9"
#elif defined(TARGET_X86) && defined(TARGET_MACH)
#define AS_OPTIONS "-arch i386"
+#elif defined(TARGET_AMD64) && defined(TARGET_MACH)
+#define AS_OPTIONS "-arch x86_64"
#elif defined(TARGET_X86) && !defined(TARGET_MACH)
#define AS_OPTIONS "--32"
+#define AS_NAME "__MACPORTS_CC__"
#elif defined(TARGET_WIN32_MSVC)
#define AS_NAME "clang.exe"
@@ -11900,11 +11902,14 @@
#define LD_OPTIONS "-shared -G"
#elif defined(__ppc__) && defined(TARGET_MACH)
-#define LD_OPTIONS "-dynamiclib"
+#define LD_NAME "__MACPORTS_CC__"
+#define LD_OPTIONS "-m32 -dynamiclib"
+#elif defined(__ppc64__) && defined(TARGET_MACH)
+#define LD_NAME "__MACPORTS_CC__"
+#define LD_OPTIONS "-m64 -dynamiclib"
#elif defined(TARGET_AMD64) && defined(TARGET_MACH)
-#define LD_OPTIONS "--shared"
+#define LD_NAME "__MACPORTS_CC__"
+#define LD_OPTIONS "-m64 --shared"
#elif defined(TARGET_WIN32_MSVC)
#define LD_NAME "link.exe"
#define LD_OPTIONS "/DLL /MACHINE:X64 /NOLOGO /INCREMENTAL:NO"
#define LD_OPTIONS "-shared"
#elif defined(TARGET_X86) && defined(TARGET_MACH)
+#define LD_NAME "__MACPORTS_CC__"
#define LD_OPTIONS "-m32 -dynamiclib"
#elif defined(TARGET_X86) && !defined(TARGET_MACH)
#define LD_OPTIONS "-m elf_i386"