Special behaviour for _Dmodule_ref and _d_run_main?
Denis Feklushkin
feklushkin.denis at gmail.com
Mon May 11 09:52:30 UTC 2020
Hi!
I am trying to build app & druntime from sources with -flto
enabled and faced with this linker error:
ld.lld: error: undefined symbol: _Dmodule_ref
>>> referenced by app.d
>>> lto.tmp:(.text._D3app16__moduleinfoCtorZ+0x0)
>>> referenced by app.d
>>> lto.tmp:(_D3app16__moduleinfoCtorZ)
ld.lld: error: undefined symbol: _d_run_main
>>> referenced by entrypoint.d:35
>>> (/usr/lib/ldc/x86_64-linux-gnu/include/d/core/internal/entrypoint.d:35)
It seems that link-time optimization discards these characters as
unused.
I tried to add @assumeUsed into definitions, but it is not helps.
What can be ways to solve this problem?
Maybe LDC implements some special behaviour for _Dmodule_ref and
_d_run_main?
More information about the digitalmars-d-ldc
mailing list