Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LLVM AOT fails. #21515

@rdebath

Description

@rdebath

Steps to Reproduce

  1. Run a trivial "smoke test"
debian-buster64(robert)~$ docker run --rm -it mono:latest bash
root@35a955a211eb:/# apt update && apt upgrade
Get:1 https://download.mono-project.com/repo/debian stable-buster/snapshots/6.12.0.182 InRelease [5874 B]
Get:2 http://deb.debian.org/debian buster InRelease [122 kB]
Get:3 https://download.mono-project.com/repo/debian stable-buster/snapshots/6.12.0.182/main amd64 Packages [48.8 kB]
Get:4 http://deb.debian.org/debian-security buster/updates InRelease [65.4 kB]
Get:5 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
Get:6 http://deb.debian.org/debian buster/main amd64 Packages [7911 kB]
Get:7 http://deb.debian.org/debian-security buster/updates/main amd64 Packages [334 kB]
Get:8 http://deb.debian.org/debian buster-updates/main amd64 Packages [8788 B]
Fetched 8547 kB in 7s (1305 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Conflicting distribution: https://download.mono-project.com/repo/debian stable-buster/snapshots/6.12.0.182 InRelease (expected stable-buster/snapshots/6.12.0.182 but got buster)
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@35a955a211eb:/# cd /tmp
root@35a955a211eb:/tmp# mono --version
Mono JIT compiler version 6.12.0.182 (tarball Tue Jun 14 22:43:31 UTC 2022)
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@35a955a211eb:/tmp# cat > hello.cs
namespace HelloWorld
{
    class Hello {
        static void Main(string[] args)
        {
            System.Console.WriteLine("Hello World!");
        }
    }
}
root@35a955a211eb:/tmp# csc hello.cs
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

root@35a955a211eb:/tmp# mono --aot=mcpu=generic --llvm -O=all,-shared hello.exe
llvm load failed: /usr/lib/libmono-llvm.so: undefined symbol: mono_codeman_enable_write

Mono Warning: llvm support could not be loaded.
Mono Ahead of Time compiler - compiling assembly /tmp/hello.exe
AOTID FFAA613A-8F1D-FEBA-AB5F-6C8DA4648F35
Compiled: 2/2
Executing the native assembler: "as" --64  -o /tmp/mono_aot_4xIgtd.o /tmp/mono_aot_4xIgtd
Executing the native linker: "ld" -shared -o /tmp/hello.exe.so.tmp  /tmp/mono_aot_4xIgtd.o
JIT time: 0 ms, Generation time: 0 ms, Assembly+Link time: 16 ms.
root@35a955a211eb:/tmp#

Current Behavior

Uses Mono AOT

Expected Behavior

Use LLVM AOT

On which platforms did you notice this

[ ] macOS
[X] Linux
[ ] Windows

Version Used:

root@35a955a211eb:/tmp# mono --version
Mono JIT compiler version 6.12.0.182 (tarball Tue Jun 14 22:43:31 UTC 2022)
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@35a955a211e

See also

Is LLVM AOT even supported these days ?
Perhaps you should add a "smoke test" to ensure it is actually compiled correctly!
mono/docker#87
#18779
dotnet/macios#7833

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions