docker icon indicating copy to clipboard operation
docker copied to clipboard

Hello world failed to AOT compile on "mono:latest"

Open rdebath opened this issue 4 years ago • 1 comments

EDIT: See also: https://github.com/mono/mono/issues/21515

I tried to compile a trivial program then process it using LLVM aot. The error looks like this: https://github.com/mono/mono/issues/18779 and this: https://github.com/xamarin/xamarin-macios/pull/7833

The non-llvm version of AOT works.

$ docker run --rm -it mono:latest
root@58880953e546:/# cd /tmp
root@58880953e546:/tmp# ls
root@58880953e546:/tmp# mono --version
Mono JIT compiler version 6.12.0.107 (tarball Thu Dec 10 05:28:17 UTC 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        Interpreter:   yes
        LLVM:          yes(610)
        Suspend:       hybrid
        GC:            sgen (concurrent by default)
root@58880953e546:/tmp# cat > hello.cs
// Hello World! program
namespace HelloWorld
{
    class Hello {
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");
        }
    }
}
root@58880953e546:/tmp# csc hello.cs
Microsoft (R) Visual C# Compiler version 3.6.0-4.20224.5 (ec77c100)
Copyright (C) Microsoft Corporation. All rights reserved.

root@58880953e546:/tmp# mono --aot=mcpu=generic --llvm -O=all,-shared hello.exe
Mono Ahead of Time compiler - compiling assembly /tmp/hello.exe
AOTID FA76F661-DF92-D31D-9484-23A274DD7DAC
Executing opt: "/usr/lib/mono/llvm/bin/opt" -f -O2 -disable-tail-calls -place-safepoints -spp-all-backedges -o "mono_aot_sHrVqP/temp.opt.bc" "mono_aot_sHrVqP/temp.bc"
Executing llc: "/usr/lib/mono/llvm/bin/llc"  -march=x86-64 -mcpu=generic -enable-implicit-null-checks -disable-fault-maps -asm-verbose=false -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=mono_aot_hello_eh_frame -disable-tail-calls -no-x86-call-frame-opt -relocation-model=pic -filetype=obj -o "mono_aot_sHrVqP/temp-llvm.o" "mono_aot_sHrVqP/temp.opt.bc"
llc: Unknown command line argument '-disable-fault-maps'.  Try: '/usr/lib/mono/llvm/bin/llc -help'
llc: Did you mean '-disable-tail-calls'?
AOT of image hello.exe failed.
root@58880953e546:/tmp#

rdebath avatar Apr 25 '21 12:04 rdebath

This still fails in the same way. Mono version now 6.12.0.122

rdebath avatar Jun 03 '22 17:06 rdebath