Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Oct 2018 17:51:28 -0400
From:      Curtis Hamilton <clhamilto@gmail.com>
To:        freebsd-mono@freebsd.org
Subject:   Mono on PowerPC64
Message-ID:  <c46bad43-0b36-23e0-a3a5-b1516ad36d3d@gmail.com>

next in thread | raw e-mail | index | archive | help
I'm working to get the current Mono release to build on PowerPC64 (64-bit).

I wanted to check if anyone has experience with building Mono on non-X86 
platforms.  I'm sure that no one has build Mono on FreeBSD/PowerPC 
because there is an error in "mono/utils/mono-sigcontext.h" that 
prevents Mono from building, 32-bit.  The code in question is:

@@ -363,10 +363,10 @@
  #elif defined(__FreeBSD__)
      typedef ucontext_t os_ucontext;

-    #define UCONTEXT_REG_Rn(ctx, n) ((ctx)->uc_mcontext.mc_gpr [(n)])
-    #define UCONTEXT_REG_FPRn(ctx, n) ((ctx)->uc_mcontext.mc_fpreg [(n)])
-    #define UCONTEXT_REG_NIP(ctx) ((ctx)->uc_mcontext.mc_srr0)
-    #define UCONTEXT_REG_LNK(ctx) ((ctx)->uc_mcontext.mc_lr)
+    #define UCONTEXT_REG_Rn(ctx, n) 
(((os_ucontext*)(ctx))->uc_mcontext.mc_gpr [(n)])
+    #define UCONTEXT_REG_FPRn(ctx, n) 
(((os_ucontext*)(ctx))->uc_mcontext.mc_fpreg [(n)])
+    #define UCONTEXT_REG_NIP(ctx) 
(((os_ucontext*)(ctx))->uc_mcontext.mc_srr0)
+    #define UCONTEXT_REG_LNK(ctx) 
(((os_ucontext*)(ctx))->uc_mcontext.mc_lr)
  #elif defined(_AIX)
      typedef ucontext_t os_ucontext;


I can successfully build 32-bit Mono on PowerPC, however, for 64-bit I 
get a SIGILL when building.

