This is an archive of the discontinued LLVM Phabricator instance.

[Triple] Support parsing Gentoo ARM triples, with hardfloat in vendor
AbandonedPublic

Authored by mgorny on Dec 2 2016, 12:05 PM.

Details

Summary

Support parsing the Gentoo triples of the from arm*-hardfloat-*-*eabi
where the vendor field is used to indicate hardfloat ABI. The triples
are mapped to a correct *-*eabihf variants.

Diff Detail

Event Timeline

mgorny updated this revision to Diff 80116.Dec 2 2016, 12:05 PM
mgorny retitled this revision from to [Triple] Support parsing Gentoo ARM triples, with hardfloat in vendor .
mgorny updated this object.
mgorny added subscribers: llvm-commits, zlei.

Adding Saleem, so he can have a fit about "hardfloat" being a "vendor". :)

mgorny added a comment.Dec 2 2016, 1:12 PM

Just in case, I'm not particularly attached to it. Just walking in the dark trying to figure out some clean way forward.

Neither do I support those crazy ideas some Gentoo developers had in the past but I doubt there is a clean way of changing that without throwing interim breakage on people.

Just in case, I'm not particularly attached to it. Just walking in the dark trying to figure out some clean way forward.

Neither do I support those crazy ideas some Gentoo developers had in the past but I doubt there is a clean way of changing that without throwing interim breakage on people.

Been there...

So, this one is complicated. IIRC, there are other cases where the environment swaps with vendor, and there's some normalisation that happens because of that. I can't remember exactly which one, but there's probably a comment on that file explaining the madness.

If we could make that an environment and swap like it's done, it would be much better. But I don't know if we can then normalise to, say, "arm-linux-hardfloat-gnueabi", which can cause problems, for example, when searching for the linker.

Saleem has a lot more experience with crazy triples than I have, so I'll leave him have a more informed opinion.

cheers,
--renato

compnerd edited edge metadata.Dec 2 2016, 8:43 PM

As it is, arm-unknown-linux-gnueabi -mfloat-abi=hard and arm-unknown-linux-gnueabihf have differences. We need to identify the calling convention in the backend when generating calls to builtins. Adding yet another mechanism really complicates the situation.

If really your issue is backwards compatibility ... provide a wrapper that canonicalizes the triple. Its not particularly pretty, but it would allow you to prevent the intermittent break.

include/llvm/ADT/Triple.h
145

Why do these need to be vendors? There already are two different ways to specify the hard float and soft float conventions. Please don't introduce a third.

lib/Support/Triple.cpp
513

What happens if someone wants to vend a Gentoo based OS with hard float?

arm-gentoo_is_broken-hardfloat-linux-gnueabi

Ive complained to steev about this in the past.

mgorny added a comment.Dec 3 2016, 1:09 AM

Please don't shoot the messenger. I don't have much influence on ARM in Gentoo, and I'm just trying to get clang finally working for our users. Besides, I'm pretty sure changing CHOST would cause intermittent breakage for our users until they rebuild at least gcc, and a number of other random packages. This is not something that can happen overnight, or that we can expect to be a good idea.

I don't see how a wrapper could help us. If it overrides the triple, clang won't be able to find the relevant gcc install because of triple mismatch…

mgorny abandoned this revision.Dec 12 2016, 7:33 AM

As noted on D25686 I'm giving up.