From a8d007e51da7a056b667457ff862fae4d89bc08d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 8 Oct 2018 18:24:04 -0400 Subject: [PATCH] AOT: use 32 bit flags for as/ld when targetting x86 on linux (#11032) So it works when running the 64bit as/ld on the host with a 32bit mono binary. --- mono/mini/aot-compiler.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index 2425a9b118d..46380a64cf2 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -11269,6 +11269,8 @@ compile_asm (MonoAotCompile *acfg) #define AS_OPTIONS "-xarch=v9" #elif defined(TARGET_X86) && defined(TARGET_MACH) #define AS_OPTIONS "-arch i386" +#elif defined(TARGET_X86) && !defined(TARGET_MACH) +#define AS_OPTIONS "--32" #else #define AS_OPTIONS "" #endif @@ -11306,6 +11308,8 @@ compile_asm (MonoAotCompile *acfg) #elif defined(TARGET_X86) && defined(TARGET_MACH) #define LD_NAME "clang" #define LD_OPTIONS "-m32 -dynamiclib" +#elif defined(TARGET_X86) && !defined(TARGET_MACH) +#define LD_OPTIONS "-m elf_i386" #elif defined(TARGET_ARM) && !defined(TARGET_ANDROID) #define LD_NAME "gcc" #define LD_OPTIONS "--shared" -- 2.11.4.GIT