|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000560||mercury||Bug||public||2022-05-27 17:37||2022-05-31 16:24|
|Target Version||Fixed in Version|
|Summary||0000560: asm_fast.gc crashes on aarch64 with gcc 10.2|
|Description||Configure enables asm_fast.gc by default on aarch64 but it doesn't work with newer versions of gcc:|
gcc 10.2, Debian 11 - crash
gcc 8.3.0, Debian 10 - ok
gcc 6.3.0, Debian 9 - ok
reg.gc works so far on a few small programs. I have not tried a bootcheck yet (emulation is slow).
|Tags||No tags attached.|
Does the crash with the sample programs occur with GCC 10.2 occur with:
a. --mercury-linkage shared
b. --mercury-linkage static
Have you tried compiling with gcc -O0?
|It crashes in all three cases (--mercury-linkage shared, --mercury-linkage static, compiling the standard library and hello.m with gcc -O0).|
Debian 11 also has a package for gcc version 9.3.0.
The sample programs also crash in asm_fast.gc using gcc 9.3.0 in all three cases (--mercury-linkage shared, --mercury-linkage static, compiling the standard library and hello.m with gcc -O0).
|In the absence of an immediate fix, I suggest we disable the use of asm_fast as the LLDS base grade on aarch64 for GCC >= 9 on both the master and release branches (assuming reg.gc is ok.)|
It has something to do with PIC. Adding this to Mmake.params and compiling the sample programs without PIC makes them not crash:
EXTRA_CFLAGS = -fno-pic -fno-PIC -static
EXTRA_MLFLAGS = -static
(That makes me a bit suspicious that it is something similar to the PIC register issue on x86, but it might be completely unrelated.)
For now I agree we should disable asm_fast on aarch64 with GCC >= 9. I'm doing a partial bootcheck on reg.gc to make sure that works ok.
|2022-05-27 17:37||wangp||New Issue|
|2022-05-27 17:38||wangp||Severity||minor => crash|
|2022-05-27 17:50||juliensf||Note Added: 0001195|
|2022-05-30 12:10||wangp||Note Added: 0001196|
|2022-05-31 12:37||wangp||Note Added: 0001197|
|2022-05-31 14:18||juliensf||Note Added: 0001198|
|2022-05-31 16:24||wangp||Note Added: 0001199|