Summary: | ARM: Illegal instruction in runnable/aliasthis.d and with -O2 | ||
---|---|---|---|
Product: | GDC | Reporter: | Johannes Pfau <johannespfau> |
Component: | gdc | Assignee: | Iain Buclaw <ibuclaw> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | --- | ||
Version: | development | ||
Hardware: | ARM | ||
OS: | Linux | ||
Attachments: |
Reduced test case
gdb backtrace gdc -v ouput / system info |
Created attachment 2 [details]
gdb backtrace
Created attachment 3 [details]
gdc -v ouput / system info
Actually seems to happen for any assert or thrown Exception. I remember Exceptions where working some time ago, so this is probably an error in my gdc / gcc configuration. As this occurs in a libgcc .S file, yes it does seem like a configuration problem let's have a look and see what causes that illegal instruction to be ran... That particular assembly code is intended for !__ARM_ARCH_6M__ systems. Having a look at gcc-4.8/gcc/config/arm/arm-arches.def Perhaps you need to reconfigure with --with-arch=armv6-m or armv6s-m for soft float. Regards Iain. (In reply to comment #6) > Having a look at gcc-4.8/gcc/config/arm/arm-arches.def > > Perhaps you need to reconfigure with --with-arch=armv6-m or armv6s-m for soft > float. > At least, I assume the 's' bit means soft. ;) No, I think it's a gdc bug. I think something recently broke the ARM EABI unwinder. The gcc executable from the same build as the gdc executable works. And the version (GNU_ARM_EABI_Unwinder) is not set, although it is detected by configure and DCFG_ARM_EABI_UNWINDER is set to "GNU_ARM_EABI_Unwinder". Seems the reason is this commit: https://github.com/D-Programming-GDC/gdc/commit/ffed7d684e94d2b933a7d2f27403d8fb7de65314 DCFG_ARM_EABI_UNWINDER=GNU_ARM_EABI_Unwinder ends up in the toplevel phobos-ver-syms file, but not in libdruntime/phobos-ver-syms. Seems the libdruntime/phobos-ver-syms.in file wasn't updated in https://github.com/D-Programming-GDC/gdc/commit/ffed7d684e94d2b933a7d2f27403d8fb7de65314 I'm not sure if using the wrong unwinder can have such an effect. But I looked at the exception handling code in libgcc and there's no reason why it would work for c++ but not form gdc, unless we corrupt the context in the personality routine. yep, that was the problem. Fix: https://github.com/D-Programming-GDC/gdc/pull/31 |
Created attachment 1 [details] Reduced test case The test suite fails on runnable/aliasthis.d on ARM with an "Illegal instruction" message. This does not happen on x86/x86-64. Probably triggered by libgcc (unwinder) and a cross platform bug? A reduced test case, the gdb backtrace and gdc -v is attached.