Bug 20017 – JSON (-X) compilerInfo.architectures generation depends on params.isXXX for CPU detection

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-06-30T21:54:33Z
Last change time
2020-09-06T18:15:32Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2019-06-30T21:54:33Z
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");
Comment #1 by ibuclaw — 2020-09-04T21:44:17Z
(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)
Comment #2 by dlang-bot — 2020-09-04T23:03:40Z
@wilzbach created dlang/dmd pull request #11691 "Fix Issue 20017 - JSON (-X) compilerInfo.architectures generation depends on params.isXXX for CPU detection" fixing this issue: - Fix Issue 20017 - JSON (-X) compilerInfo.architectures generation depends on params.isXXX for CPU detection https://github.com/dlang/dmd/pull/11691
Comment #3 by dlang-bot — 2020-09-06T18:15:32Z
dlang/dmd pull request #11691 "Fix Issue 20017 - JSON (-X) compilerInfo.architectures generation depends on params.isXXX for CPU detection" was merged into master: - 3eea345513769962b2256708b9849c8d63d695f3 by Sebastian Wilzbach: Fix Issue 20017 - JSON (-X) compilerInfo.architectures generation depends on params.isXXX for CPU detection https://github.com/dlang/dmd/pull/11691