From 5127c755e4cb6a810f81eb38777e1d7917695f9c Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Fri, 30 Mar 2018 18:25:39 +0100 Subject: dev-lang/mono: fix 32-bit build on amd64, bug #600664 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) create mode 100644 dev-lang/mono/files/mono-4.4.1.0-x86_32.patch 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 000000000000..751c057e6ce4 --- /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 328ec0684726..397235e7db59 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 -- cgit v1.2.3-65-gdbad