dev-lang/mono: fix 32-bit build on amd64, bug #600664
authorSergei Trofimovich <slyfox@gentoo.org>
Fri, 30 Mar 2018 17:25:39 +0000 (18:25 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Fri, 30 Mar 2018 17:26:42 +0000 (18:26 +0100)
It's a backport of https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a0e31adf6af28adf3c8709e542ecf7039cb5942

Reported-by: Toralf Förster
Fixed-by: Eric Hermes
Closes: https://bugs.gentoo.org/600664
Package-Manager: Portage-2.3.26, Repoman-2.3.7

dev-lang/mono/files/mono-4.4.1.0-x86_32.patch [new file with mode: 0644]
dev-lang/mono/mono-4.4.1.0.ebuild

diff --git a/dev-lang/mono/files/mono-4.4.1.0-x86_32.patch b/dev-lang/mono/files/mono-4.4.1.0-x86_32.patch
new file mode 100644 (file)
index 0000000..751c057
--- /dev/null
@@ -0,0 +1,20 @@
+Native toolchain can default to different ABI (amd64 in bug case).
+Set target to i386.
+https://bugs.gentoo.org/600664
+diff -Naur a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c
+--- a/mono/mini/aot-compiler.c 2016-06-22 04:31:58.000000000 -0500
++++ b/mono/mini/aot-compiler.c 2017-12-08 14:25:35.338251941 -0600
+@@ -9438,7 +9438,12 @@
+       const char *tool_prefix = acfg->aot_opts.tool_prefix ? acfg->aot_opts.tool_prefix : "";
+       char *ld_flags = acfg->aot_opts.ld_flags ? acfg->aot_opts.ld_flags : g_strdup("");
+-#if defined(TARGET_AMD64) && !defined(TARGET_MACH)
++#if defined(TARGET_X86)
++#define LD_OPTIONS "-m elf_i386"
++#if !defined(TARGET_MACH)
++#define AS_OPTIONS "--32"
++#endif
++#elif defined(TARGET_AMD64) && !defined(TARGET_MACH)
+ #define AS_OPTIONS "--64"
+ #elif defined(TARGET_POWERPC64)
+ #define AS_OPTIONS "-a64 -mppc64"
index 328ec0684726c693874ad63930f9fda476ea404e..397235e7db5973005b6d61c8008de1139345cfb3 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -79,6 +79,8 @@ src_prepare() {
        #epatch "${FILESDIR}/fix-for-GitExtensions-issue-2710-another-resolution.patch"
        #epatch "${FILESDIR}/fix-for-bug36724.patch"
 
+       epatch "${FILESDIR}/${P}-x86_32.patch"
+
        default
        #eapply_user
        multilib_copy_sources