Xinlong-Wu / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
5 stars 0 forks source link

Unable to compile in Fedora RV64 #3

Closed U2FsdGVkX1 closed 10 months ago

U2FsdGVkX1 commented 10 months ago

Compile mono-6.13.0.1278 based on the official Fedora spec.

parameter: ./configure --build=riscv64-redhat-linux-gnu --host=riscv64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --runstatedir=/run --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-rpath --with-csc=mcs --disable-system-aot --with-moonlight=no

stacktrace:

=================================================================
        Native Crash Reporting
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
=================================================================
        Native stacktrace:
=================================================================
        0x40000802a0 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x400006adf8 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x400007c796 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4002c1c000 - Unknown
        0x4002d3ccbe - /lib64/lp64d/libc.so.6 :
        0x4002d039c8 - /lib64/lp64d/libc.so.6 : gsignal
        0x4002cf21f6 - /lib64/lp64d/libc.so.6 : abort
        0x4000247fda - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4000260abe - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x40002610fc - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono : monoeg_assertion_message
        0x4000261156 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono : monoeg_log_set_default_handler
        0x400007f77e - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4000084218 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x400002fdd2 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4000031b52 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x400019f53c - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4000130c26 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4000130da4 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x40000fb6b4 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x40000fc508 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4000035324 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4000044284 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono : mono_main
        0x400002b58e - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono :
        0x4002cf23c8 - /lib64/lp64d/libc.so.6 :
        0x4002cf2474 - /lib64/lp64d/libc.so.6 : __libc_start_main
        0x400002bab8 - /builddir/build/BUILD/mono-6.13.0.1278/mono/mini/mono : _start
=================================================================
        Telemetry Dumper:
=================================================================
Thread 0x4002e3e020 starting summarize_execute
Entering thread summarizer pause from 0x4005d9a160
/builddir/build/BUILD/mono-6.13.0.1278/runtime/etc/../bin/mono-hang-watchdog: line 3: /builddir/build/BUILD/mono-6.13.0.1278/tools/mono-hang-watchdog/mono-hang-watchdog: No such file or directory
Finished thread summarizer pause from 0x4005d9a160.
* Assertion: should not be reached at exceptions-riscv.c:209

Fedora uses some patches, I don't know if there are side effects If you need to reproduce, please use mock configuration

config_opts['target_arch'] = 'riscv64'
config_opts['legal_host_arches'] = ('riscv64',)
config_opts['qemu_user_static_mapping'] = {
    'riscv64': 'riscv64',
}
config_opts['scm_opts']['git_get'] = 'git clone SCM_BRN https://src.fedoraproject.org/rpms/SCM_PKG.git SCM_PKG'
config_opts['mirrored'] = config_opts['target_arch'] != 'i686'
config_opts['chroot_setup_cmd'] = 'install @{% if mirrored %}buildsys-{% endif %}build'
config_opts['dist'] = 'fc{{ releasever }}'
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '38'
config_opts['package_manager'] = 'dnf'
config_opts['dnf.conf'] = """

[main]
keepcache=1
debuglevel=2
reposdir=/dev/null
logfile=/var/log/yum.log
retries=20
obsoletes=1
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
install_weak_deps=0
metadata_expire=0
best=1
module_platform_id=platform:f{{ releasever }}
protected_packages=
user_agent={{ user_agent }}

# repos
[fedora-38-openkoji-riscv-koji-repo]
name=Fedora 38 RISC-V koji build repo on OpenKoji
baseurl=http://openkoji.iscas.ac.cn/kojifiles/repos/f38-build-side-42-init-devel/latest/$basearch/
cost=2000
enabled=1
skip_if_unavailable=True

or I can provide SSH, please contact me

build.log

Xinlong-Wu commented 10 months ago

could you check the Mono version used to compile?

cuz in build log, it report

MCS     [build-linux] gensources.exe
* Assertion: should not be reached at mini-riscv.c:448

and

watchdog/mono-hang-watchdog: No such file or directory
Finished thread summarizer pause from 0x4005d9a160.
* Assertion: should not be reached at exceptions-riscv.c:209

These error always caused by NOT_IMPLEMENTED;

it will be extend to

#define NOT_IMPLEMENTED do { g_assert_not_reached (); } while (0)

but in the current upstream, There is no line of NOT_IMPLEMENTED; at mini-riscv.c:448 and exceptions-riscv.c:209

U2FsdGVkX1 commented 10 months ago

could you check the Mono version used to compile?

cuz in build log, it report

MCS     [build-linux] gensources.exe
* Assertion: should not be reached at mini-riscv.c:448

and

watchdog/mono-hang-watchdog: No such file or directory
Finished thread summarizer pause from 0x4005d9a160.
* Assertion: should not be reached at exceptions-riscv.c:209

These error always caused by NOT_IMPLEMENTED;

it will be extend to

#define NOT_IMPLEMENTED do { g_assert_not_reached (); } while (0)

but in the current upstream, There is no line of NOT_IMPLEMENTED; at mini-riscv.c:448 and exceptions-riscv.c:209

it's mono-6.13.0.1278 mono nightly version

https://download.mono-project.com/sources/mono/nightly/mono-6.13.0.1278.tar.xz

Xinlong-Wu commented 10 months ago

That would be the problem, you are using the code at repo https://github.com/mono/mono .

But we are working on the repo https://github.com/dotnet/runtime . beacuse as said

mono/mono accepts bug-fix level changes only. dotnet/runtime is the place to contribute. Originally posted by @jkotas in https://github.com/dotnet/runtime/issues/36748#issuecomment-1258474444

Thus you can only find the risc-v support at https://github.com/dotnet/runtime and waiting for backport to mono/mono