commit:     5127c755e4cb6a810f81eb38777e1d7917695f9c
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 30 17:25:39 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Fri Mar 30 17:26:42 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5127c755

dev-lang/mono: fix 32-bit build on amd64, bug #600664

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 | 20 ++++++++++++++++++++
 dev-lang/mono/mono-4.4.1.0.ebuild             |  4 +++-
 2 files changed, 23 insertions(+), 1 deletion(-)

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
index 00000000000..751c057e6ce
--- /dev/null
+++ b/dev-lang/mono/files/mono-4.4.1.0-x86_32.patch
@@ -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"

diff --git a/dev-lang/mono/mono-4.4.1.0.ebuild 
b/dev-lang/mono/mono-4.4.1.0.ebuild
index 328ec068472..397235e7db5 100644
--- a/dev-lang/mono/mono-4.4.1.0.ebuild
+++ b/dev-lang/mono/mono-4.4.1.0.ebuild
@@ -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

Reply via email to