• Home
  • Raw
  • Download

Lines Matching +full:cross +full:- +full:compile

2 Cross-compilation using Clang
9 for cross-compiling your code to a different architecture. It assumes you
10 already know how to compile the code in question for the host architecture,
17 `instructions for cross-compiling LLVM itself
21 related to cross-compilation, and what main compiler options Clang provides
22 for performing cross-compilation.
24 Cross compilation issues
33 On the other hand, Clang/LLVM is natively a cross-compiler, meaning that
34 one set of programs can compile to all targets by setting the ``-target``
35 option. That makes it a lot easier for programmers wishing to compile to
40 But, as is true to any cross-compiler, and given the complexity of
47 ``compiler-rt``, ``libcxx``, ``libgcc``, ``libm``, etc), so you'll have to
53 option will work magically. Some options, like ``--sysroot`` (which
56 true when your cross-compiler was installed by the distribution's package
58 option, and in most cases, you'll end up setting include paths (``-I``) and
59 library paths (``-L``) manually.
68 General Cross-Compilation Options in Clang
72 -------------
75 ``-target <triple>``. If you don't specify the target, CPU names won't
80 The triple has the general format ``<arch><sub>-<vendor>-<sys>-<abi>``, where:
87 The sub-architecture options are available for their own architectures,
93 like the bare-metal "none".
105 -------------
112 * ``-mcpu=<cpu-name>``, like x86-64, swift, cortex-a15
113 * ``-mfpu=<fpu-name>``, like SSE3, NEON, controlling the FP unit available
114 * ``-mfloat-abi=<fabi>``, like soft, hard, controlling which registers
115 to use for floating-point
122 For example, if your target is ``arm-none-eabi``, the default CPU will
124 whereas if your triple is ``armv7a-none-eabi``, it'll be Cortex-A8 with
125 NEON, but still using soft-float, which is much better, but still not
129 -----------------
131 There are three main options to control access to your cross-compiler:
132 ``--sysroot``, ``-I``, and ``-L``. The two last ones are well known,
136 There are two main ways to have a cross-compiler:
138 #. When you have extracted your cross-compiler from a zip file into
139 a directory, you have to use ``--sysroot=<path>``. The path is the
148 distributions have cross-compiler packages available), make
150 cross-compiler toolchain.
154 are. People add system-specific clues to Clang often, but as
159 directories manually (via ``-I`` and ``-L``).
161 Target-Specific Libraries
164 All libraries that you compile as part of your build will be
165 cross-compiled to your target, and your build system will probably
170 So, if the build system is not aware that you want to cross-compile
175 as for your host machine. There aren't many cross-libraries available
176 as packages to most OS's, so you'll have to either cross-compile them
179 and add ``-I`` and ``-L`` pointing to them.
189 ---------
191 When you want to cross-compile to more than one configuration, for
192 example hard-float-ARM and soft-float-ARM, you'll have to have multiple
197 forget to specify ``-ccc-gcc-name armv7l-linux-gnueabihf-gcc`` (which
198 uses hard-float), Clang will pick the ``armv7l-linux-gnueabi-ld``
199 (which uses soft-float) and linker errors will happen.
202 and ``androideabi``, and might even link and run, but produce run-time