d_eh_personality required when building an OS with betterC/amd64

Streaksu assemblyislaw at gmail.com
Sun May 31 08:42:16 UTC 2020


On Sunday, 31 May 2020 at 08:41:32 UTC, Streaksu wrote:
> Hi, In my OS project I started using struct destructors, and 
> when using them for the first time, using them triggered a link 
> error, reporting that `_d_eh_personality` is missing.
>
> I stubbed the function using `extern (C) int 
> _d_eh_personality(int a, int b, void* c, int d, void* e) { 
> assert(0); }`, this works for release builds, but as soon as I 
> add `-d-debug` to the flags I use, the signature stops being 
> valid and fails compilation with `Error: Incompatible 
> declaration of runtime function _d_eh_personality`, when 
> compiling the same function.
>
> What prototypes should I be stubbing to get this to work? Why 
> are this function required when dealing with struct destructors?
> I'm using LDC 1.21.0 with LLVM 10.0.0

Forgot to mention I'm using betterC with `-betterC`, sorry for 
the inconvenience


More information about the digitalmars-d-ldc mailing list