Book Image

Getting Started with LLVM Core Libraries

Book Image

Getting Started with LLVM Core Libraries

Overview of this book

Table of Contents (17 chapters)
Getting Started with LLVM Core Libraries
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 script—both refer to the native platform.

  • --enable-targets: This option specifies which targets this installation will support. If omitted, all targets will be supported. Remember that you must use the command-line options previously explained...