summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2016-12-01 21:53:42 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2016-12-01 22:05:20 +0000
commit7a0e31adf6af28adf3c8709e542ecf7039cb5942 (patch)
tree54d7ee54a31625802e7b87555c54920d19ef86ab /dev-lang
parentsys-devel/patch: Security cleanup (bug #538658). (diff)
downloadgentoo-7a0e31adf6af28adf3c8709e542ecf7039cb5942.tar.gz
gentoo-7a0e31adf6af28adf3c8709e542ecf7039cb5942.tar.bz2
gentoo-7a0e31adf6af28adf3c8709e542ecf7039cb5942.zip
dev-lang/mono: fix ABI_X86=32 build case for amd64 host, bug #600664
The patch passes flags to adjust target ABI of a multiarch assembler and linker. Reported-by: Ivan Dorna Reported-by: Toralf Förster Bug: https://github.com/gentoo/dotnet/issues/270 Bug: https://bugs.gentoo.org/600664 Package-Manager: portage-2.3.2
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/mono/files/mono-4.8.0.371-x86_32.patch27
-rw-r--r--dev-lang/mono/mono-4.8.0.371.ebuild5
2 files changed, 31 insertions, 1 deletions
diff --git a/dev-lang/mono/files/mono-4.8.0.371-x86_32.patch b/dev-lang/mono/files/mono-4.8.0.371-x86_32.patch
new file mode 100644
index 000000000000..063ea634fa4c
--- /dev/null
+++ b/dev-lang/mono/files/mono-4.8.0.371-x86_32.patch
@@ -0,0 +1,27 @@
+Native toolchain can default to different ABI (amd64 in bug case).
+Set target to i386.
+https://bugs.gentoo.org/600664
+diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c
+index a1c359f..beaaf76 100644
+--- a/mono/mini/aot-compiler.c
++++ b/mono/mini/aot-compiler.c
+@@ -9842,7 +9842,9 @@ compile_asm (MonoAotCompile *acfg)
+ 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) && !defined(TARGET_MACH)
++#define AS_OPTIONS "--32"
++#elif defined(TARGET_AMD64) && !defined(TARGET_MACH)
+ #define AS_OPTIONS "--64"
+ #elif defined(TARGET_POWERPC64)
+ #define AS_OPTIONS "-a64 -mppc64"
+@@ -9886,6 +9888,8 @@ compile_asm (MonoAotCompile *acfg)
+ #define LD_OPTIONS "--shared"
+ #elif defined(TARGET_POWERPC64)
+ #define LD_OPTIONS "-m elf64ppc"
++#elif defined(TARGET_X86)
++#define LD_OPTIONS "-m elf_i386"
+ #endif
+
+ #ifndef LD_OPTIONS
diff --git a/dev-lang/mono/mono-4.8.0.371.ebuild b/dev-lang/mono/mono-4.8.0.371.ebuild
index 4a4e5123ef82..1995170dcf0e 100644
--- a/dev-lang/mono/mono-4.8.0.371.ebuild
+++ b/dev-lang/mono/mono-4.8.0.371.ebuild
@@ -33,7 +33,10 @@ DEPEND="${COMMONDEPEND}
!dev-lang/mono-basic
"
-PATCHES=("${FILESDIR}"/${PN}-4.8.0.371-makedev.patch)
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.8.0.371-makedev.patch
+ "${FILESDIR}"/${PN}-4.8.0.371-x86_32.patch
+)
S="${WORKDIR}/${PN}-$(get_version_component_range 1-3)"