Using mono aot / aot-full compilation: nothing appears to happen?
Asked Answered
K

2

7

I've got a C# project that I need compiled to a native binary. I've read here:

http://www.mono-project.com/AOT

That Mono can precompile an assembly to one of two options:

  1. --aot : A precompiled image (essentially the same as Ngen as it looks to me)
  2. --aot=full: A fully compiled to native binary instance of the original .exe

I am fairly sure I'm understanding those right, but could be wrong about the --aot=full option.

However, when I run:

 mono.exe --aot=full --verbose program.exe  

I get no output, the last modified date on the executable remains the same, and no files are generated. I've also tried just as a test:

 mono.exe --aot --verbose program.exe 

I get the same result; no output, no image file or files in general, nothing.

Am I missing something here?

Kev answered 7/11, 2011 at 16:38 Comment(2)
Which platform are you on? And which mono version are you trying?Whitted
@RolfBjarneKvinge Windows 7 x64, Mono v2.10.6Kev
P
6

You should probably make a bug report. AOT info is normally displayed even without --verbose. With --verbose you should get a LOT of prints. Another possibility is that you have broken Mono installation.

Nevertheless if you want to produce native executable binary, you should use mkbundle rather than AOT.

Prude answered 8/11, 2011 at 17:21 Comment(0)
A
3

You don't want --aot, you want mkbundle.

--aot tells mono to precompile some code rather than use the jit compiler, it does not give you a fully machine-code binary. For this you need mkbundle.

Anastasia answered 9/11, 2011 at 22:54 Comment(1)
mkbundle does NOT make native code from a .NET binary. it's just a packer. and can be easily reversed.Nonmoral

© 2022 - 2024 — McMap. All rights reserved.