Open chrisnc opened 3 weeks ago
X86 has a similar issue, where -x87
on a typical hard-float target will silently switch to the soft-float ABI. IMO it'd be better to error there, too, so that an explicit +soft-float
is required to use the soft-float ABI -- that avoids nasty surprises where code doesn't use the ABI it is expected to use.
@llvm/issue-subscribers-clang-driver
Author: Chris Copeland (chrisnc)
@llvm/issue-subscribers-backend-arm
Author: Chris Copeland (chrisnc)
Yeah, that makes sense. Ideally it would be an error in llvm as well, in a way that the logic does not live in clang but can be reused by other frontends.
A similar issue exists with target features: if I pass -fpregs
to createTargetMachine
, it will silently change the ABI. I would expect an error saying that the registers are missing for this ABI. If I pass +soft-float,-fpregs
, then everything is fine as I explicitly asked for the ABI change.
@RalfJung I believe the PR I have linked to this issue https://github.com/llvm/llvm-project/pull/111334 will address that case as well (for Arm at least). If the hard-float ABI is used but the fpregs feature isn't present, it errors out. I'll confirm this later.
That would be great :)
In GCC, this is treated as an error, because the chosen CPU cannot implement the ABI that has been requested.
https://godbolt.org/z/89YGKW79P