Skip to Main Content
Getting started with LLVM core libraries
book

Getting started with LLVM core libraries

by Bruno Lopes, Rafael Auler
August 2014
Beginner to intermediate content levelBeginner to intermediate
314 pages
7h 57m
English
Packt Publishing
Content preview from Getting started with LLVM core libraries

Cross-compiling with Clang command-line arguments

Now that you know each toolchain component, we will show you how to use Clang as a cross-compiler by using the appropriate driver arguments.

Note

All the examples in this section are tested in an x86_64 machine running Ubuntu 12.04. We use Ubuntu-specific tools to download some dependencies, but the Clang-related commands should work in any other OS environment without (or with minor) modifications.

Driver options for the target

Clang uses the –target=<triple> driver option to dynamically select the target triple for which code needs to be generated. Beyond the triple, other options can be used to make target selection more accurate:

  • The -march=<arch> option selects the target base architecture. The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries

LLVM Techniques, Tips, and Best Practices Clang and Middle-End Libraries

Min-Yih Hsu
LLVM Cookbook

LLVM Cookbook

Mayur Pandey, Suyog Sarda
LLVM Essentials

LLVM Essentials

Suyog Sarda, Mayur Pandey
CMake Cookbook

CMake Cookbook

Radovan Bast, Roberto Di Remigio

Publisher Resources

ISBN: 9781782166924Supplemental Content