What the Hell Is a Target Triple?
Published on: 2025-04-27 10:35:05
Cross-compiling is taking a computer program and compiling it for a machine that isn’t the one hosting the compilation. Although historically compilers would only compile for the host machine, this is considered an anachronism: all serious native compilers are now cross-compilers.
After all, you don’t want to be building your iPhone app on literal iPhone hardware.
Many different compilers have different mechanisms for classifying and identifying targets. A target is a platform that the compiler can produce executable code for. However, due to the runaway popularity of LLVM, virtually all compilers now use target triples. You may have already encountered one, such as the venerable x86_64-unknown-linux , or the evil x86_64-pc-windows . This system is convoluted and almost self-consistent.
But what is a target triple, and where did they come from?
So if you go poking around the Target Triplet page on OSDev, you will learn both true and false things about target triples, because this p
... Read full article.