ターゲットトリプルとは?
target triple は、build が出力を生成するプラットフォームを記述する標準化された識別子で、慣例的に architecture-vendor-operating-system と書かれ、多くの場合 x86_64-unknown-linux-gnu や aarch64-apple-darwin のように ABI サフィックスが付きます。コンパイラや build システムはこれを使って正しいコード生成とライブラリを選択します。名前に反して、しばしば 4 つの要素を持ちます。
なぜ重要か
cross-compiling やバイナリの配布を行う際、target triple は artifact がどのプラットフォーム向けかを正確に示す方法です。これを正しく指定することで、ツールチェーンが正しいライブラリと ABI をリンクし、バイナリが意図した target で実際に動作することが保証されます。
関連する概念
- 形式: arch-vendor-os、多くの場合 ABI サフィックス付き
- コード生成と target のライブラリを選択する
- cross-compilation の構成の中心
関連ガイド
What Is Cross-Compilation?Cross-compilation builds executables for a different platform than the one doing the build, such as compiling…
What Is a Toolchain?A toolchain is the coordinated set of tools used to build software, such as the compiler, linker, and build s…
What Is Static Linking?Static linking bundles a program's library dependencies directly into the executable at build time, producing…