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