Weird linker errors

Kjartan F. Kvamme forbjok at gmail.com
Sun Dec 2 15:27:59 UTC 2018


I asked about this in the IRC channel, and was advised to ask 
about it here as well.

There's this weird linker error that's been bugging me every time 
I run into it for a year or two, so I finally got around to 
putting together a minimal reproduction of the issue.

Basically, under specific circumstances, I'm getting linker 
errors about "taggedalgebraic", a dependency of "std_data_json" 
which is used in the projects I'm running into this with. 
However, I highly suspect the issue is a DUB or compiler issue 
rather than the fault of taggedalgebraic.

I'm still not sure what the exact trigger for it is, but I 
managed to put together a fairly minimal reproduction by just 
shaving away code a little bit at a time from the original 
projects I was having this issue with.

It happens _only_ in RELEASE builds, not debug builds, and 
therefore has basically forced me to build some of my projects in 
debug mode for production use.

The errors happen with both DMD (v2.083.0) and LDC2 (v1.12.0), 
and both on Windows and Linux (64-bit Arch Linux). (slightly 
different messages, but basically the same error)
It's also not new. I don't remember exactly when I first 
encountered this, but it's definitely been around for a while - 
most likely at least 1-2 years.

Repository with minimal reproduction of issue:
https://github.com/forbjok/dlang-weird-linker-errors-repro

The error messages I'm getting are included in the repository's 
README.txt.

Perhaps someone can help me shed some light on this, and where 
(if at all) I should file a bug about this?


More information about the Digitalmars-d mailing list