[Issue 20017] JSON (-X) compilerInfo.architectures generation depends on params.isXXX for CPU detection

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 4 21:44:17 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20017

Iain Buclaw <ibuclaw at gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw at gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Iain Buclaw from comment #0)
> These parameters will eventually become private to dmd/target.d, there is
> also no way for an interfacing compiler backend to add their own
> architectures (e.g: ARM, PowerPC, RISC-V, SystemZ, ...)
> 
> Also makes an incorrect use of version(X86), as that is only evaluated on
> the host, not the target.
> 
> if (global.params.is64bit)
>     item("x86_64");
> else
>     version(X86) item("x86");

To reiterate why this is bad.

1. Missing many architectures, hard coding them here would be wrong.
2. Cross compiling to x86 won't add any architectures (dmd -Xi -m32)

--


More information about the Digitalmars-d-bugs mailing list