source: rtems-docs/rsb/cross-canadian-cross.rst @ e52906b

5
Last change on this file since e52906b was e52906b, checked in by Sebastian Huber <sebastian.huber@…>, on 01/09/19 at 15:14:06

Simplify SPDX-License-Identifier comment

  • Property mode set to 100644
File size: 3.7 KB
RevLine 
[e52906b]1.. SPDX-License-Identifier: CC-BY-SA-4.0
[8b64335]2
[4886d60]3.. Copyright (C) 2012, 2016 Chris Johns <chrisj@rtems.org>
[8b64335]4
5Cross and Canadian Cross Building
[9742e45]6=================================
[8b64335]7
8Cross building and Canadian Cross building is the process of building on one
9machine an executable that runs on another machine. An example is building a
10set of RTEMS tools on Linux to run on Windows. The RSB supports cross building
11and Canadian cross building.
12
13This sections details how to the RSB to cross and Canadian cross build.
14
15Cross Building
[9742e45]16--------------
[8b64335]17
18Cross building is where the _build_ machine and _host_ are different. The
19_build_ machine runs the RSB and the _host_ machine is where the output from
20the build runs. An example is building a package such as NTP for RTEMS on your
21development machine.
22
23To build the NTP package for RTEMS you enter the RSB command::
24
25    $ ../source-builder/sb-set-builder \
26       --log=log_ntp_arm.txt \
27       --prefix=$HOME/development/rtems/4.11 \  <1>
28       --host=arm-rtems4.11 \  <2>
29       --with-rtems-bsp=xilinx_zynq_zc706 \  <3>
30       4.11/net/ntp
31
32.. topic:: Items:
33
34  1. The tools and the RTEMS BSP are installed under the same prefix.
35
36  2. The ``--host`` command is the RTEMS architecture and version.
37
38  3. The BSP is built and installed in the prefix. The arhcitecture must match
39     the ``--host`` architecture.
40
41.. note: Installing Into Different Directories
42
43  If you install BSPs into a different path to the prefix use the
44  ``--with-tools`` option to specify the path to the tools. Do not add the
45  'bin' directory at the end of the path.
46
47Canadian Cross Building
[9742e45]48-----------------------
[8b64335]49
50A Canadian cross builds are where the **build**, **host** and **target**
51machines all differ. For example building an RTEMS compiler for an ARM
52processor that runs on Windows is built using a Linux machine. The process is
53controlled by setting the build triplet to the host you are building, the host
54triplet to the host the tools will run on and the target to the RTEMS
55architecture you require. The tools needed by the RSB are:
56
57- Build host C and C++ compiler
58
59- Host C and C++ cross compiler
60
61The RTEMS Source Builder requires you provide the build host C and C++ compiler
62and the final host C and C++ cross-compiler. The RSB will build the build host
63RTEMS compiler and the final host RTEMS C and C++ compiler, the output of this
64process.
65
66The Host C and C++ compiler is a cross-compiler that builds executables for the
67host you want the tools for. You need to provide these tools. For Windows a
68number of Unix operating systems provide MinGW tool sets as packages.
69
70The RSB will build an RTEMS tool set for the build host. This is needed when
71building the final host's RTEMS compiler as it needs to build RTEMS runtime
72code such as *libc* on the build host.
73
74TIP: Make sure the host's cross-compiler tools are in your path before run the
75RSB build command.
76
77TIP: Canadian Cross built tools will not run on the machine being used to build
78them so you should provide the ``--bset-tar-files`` and ``--no-install``
79options. The option to not install the files lets you provide a prefix that
80does not exist or you cannot access.
81
82To perform a cross build add ``--host=`` to the command line. For example
83to build a MinGW tool set on FreeBSD for Windows add ``--host=mingw32``
84if the cross compiler is ``mingw32-gcc``::
85
86    $ ../source-builder/sb-set-builder --host=mingw32 \
87       --log=l-mingw32-4.11-sparc.txt \
88       --prefix=$HOME/development/rtems/4.11 \
89       4.11/rtems-sparc
90
91If you are on a Linux Fedora build host with the MinGW packages installed the
92command line is::
93
94    $ ../source-builder/sb-set-builder --host=i686-w64-mingw32 \
95       --log=l-mingw32-4.11-sparc.txt \
96       --prefix=$HOME/development/rtems/4.11 \
97       4.11/rtems-sparc
Note: See TracBrowser for help on using the repository browser.