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
+++ mono/mini/aot-compiler.c
@@ -12182,7 +12184,7 @@ compile_asm (MonoAotCompile *acfg)
 #endif
 
 #if defined(TARGET_OSX)
-#define AS_NAME "clang"
+#define AS_NAME "__MACPORTS_CC__"
 #elif defined(TARGET_WIN32_MSVC)
 #define AS_NAME "clang.exe"
 #else
@@ -12199,13 +12201,16 @@ compile_asm (MonoAotCompile *acfg)
 #define LD_NAME "ld"
 #define LD_OPTIONS "-shared -G -Bsymbolic"
 #elif defined(__ppc__) && defined(TARGET_MACH)
-#define LD_NAME "gcc"
-#define LD_OPTIONS "-dynamiclib -Wl,-Bsymbolic"
+#define LD_NAME "__MACPORTS_CC__"
+#define LD_OPTIONS "-m32 -dynamiclib -Wl,-Bsymbolic"
+#elif defined(__ppc64__) && defined(TARGET_MACH)
+#define LD_NAME "__MACPORTS_CC__"
+#define LD_OPTIONS "-m64 -dynamiclib -Wl,-Bsymbolic"
 #elif defined(TARGET_AMD64) && defined(TARGET_MACH)
-#define LD_NAME "clang"
-#define LD_OPTIONS "--shared"
+#define LD_NAME "__MACPORTS_CC__"
+#define LD_OPTIONS "-m64 --shared"
 #elif defined(TARGET_ARM64) && defined(TARGET_OSX)
-#define LD_NAME "clang"
+#define LD_NAME "__MACPORTS_CC__"
 #define LD_OPTIONS "--shared -arch arm64"
 #elif defined(TARGET_WIN32_MSVC)
 #define LD_NAME "link.exe"
@@ -12215,7 +12220,7 @@ compile_asm (MonoAotCompile *acfg)
 #define LD_NAME "gcc"
 #define LD_OPTIONS "-shared -Wl,-Bsymbolic"
 #elif defined(TARGET_X86) && defined(TARGET_MACH)
-#define LD_NAME "clang"
+#define LD_NAME "__MACPORTS_CC__"
 #define LD_OPTIONS "-m32 -dynamiclib"
 #elif defined(TARGET_X86) && !defined(TARGET_MACH)
 #define LD_OPTIONS "-m elf_i386 -Bsymbolic"
