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

5
Last change on this file since c576e9b was bb47f89, checked in by Chris Johns <chrisj@…>, on 10/13/19 at 08:51:25

user/rsb: Update 3rd party package build and add packaging details.

  • Property mode set to 100644
File size: 4.2 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 Curl for RTEMS on your
21development machine.
22
23To build the Curl package for RTEMS you enter the RSB command:
24
25.. code-block:: none
26
27    $ ../source-builder/sb-set-builder \
28       --log=log_curl_arm.txt \
29       --prefix=$HOME/development/rtems/5 \  <1>
30       --host=arm-rtems5 \  <2>
31       --with-rtems-bsp=xilinx_zynq_zc706 \  <3>
32       5/ftp/curl
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 use a prefix that is different to the path the build RTEMS BSP is
46  installed under use the ``--with-rtems`` option to specify the top level path
47  to the RTEMS BSP. Do not add an extra directories to the path,the RSB knows
48  how to search the path.
49
50  If the tools have been installed in a different location to the RTEMS BSP and
51  the prefix use the ``--with-tools`` option to specift the top level path to
52  the installed tools Again do not add an extar directory such as ``bin`` as
53  the RSB knows how to search the supplied tools path.
54
55  We recommend you install all thrid party packages using the same prefix.
56  the RTEM BSP you can use the
57
58Canadian Cross Building
59^^^^^^^^^^^^^^^^^^^^^^^
60
61A Canadian cross builds are where the **build**, **host** and **target**
62machines all differ. For example building an RTEMS compiler for an ARM
63processor that runs on Windows is built using a Linux machine. The process is
64controlled by setting the build triplet to the host you are building, the host
65triplet to the host the tools will run on and the target to the RTEMS
66architecture you require. The tools needed by the RSB are:
67
68- Build host C and C++ compiler
69
70- Host C and C++ cross compiler
71
72The RTEMS Source Builder requires you provide the build host C and C++ compiler
73and the final host C and C++ cross-compiler. The RSB will build the build host
74RTEMS compiler and the final host RTEMS C and C++ compiler, the output of this
75process.
76
77The Host C and C++ compiler is a cross-compiler that builds executables for the
78host you want the tools for. You need to provide these tools. For Windows a
79number of Unix operating systems provide MinGW tool sets as packages.
80
81The RSB will build an RTEMS tool set for the build host. This is needed when
82building the final host's RTEMS compiler as it needs to build RTEMS runtime
83code such as *libc* on the build host.
84
85TIP: Make sure the host's cross-compiler tools are in your path before run the
86RSB build command.
87
88TIP: Canadian Cross built tools will not run on the machine being used to build
89them so you should provide the ``--bset-tar-files`` and ``--no-install``
90options. The option to not install the files lets you provide a prefix that
91does not exist or you cannot access.
92
93To perform a cross build add ``--host=`` to the command line. For example
94to build a MinGW tool set on FreeBSD for Windows add ``--host=mingw32``
95if the cross compiler is ``mingw32-gcc``:
96
97.. code-block:: none
98
99    $ ../source-builder/sb-set-builder --host=mingw32 \
100       --log=l-mingw32-4.11-sparc.txt \
101       --prefix=$HOME/development/rtems/5 \
102       5/rtems-sparc
103
104If you are on a Linux Fedora build host with the MinGW packages installed the
105command line is:
106
107.. code-block:: none
108
109    $ ../source-builder/sb-set-builder --host=i686-w64-mingw32 \
110       --log=l-mingw32-4.11-sparc.txt \
111       --prefix=$HOME/development/rtems/5 \
112       5/rtems-sparc
Note: See TracBrowser for help on using the repository browser.