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

5
Last change on this file since d5b631f was d5b631f, checked in by Chris Johns <chrisj@…>, on 02/27/19 at 21:36:39

User: Change output block to type none.

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