Linker error when building dmd backend

Johan Engelen j at j.nl
Sun Dec 23 13:05:06 UTC 2018


On Sunday, 23 December 2018 at 12:16:53 UTC, Thomas Mader wrote:
> On Sunday, 23 December 2018 at 10:15:53 UTC, Walter Bright 
> wrote:
>> On 12/22/2018 6:29 PM, Thomas Mader wrote:
>>> To me it looks like fp.c has the implementation and evalu8 is 
>>> using it.
>>> The name mangling of fp.c compiled with g++ is different from 
>>> evalu8.d compiled with ldc.
>>
>> I wonder why you're compile some parts with g++ and some with 
>> ldc.
>
> You are right I also like to keep things the same and less 
> complex but to be honest I tried to use clang but failed. The 
> std environment in Nix on Linux is gcc and I don't know yet how 
> to properly overwrite it.

It is normal to use g++ with ldc. You should use your system 
compiler with ldc, and that's of course not necessarily clang.

The mangling is done by LDC itself, not LLVM, and so it is a bug 
in LDC. In this particular case, the second argument of _modulo 
is the same as the first and the mangler is (incorrectly) 
replacing the type of the second with a backreference to the 
first type. That's what the mangler should do for user types, but 
not for builtin types.

-Johan



More information about the Digitalmars-d mailing list