Live data from Hacker News

What the hell is a target triple?

mcyoung.xyz

11–20 of 139 posts

Re: What the hell is a target triple?

#13
post #6
post #2

Note to author, I'm not sure the word "anachronism" is being used correctly in the intro.

I think the meaning is that the idea that compilers can only compile for their host machine is an ananchronism, since that was historically the case but is no longer true.

Telling people that "Clang can compile for any architecture you like!" tends to confuse them more than it helps. I suppose it sets up unrealistic assumptions because of course outputting assembly for some architecture is a very long way from making working userland binaries for a system based on that architecture, which is what people actually want.

And ironically in all of this, building a full toolchain based on GCC is still easier than with LLVM.

Re: What the hell is a target triple?

#15
Noticed endians listed in the table. It seems like little-endian has basically taken over the world in 2025:

* https://en.wikipedia.org/wiki/Endianness#Hardware

Is there anything that is used a lot that is not little? IBM's stuff?

Network byte order is BE:

* https://en.wikipedia.org/wiki/Endianness#Networking

Re: What the hell is a target triple?

#16
Sounds like what we use with vcpkg to define the systems tooling; still trying to make sense of it all these years later, but we define things like x64-Linux-static to imply target architecture platform and linkage style to runtime.

Re: What the hell is a target triple?

#17
post #12

> Kalimba, VE > No idea what this is, and Google won’t help me. Seems that Kalimba is a DSP, originally by CSR and now by Qualcomm. CSR8640 is using it, for example https://www.qualcomm.com/products/internet-of-things/consume... VE is harder to find with such short name.

NEC Vector Engine. Basically not a thing outside supercomputers.

Re: What the hell is a target triple?

#19

Noticed endians listed in the table. It seems like little-endian has basically taken over the world in 2025: * https://en.wikipedia.org/wiki/Endianness#Hardware Is there anything that is used a lot that is not little? IBM's stuff? Network byte order is BE: * https://en.wikipedia.org/wiki/Endianness#Networking

Java VM is BE.

Re: What the hell is a target triple?

#20
What a great article.

Everytime I deal with target triples I get confused and have to refresh my memory. This article makes me feel better in knowing that target triples are an unmitigated cluster fuck of cruft and bad design.

> Go does the correct thing and distributes a cross compiler.

Yes but also no. AFAIK Zig is the only toolchain to provide native cross compiling out of the box without bullshit.

Missing from this discussion is the ability to specify and target different versions of glibc. Something that I think only Zig even attempts to do because Linux’s philosophy of building against local system globals is an incomprehensibly bad choice. So all these target triples are woefully underspecified.

I like that at least Rust defines its own clear list of target triples that are more rational than LLVM’s. At this point I feel like the whole concept of a target triples needs to be thrown away. Everything about it is bad.

Post reply on HN