Generating a Clang cross-compiler
Clang dynamically supports the generation of code for any target, as seen in the previous sections. However, there are reasons to generate a target-dedicated Clang cross-compiler:
- If the user wishes to avoid using long command lines to invoke the driver
- If a manufacturer wishes to ship a platform-specific Clang-based toolchain to its clients
Configuration options
The LLVM configure system has the following options that assist in cross-compiler generation:
--target
: This option specifies the default target triple that the Clang cross-compiler generates code for. This relates to the target, host, and build concepts we defined earlier. The--host
and--build
options are also available, but these are guessed by the configure ...
Get Getting Started with LLVM Core Libraries now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.