Triple ADT sometimes extracts wrong vendor and os
| Bugzilla Link | 6688 |
| Resolution | FIXED |
| Resolved on | Oct 15, 2015 23:00 |
| Version | trunk |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @asl,@echristo |
Extended Description
Here are some example triples printed by various gcc versions on my linux machine:
- System gcc: x86_64-linux-gnu
- 32 bit system gcc: i486-linux-gnu
- ACT supplied gcc: x86_64-pc-linux-gnu
- 32 bit ACT supplied gcc: i686-pc-linux-gnu
- self-built gcc-4.5: x86_64-unknown-linux-gnu
- 32 bit self-built gcc-4.5: i686-pc-linux-gnu
If the Triple class is instantiated with 1) or 2) then getVendor and getOS return their 'unknown' value.
If you look at TripleTest.cpp:310 we'll handle these now, so going to call it fixed.
I think that triple is doing the right thing here. The frontend should canonicalize the triple even if the user doesn't.
Probably the conclusion is that Triple shouldn't parse based on a fixed component position (eg: arch-vendor-os), but instead should examine components and try to recognize each one, asking for each one if it makes sense as an arch value, or an os value, or a vendor value etc. That way it could happily parse gnu-linux-x86_64!
If the Triple class is instantiated with 1) or 2) then getVendor and getOS return their 'unknown' value. Same problem was for i386-mingw32 iirc