SuSE treats "gnueabi" as "gnueabihf" so make sure that we normalise the environment.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
This looks good but please fix the typo in comments: SuSE -> SUSE
Also please use the correct triple: armv7hl-suse-linux-gnueabi (at least in the second test I think.)
Also the vendor test in TripleTest.cpp should be updated.
Yes, the idea is that the textual IR uses the correct triple, unless it is overidden at the command line.
@majnemer thats the idea :-). Passing either triple to clang would give the right behaviour (clang will normalize the triple before passing it to cc1).
IIRC, the problem here is of consistency.
The Triple usage throughout LLVM is broken wrt float ABI, but "hf" at the end of the environment "makes it work". The reason being that "gnueabihf" is the mostly tested environment, so it converged to work by accident.
The target that clang passes to LLVM is, therefore, also broken. Making Clang change from "eabi" to "eabihf" would "work", in the sense that in some cases, the correct float ABI would be selected. But it would also serialise the *wrong* triple in IR.
Again, that solution has "converged" to work, because the IR triple doesn't have to make sense (for example "thumbv7a"), so it's possible that, for all intended purposes, just changing the environment in the clang driver should be enough.
If it wasn't for the fact, of course, that we already do that with Arch/CPU names, sometimes getting it terrible wrong, and most times "fixing" it with by "accidental convergence".
I'm not against continuing this pattern, as I certainly don't have time (and health) to try and fix the clang driver for the Nth time, but I just want to make clear to all parties involved that none of that is a "solution". :)
The real solution would be to continue Daniel's Triple refactoring [1] until all fields are uniquely represented on both Clang and LLVM.
</rant>
[1] Some references: