[llvm-dev] clang triple and clang target

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 11 18:38:52 PST 2016


On Fri, Mar 11, 2016 at 01:20:11PM -0800, Rail Shafigulin via llvm-dev wrote:
> Can someone explain what exactly a clang triple is (--triple option) and
> what is the connection between triple and a target? I know there is an
> article ( http://clang.llvm.org/docs/CrossCompilation.html) that show how
> to cross compile code, but I'm not clear about is why I need to specify
> triple, why I can't just say compile for a given target?

I assume with target you mean the backend? Consider the x86 backend. It
supports 32bit and 64bit mode, with the GNU x32 ABI in between. There
are three different executable formats support (ELF, PE, MachO) with
different constraints. Some platforms require 32bit alignment of the
stack, others require 128bit alignment. The list goes on. The triple specifies
the combination of target, OS and potentially file format and sub-ABI.

Joerg


More information about the llvm-dev mailing list