From e29a5fe5a14821e6bda9c187f19e9cb6fb43b4e06666c799e50c0bb1fdab245a Mon Sep 17 00:00:00 2001 From: Dinar Valeev Date: Thu, 10 Dec 2015 16:15:47 +0000 Subject: [PATCH] Accepting request 348252 from home:michel_mno:branches:Mono:Factory - new basic_changes_powerpc_be.patch to build ppc64 archi and disable ppc build that still segfault. OBS-URL: https://build.opensuse.org/request/show/348252 OBS-URL: https://build.opensuse.org/package/show/Mono:Factory/mono-core?expand=0&rev=161 --- basic_changes_powerpc_be.patch | 94 ++++++++++++++++++++++++++++++++++ mono-core.changes | 6 +++ mono-core.spec | 4 ++ 3 files changed, 104 insertions(+) create mode 100644 basic_changes_powerpc_be.patch diff --git a/basic_changes_powerpc_be.patch b/basic_changes_powerpc_be.patch new file mode 100644 index 0000000..7afae8f --- /dev/null +++ b/basic_changes_powerpc_be.patch @@ -0,0 +1,94 @@ +commit 8332185abf23e2f27a536e6b7a08310aba8564fb +Author: Bill Seurer +Date: Tue Aug 18 09:36:23 2015 -0500 + +[ppc] Basic changes to allow mono to build and run on power BE +patch adapted to current mono 4.2.1.102 + +The patch of tramp-ppc.c was not from above commit +but is also required to avoid ppc64 build segfault. + +Signed-off-by: Michel Normand +--- + mono/mini/mini-ppc.c | 10 ++++++++-- + mono/mini/mini-trampolines.c | 5 ++++- + mono/mini/tramp-ppc.c | 4 ++++ + mono/sgen/sgen-archdep.h | 4 ++-- + 4 files changed, 18 insertions(+), 5 deletions(-) + +Index: mono-4.2.1/mono/mini/mini-ppc.c +=================================================================== +--- mono-4.2.1.orig/mono/mini/mini-ppc.c ++++ mono-4.2.1/mono/mini/mini-ppc.c +@@ -1086,7 +1086,10 @@ get_call_info (MonoGenericSharingContext + cinfo->args [n].size = size; + + /* It was 7, now it is 8 in LinuxPPC */ +- if (fr <= PPC_LAST_FPARG_REG) { ++ if (fr <= PPC_LAST_FPARG_REG ++ // For non-native vararg calls the parms must go in storage ++ && !(!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG)) ++ ) { + cinfo->args [n].regtype = RegTypeFP; + cinfo->args [n].reg = fr; + fr ++; +@@ -1177,7 +1180,10 @@ get_call_info (MonoGenericSharingContext + case MONO_TYPE_R8: + cinfo->args [n].size = 8; + /* It was 7, now it is 8 in LinuxPPC */ +- if (fr <= PPC_LAST_FPARG_REG) { ++ if (fr <= PPC_LAST_FPARG_REG ++ // For non-native vararg calls the parms must go in storage ++ && !(!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG)) ++ ) { + cinfo->args [n].regtype = RegTypeFP; + cinfo->args [n].reg = fr; + fr ++; +Index: mono-4.2.1/mono/mini/mini-trampolines.c +=================================================================== +--- mono-4.2.1.orig/mono/mini/mini-trampolines.c ++++ mono-4.2.1/mono/mini/mini-trampolines.c +@@ -1066,7 +1066,10 @@ mono_delegate_trampoline (mgreg_t *regs, + } + } + } +- } else { ++ // If "delegate->method_ptr" is null mono_get_addr_from_ftnptr will fail if ++ // ftnptrs are being used. "method" would end up null on archtitectures without ++ // ftnptrs so we can just skip this. ++ } else if (delegate->method_ptr) { + ji = mono_jit_info_table_find (domain, mono_get_addr_from_ftnptr (delegate->method_ptr)); + if (ji) + method = jinfo_get_method (ji); +Index: mono-4.2.1/mono/sgen/sgen-archdep.h +=================================================================== +--- mono-4.2.1.orig/mono/sgen/sgen-archdep.h ++++ mono-4.2.1/mono/sgen/sgen-archdep.h +@@ -88,8 +88,8 @@ + } while (0) + + /* MS_BLOCK_SIZE must be a multiple of the system pagesize, which for some +- archs is 64k. */ +-#if defined(TARGET_POWERPC64) && _CALL_ELF == 2 ++ architectures is 64k. */ ++#if defined(TARGET_POWERPC64) + #define ARCH_MIN_MS_BLOCK_SIZE (64*1024) + #define ARCH_MIN_MS_BLOCK_SIZE_SHIFT 16 + #endif +Index: mono-4.2.1/mono/mini/tramp-ppc.c +=================================================================== +--- mono-4.2.1.orig/mono/mini/tramp-ppc.c ++++ mono-4.2.1/mono/mini/tramp-ppc.c +@@ -625,8 +625,12 @@ mono_arch_get_nullified_class_init_tramp + + g_assert (code - buf <= tramp_size); + ++ if (info) + *info = mono_tramp_info_create ("nullified_class_init_trampoline", buf, code - buf, NULL, NULL); + ++ /* It is expected to be a function descriptor on power pre-v2 ABI */ ++ buf = mono_create_ftnptr (mono_domain_get (), buf); ++ + return buf; + } + diff --git a/mono-core.changes b/mono-core.changes index 75dde3b..40aed35 100644 --- a/mono-core.changes +++ b/mono-core.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Dec 10 15:08:07 UTC 2015 - normand@linux.vnet.ibm.com + +- new basic_changes_powerpc_be.patch to build ppc64 archi + and disable ppc build that still segfault. + ------------------------------------------------------------------- Tue Nov 17 00:00:00 UTC 2015 - fwdsbs.to.11df@xoxy.net, martin.liska@suse.com diff --git a/mono-core.spec b/mono-core.spec index 8a015e7..406dfd2 100644 --- a/mono-core.spec +++ b/mono-core.spec @@ -30,6 +30,8 @@ Url: http://www.mono-project.com Source0: http://download.mono-project.com/sources/mono/mono-%{version}.102.tar.bz2 Source1: mono-core.rpmlintrc Source2: gmcs +# ppc build segfault so exclude it +ExcludeArch: ppc # PATCH-FIX-OPENSUSE Use runtime 4.5 as default for nunit Patch0: mono-nunit-default-runtime-4.5.patch # PATCH-FIX-OPENSUSE authors file is missing @@ -37,6 +39,7 @@ Patch2: authors.patch # PATCH-FIX-OPENSUSE fix insecure use of strncat at process.c:383 to fix build process Patch3: strncat-process-c.patch Patch4: mono-un-revoke-fix-in-BNC-144655.patch +Patch5: basic_changes_powerpc_be.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: bison @@ -113,6 +116,7 @@ technologies that have been submitted to the ECMA for standardization. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build NOCONFIGURE="yes" ./autogen.sh