[cfe-dev] Clang triple canonicalization

Renato Golin renato.golin at linaro.org
Mon Aug 5 14:24:35 PDT 2013


On 5 August 2013 14:44, Kal Conley <kcconley at gmail.com> wrote:

> I figured out the normalization is done in
> llvm::sys::getDefaultTargetTriple. Changing the implementation to simply
> return LLVM_DEFAULT_TARGET_TRIPLE fixes the problem. I'm still not clear on
> why this normalization is done. Would it make sense to add a configure
> option to disable this normalization for cases where the target is known?
>

I think this is more an emergent behaviour than design.

It is good to normalize (or canonicalize) the triples, to make sure we pass
the correct options down the sub-commands / sub-components of LLVM, but
only as long as the canonicalized triple reflects correctly the target
you're trying to.

I learnt the hard way that most of arm*-none-eabi were being converted to
armv4t--none-eabi because they were missing, and most only worked when you
set the cpu, fpu and abi manually on all stages, to guarantee that, even
with a bogus triple, the behaviour would be expected. That was several
years ago, much of that was fixed, but some odd cases still remain.

This is also not specific to Clang, but the LLVM's Triple is also lacking,
so both sides need serious review.

Regarding the specific names (i386 instead of i586), this is again,
historical. Some people think we should try to mimic GNU's triples as close
as possible, others think we should abandon triples altogether and start
with something else entirely. But the solution will probably be something
else in between... I'm hoping to be able to have a look at it in the near
future.

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130805/1cc3126d/attachment.html>


More information about the cfe-dev mailing list