System.Net/HttpConnection.cs(57,19): warning CS0414: The private field 
`System.Net.HttpConnection.cert' is assigned but its value is never used
System.Net/HttpWebRequest.cs(86,10): warning CS0414: The private field 
`System.Net.HttpWebRequest.initialMethod' is assigned but its value is 
never used
System.Net/WebConnection.cs(196,25): warning CS0649: Field 
`System.Net.WebConnection.ID' is never assigned to, and will always have 
its default value `0'
System.Net/WebConnectionStream.cs(46,10): warning CS0414: The private 
field `System.Net.WebConnectionStream.locker' is assigned but its value 
is never used
System.Net/WebConnectionStream.cs(49,17): warning CS0649: Field 
`System.Net.WebConnectionStream.IgnoreIOErrors' is never assigned to, 
and will always have its default value `false'
System.Net/WebOperation.cs(65,25): warning CS0649: Field 
`System.Net.WebOperation.ID' is never assigned to, and will always have 
its default value `0'
System.Net/WebOperation.cs(66,10): warning CS0649: Field 
`System.Net.WebOperation.ME' is never assigned to, and will always have 
its default value `null'
System.Net/WebRequestStream.cs(49,28): warning CS0649: Field 
`System.Net.WebRequestStream.ME' is never assigned to, and will always 
have its default value `null'
System.Net/WebResponseStream.cs(78,28): warning CS0649: Field 
`System.Net.WebResponseStream.ME' is never assigned to, and will always 
have its default value `null'
Compilation succeeded - 45 warning(s)
MCS     [basic] System.Xml.dll
MCS     [basic] System.Security.dll
../../../external/corefx/src/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/KeyInfoRetrievalMethod.cs(78,24): 
warning CS0219: The variable `retrievalMethodElement' is assigned but 
its value is never used
System.Security.Cryptography.Xml/SignedXml.cs(391,11): warning CS0219: 
The variable `hashvalue' is assigned but its value is never used
Compilation succeeded - 2 warning(s)
MCS     [basic] System.Core.dll
../../build/common/MonoTODOAttribute.cs(100,25): warning CS1635: Cannot 
restore warning `CS0436' because it was disabled globally
../../../external/corefx/src/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/IncrementalHash.net46.cs(23,26): 
warning CS0472: The result of comparing value type 
`System.Security.Cryptography.HashAlgorithmName' with null is always `true'
Compilation succeeded - 2 warning(s)
MCS     [basic] System.ComponentModel.Composition.dll
MCS     [basic] System.Numerics.dll
MCS     [basic] System.Xml.Linq.dll
MCS     [basic] Mono.Cecil.dll
MCS     [basic] Mono.Cecil.Mdb.dll
MCS     [basic] Mono.CompilerServices.SymbolWriter.dll
MCS     [basic] PEAPI.dll
mkdir -p -- ../../class/lib/basic/tmp/
MCS     [basic] cil-stringreplacer.exe
./../jay/jay: 7 rules never reduced
./../jay/jay: 14 shift/reduce conflicts.
MCS     [basic] ilasm.exe
ILParser.cs(165,37): warning CS0429: Unreachable expression code detected
ILParser.cs(165,68): warning CS0429: Unreachable expression code detected
ILParser.cs(166,7): warning CS0162: Unreachable code detected
codegen/CodeGen.cs(460,48): warning CS0219: The variable `asmb' is 
assigned but its value is never used
codegen/DebuggingInfo.cs(103,16): warning CS0219: The variable `entry' 
is assigned but its value is never used
codegen/PeapiTypeRef.cs(249,25): warning CS0162: Unreachable code detected
codegen/CodeGen.cs(60,30): warning CS0414: The private field 
`Mono.ILASM.CodeGen.image_base' is assigned but its value is never used
codegen/MethodDef.cs(54,33): warning CS0414: The private field 
`Mono.ILASM.MethodDef.codegen' is assigned but its value is never used
codegen/DataDef.cs(18,43): warning CS0414: The private field 
`Mono.ILASM.DataDef.segment' is assigned but its value is never used
Compilation succeeded - 9 warning(s)
Assembling 
'../../../class/corlib/System.Runtime.CompilerServices/Unsafe.il' , no 
listing file, to dll --> '../../../class/lib/basic/corlib.unsafe.dll.tmp'

../../../class/corlib/System.Runtime.CompilerServices/Unsafe.il : 
Warning -- Reference to undeclared extern assembly 'mscorlib', adding.
Operation completed successfully
mkdir -p -- ../../../class/lib/basic/Facades/
./../jay/jay: 7 shift/reduce conflicts.
MCS     [basic] System.Runtime.dll
MCS     [basic] System.Collections.dll
MCS     [basic] System.Reflection.dll
MCS     [basic] mcs.exe
MCS     [basic] System.Resources.ResourceManager.dll
MCS     [basic] System.Globalization.dll
MCS     [basic] System.Threading.Tasks.dll
MCS     [basic] System.Collections.Concurrent.dll
MCS     [basic] System.Text.Encoding.dll
MCS     [basic] System.IO.dll
MCS     [basic] System.Threading.dll
MCS     [basic] System.Diagnostics.Debug.dll
MCS     [basic] System.Linq.Expressions.dll
MCS     [basic] System.Dynamic.Runtime.dll
MCS     [basic] System.Linq.dll
MCS     [basic] System.Threading.Tasks.Parallel.dll
MCS     [basic] System.Xml.ReaderWriter.dll
MCS     [basic] System.Diagnostics.Tools.dll
MCS     [basic] System.Reflection.Primitives.dll
MCS     [basic] System.Runtime.Extensions.dll
MCS     [basic] System.Runtime.InteropServices.dll
MCS     [basic] System.Text.Encoding.Extensions.dll
MCS     [basic] System.Runtime.Numerics.dll
MCS     [basic] System.Xml.XDocument.dll
MCS     [basic] System.Reflection.Extensions.dll
MCS     [basic] System.IO.FileSystem.Primitives.dll
MCS     [basic] System.IO.FileSystem.dll
MCS     [basic] System.Diagnostics.FileVersionInfo.dll
MCS     [basic] System.Security.Cryptography.Primitives.dll
MCS     [basic] System.Security.Cryptography.Algorithms.dll
MCS     [basic] System.ValueTuple.dll
MCS     [basic] System.Text.Encoding.CodePages.dll
Creating .dep_dirs-build...
Creating .dep_dirs-build...
mkdir -p -- ../../class/lib/build-linux/
Stacktrace:

   at <unknown> <0xffffffff>
   at System.Globalization.CultureData.get_Invariant () [0x000b2] in 
<445343b3499f4493aad682c3d706c4c0>:0
   at <unknown> <0xffffffff>
   at Mono.ILASM.Driver.Main (string[]) [0x00005] in 
<cab757a6a332478ea5d0afa123379e6b>:0
   at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object 
(object,intptr,intptr,intptr) [0x00054] in 
<cab757a6a332478ea5d0afa123379e6b>:0

=================================================================
Got a SIGILL while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

gmake[10]: *** [il/il.make:4: 
../../class/lib/build-linux/corlib.unsafe.dll.tmp] Abort trap (core dumped)
gmake[10]: *** Waiting for unfinished jobs....
gmake[9]: *** [../../build/rules.make:211: do-all] Error 2
gmake[8]: *** [../build/rules.make:232: all-recursive] Error 1
gmake[7]: *** [build/rules.make:232: all-recursive] Error 1
gmake[6]: *** [Makefile:54: profile-do--build--all] Error 2
gmake[5]: *** [Makefile:50: profiles-do--all] Error 2
gmake[4]: *** [Makefile:610: all-local] Error 2
gmake[4]: Leaving directory 
'/usr/ports/lang/mono/work/mono-5.14.0.177/runtime'
gmake[3]: *** [Makefile:552: all-recursive] Error 1
gmake[3]: Leaving directory '/usr/ports/lang/mono/work/mono-5.14.0.177'
gmake[2]: *** [Makefile:482: all] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/mono/work/mono-5.14.0.177'
===> Compilation failed unexpectedly.

Anyone with suggestions will be greatly appreciated.

Regards,

Curtis




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c46bad43-0b36-23e0-a3a5-b1516ad36d3d>