summaryrefslogtreecommitdiffstats
path: root/documentation/book-enea-linux-users-guide/doc/install_toolchain.xml
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/book-enea-linux-users-guide/doc/install_toolchain.xml')
-rw-r--r--documentation/book-enea-linux-users-guide/doc/install_toolchain.xml149
1 files changed, 149 insertions, 0 deletions
diff --git a/documentation/book-enea-linux-users-guide/doc/install_toolchain.xml b/documentation/book-enea-linux-users-guide/doc/install_toolchain.xml
new file mode 100644
index 0000000..d5f7254
--- /dev/null
+++ b/documentation/book-enea-linux-users-guide/doc/install_toolchain.xml
@@ -0,0 +1,149 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4<section id="enea-linux-install-cc-toolchain">
5 <title>Install the Cross-Compilation Toolchain</title>
6
7 <para>Before cross-compiling<indexterm>
8 <primary>cross-compiling</primary>
9 </indexterm> applications for your target, you need to install the
10 Software Development Kit (SDK<indexterm>
11 <primary>SDK</primary>
12 </indexterm>) - which contains the cross-compilation toolchain<indexterm>
13 <primary>toolchain</primary>
14 </indexterm> - and set up the cross-compilation environment on your host.
15 The toolchain for each supported target contains a 32-bit and a 64-bit
16 library for gcc. The toolchain and the environment-setup script are wrapped
17 together inside a toolchain installer in the form of a shell script.</para>
18
19 <simplelist>
20 <member>Name of the installer:</member>
21
22 <member><literal><xi:include href="../../docsrc_common/pardoc-distro.xml"
23 xmlns:xi="http://www.w3.org/2001/XInclude"
24 xpointer="element(EneaLinux_SDK_INSTALLER/1)" /></literal></member>
25 </simplelist>
26
27 <simplelist>
28 <member>Name of the environment-setup scripts:</member>
29
30 <member><literal><xi:include href="../../docsrc_common/pardoc-distro.xml"
31 xmlns:xi="http://www.w3.org/2001/XInclude"
32 xpointer="element(EneaLinux_SDK_ENV_SCRIPT_32/1)" /></literal></member>
33
34 <member><literal><xi:include href="../../docsrc_common/pardoc-distro.xml"
35 xmlns:xi="http://www.w3.org/2001/XInclude"
36 xpointer="element(EneaLinux_SDK_ENV_SCRIPT_64/1)" /></literal></member>
37 </simplelist>
38
39 <para>The cross-compilation toolchain for <literal>t4240rdb-64b</literal> is
40 packaged as follows:<itemizedlist spacing="compact">
41 <listitem>
42 <para>The toolchain contains two libs: <literal>lib</literal> (32-bit)
43 and <literal>lib64</literal> (64-bit).</para>
44 </listitem>
45
46 <listitem>
47 <para>The installer wraps two environment-setup scripts. Which script
48 you run selects which lib will be used by gcc. This way, both 32-bit
49 applications and 64-bit applications can be cross-compiled for
50 t4240rdb-64b.</para>
51
52 <note>
53 <para>There are currently problems with 32-bit applications on the
54 64-bit T4240, see "Known Problems" in the Release
55 Information.</para>
56 </note>
57 </listitem>
58 </itemizedlist>Do as in the example below to install the SDK and set up
59 the cross-compilation environment:</para>
60
61 <orderedlist>
62 <listitem>
63 <para>Get the cross-compilation toolchain installer; either a
64 precompiled one (A) or build it yourself (B).</para>
65
66 <orderedlist numeration="upperalpha">
67 <listitem>
68 <para>The quickest alternative is to use a precompiled installer for
69 your host and target. Download the appropriate installer from the
70 server appointed to you by Enea. You find the installer in the
71 <filename>sdk</filename> directory on the download site:</para>
72
73 <para><programlisting>$ wget <xi:include
74 href="../../docsrc_common/pardoc-distro.xml"
75 xmlns:xi="http://www.w3.org/2001/XInclude"
76 xpointer="element(ULINK_ENEA_LINUX_URL/1)" />/t4240-64b/sdk/\
77<xi:include href="../../docsrc_common/pardoc-distro.xml"
78 xmlns:xi="http://www.w3.org/2001/XInclude"
79 xpointer="element(EneaLinux_SDK_INSTALLER/1)" /></programlisting></para>
80 </listitem>
81
82 <listitem>
83 <para>... or build your own cross-compilation toolchain. First
84 source the build environment setup script to create a
85 &lt;build_dir&gt; with conf files, then run bitbake with option
86 <literal>-c populate_sdk</literal> to build the toolchain and wrap
87 it inside an installer, saved in
88 <filename>&lt;build_dir&gt;/tmp/deploy/sdk/</filename>.</para>
89
90 <programlisting>$ source enea-init-build-env -b build_t4240rdb
91$ bitbake <xi:include href="../../docsrc_common/pardoc-distro.xml"
92 xmlns:xi="http://www.w3.org/2001/XInclude"
93 xpointer="element(EneaLinux_SDK_IMAGE/1)" /> -c populate_sdk
94$ cd ../build_t4240rdb/tmp/deploy/sdk/</programlisting>
95 </listitem>
96 </orderedlist>
97 </listitem>
98
99 <listitem>
100 <para>Run the installer to unpack the cross-compilation toolchain and
101 the environment-setup script:</para>
102
103 <programlisting>$ chmod 770 \
104 <xi:include href="../../docsrc_common/pardoc-distro.xml"
105 xmlns:xi="http://www.w3.org/2001/XInclude"
106 xpointer="element(EneaLinux_SDK_INSTALLER/1)" />
107$ ./<xi:include href="../../docsrc_common/pardoc-distro.xml"
108 xmlns:xi="http://www.w3.org/2001/XInclude"
109 xpointer="element(EneaLinux_SDK_INSTALLER/1)" /></programlisting>
110
111 <para>When prompted, select to install the SDK in the desired directory,
112 referred to as <literal>&lt;sdkdir&gt;</literal>, by default
113 <filename>/opt/enea/&lt;sdkver&gt;</filename>. The installer unpacks the
114 environment setup script in <filename>&lt;sdkdir&gt;</filename> and the
115 toolchain under <filename>&lt;sdkdir&gt;/sysroots</filename>.</para>
116
117 <note>
118 <para>Choose a unique directory for each toolchain. Installing a
119 second toolchain of any type (buildtools toolchain or
120 cross-compilation toolchain) in the same directory as a previously
121 installed one will break the $PATH variable of the first one.</para>
122 </note>
123 </listitem>
124
125 <listitem>
126 <para>Setup the toolchain environment by sourcing the environment-setup
127 script, here exemplified for 32-bit toolchain:<programlisting>$ source &lt;sdkdir&gt;/<xi:include
128 href="../../docsrc_common/pardoc-distro.xml"
129 xmlns:xi="http://www.w3.org/2001/XInclude"
130 xpointer="element(EneaLinux_SDK_ENV_SCRIPT_64/1)" /></programlisting></para>
131 </listitem>
132 </orderedlist>
133
134 <para>Once the cross-compilation toolchain is in place and the environment
135 set up, you can proceed with <link
136 linkend="enea-linux-cross-compile-from-command-line">Cross-Compiling
137 Applications from Command Line.</link>.</para>
138
139 <para>The above instructions and the files on the download site should
140 provide you with all you need to be able to cross-compile applications for
141 your target.</para>
142
143 <remark>INFO: Corresponding Yocto documentation is available at <xi:include
144 href="../../docsrc_common/pardoc-distro.xml"
145 xmlns:xi="http://www.w3.org/2001/XInclude"
146 xpointer="element(ULINK_YOCTO_ADT_TOOLCHAIN_URL/1)" />. Note that the file
147 names mentioned in the Yocto documentation differ from the ones in the Enea
148 Linux distribution.</remark>
149</section> \ No newline at end of file