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

4.115
Last change on this file since 8b64335 was 8b64335, checked in by Chris Johns <chrisj@…>, on 11/02/16 at 01:09:54

RSB: Finish reformatting after moving from asciidocs.

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