[llvm-commits] [llvm] r123990 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp unittests/ADT/TripleTest.cpp

Eric Christopher echristo at apple.com
Mon Jan 24 14:04:44 PST 2011


On Jan 24, 2011, at 1:42 PM, Renato Golin wrote:

> Hum, ok, I'm confused. Does this mean that "eabi" is bare-metal eabi,
> "linuxeabi" is Linux eabi and "gnueabi" is what?
> 
> If that's the case, than "eabi" is in fact telling the OS by saying
> there is NO OS, but that's misleading…


Welcome to target triples. :)

From what I recall (grain of salt here): eabi is not much different different than saying "elf" in this case. So arm-eabi is just like saying arm-elf and targets bare metal. arm-linuxeabi is an arm-linux-elf or arm-linux-eabi machine. arm-symbianeabi would be targeting the Symbian os.

Also note that in some cases they're not triples, they're quartets like "arm*-*-linux-*eabi" which parse down into triples since the vendor doesn't really matter here. (We'll also avoid mentioning arm-linux-gnu which is at some point the quartet of arm-*-linux-gnu, but is also just a triple). That said, I believe the abi for arm-linux-gnueabi vs arm-linux-gnu is different in that it adds the BPABI for 128-bit long long. I haven't looked at the different arm configurations in some time :)

This is what Duncan was talking about when he was mentioning the few hundred lines of config.sub - there's also huge amounts of matching in gcc in the config.gcc file that bases a lot of configuration on the parsing of the target triple.

> Anyway, I'm not trying to re-write target triple, just understanding it
> enough to parse it correctly in LLVM.

You may not get to do this without rewriting it into a more canonical form in the general case.

FWIW my idea of how cross compilation should work is mostly the way that llc deals with cross targets - via the -mtriple flag. That is parsed by the front end to the particular information on OS and architecture (you can also make -arch work my just substituting the architecture in front of the current host triple) and then the module will have the triple you've just passed. It's pretty simple, but may require a bit of rework. I haven't looked at it in a while.

-eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110124/cf1e465d/attachment.html>


More information about the llvm-commits mailing list