[Mono-list] 64bit gmcs/mcs in SLES/openSuSE rpms?

Michael Hutchinson m.j.hutchinson at gmail.com
Fri Apr 24 14:46:16 EDT 2009


On Fri, Apr 24, 2009 at 10:44 AM, Chris Howie <cdhowie at gmail.com> wrote:
> On Thu, Apr 23, 2009 at 5:20 PM, dnadavewa <dnadavewa at yahoo.com> wrote:
>> What I found was the mono executable was indeed 64 bit, but gmcs.exe and
>> mcs.exe were 32 bit.

How did you determine that they're 32-bit? I'm pretty sure this is not
the case, since they're just IL code that gets JIT'd and run on the
Mono runtime.

> The architecture flag on .exe files is useless in this context since
> IL is not architecture-specific, and neither is C#.  (gmcs and mcs are
> written in C# themselves.)
>
> My guess is that the .exe files are flagged 32-bit so if you copy them
> to a 32-bit windows they will run.  (They should also run on 64-bit
> windows.)  If they were flagged 64-bit they would not run on 32-bit
> windows, and since they are IL that would make no sense.

Mono doesn't mark binaries as 32-bit or 64-bit specific. Such flags do
exist, but Mono neither sets nor respects them.

There are actually 3 GACs on Windows64: 64-bit, 32-bit, and noarch
("anycpu"/"MSIL"). The main purpose AFAIK is mixed-mode assemblies,
but it's also useful if you make P/Invokes to libraries that only
exist on one architecture, or have arch-specific struct layouts etc.
If your exe is marked as 32-bit, it's run with the 32-bit .NET
runtime, and can use 32-bit and noarch assemblies and GAC. Similarly,
64-bit exes are run in the 64-bit runtime and can use noarch and
64-bit libraries and GAC. On Win64, noarch executables, such the ones
compiled with Mono, get run by the 64-bit .NET runtime.

To run a GTK# app on Win64, I had to use corflags.exe from the .NET
SDK to mark the mcs-compiled exe as 32-bit, since GTK# currently only
works on 32-bit.

csc is able to set the platform directly. For more info, see
http://msdn.microsoft.com/en-us/library/zekwfyz4(VS.80).aspx

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Mono-list mailing list