LDC crash when compiling custom barebones runtime

Dylan Graham dylan.graham2000 at gmail.com
Wed Sep 23 16:48:25 UTC 2020

Hi, I'm working on a barebones runtime targeting the ARM Cortex M 
CPU lineup. I've got classes, structs, invariants, asserts and 
contract compilation working - but whenever I use an interface, 
despite providing a stub TypeInfo_Interface for it, LDC 1.23.0 
and 1.21.0 crashes.

I am building on Windows 10 x64.

The following is my ldc2 1.23.0 command:
> ldc2 app.d object.d rtoslink.d util.d memory.d -defaultlib= 
> -mtriple=arm-none-eabi -mcpu=cortex-m4 -d-debug -gc 
> -float-abi=hard

This is the output:
> 0x00007FF6B3749649 (0x0000000000000000 0x0000000000000000 
> 0x000000E24E1FDD30 0x0000003F00000002)
> 0x00007FF6B57B4FB0 (0x00000233A388C1E0 0x000000E200000000 
> 0x00000233A391F388 0x00007FF6B578DC03)
> 0x00007FF6B5742018 (0x00000233A388C678 0x0000000000000040 
> 0x000000E24E1FDC90 0x00000233A388F980)
> 0x00007FF6B57558E8 (0x0000000000000050 0x0000000000000168 
> 0x00000233A1850E40 0x0000000000000001)
> 0x00007FF6B5773A05 (0x00007FF6B65EBF5B 0x0000000002000002 
> 0x00007FF6B65C2E69 0x0000000000000004)
> 0x00007FF6B5703159 (0x0000000000000000 0x0000000000000000 
> 0x0000000000000000 0x0000000000000000)
> 0x00007FF6B5771510 (0x000000000000000F 0x000000000000000C 
> 0x0032006308000008 0x00000233A1851140)
> 0x00007FF6B5887659 (0x0000000000000000 0x000000E24E1FFA08 
> 0x0000000300000001 0x0000000000000000)
> 0x00007FF6B5887337 (0x00000233A192B8B8 0x000000E24E1FFCD8 
> 0x000000E24E1FFB10 0x0000000000000000)
> 0x00007FF6B58875E3 (0x0000000000000010 0x00007FF600000000 
> 0x00000233A192B9DE 0x0000000000000010)
> 0x00007FF6B576BEEC (0x0000000000000000 0x0000000000000000 
> 0x0000000000000000 0x0000000000000000)
> 0x00007FF6B58C60C8 (0x0000000000000000 0x0000000000000000 
> 0x0000000000000000 0x0000000000000000)
> 0x00007FFCA2C17BD4 (0x0000000000000000 0x0000000000000000 
> 0x0000000000000000 0x0000000000000000), BaseThreadInitThunk() + 
> 0x14 bytes(s)
> 0x00007FFCA2D6CE51 (0x0000000000000000 0x0000000000000000 
> 0x0000000000000000 0x0000000000000000), RtlUserThreadStart() + 
> 0x21 bytes(s)

My user code is:
> interface I {}
> class A : I {}

That causes a crash.

This is my object.d: 

Not really sure what is failing. Thanks in advance for the help.

More information about the digitalmars-d-ldc mailing list