@@ -9,12 +9,22 @@ GCC ToolChain Setup
99
1010 Before compiling any of the sources referenced in this document, set the cross compiler paths to the toolchains packaged in the Processor SDK [Recommended] as shown below. Refer to :ref: `yocto-toolchain ` section for more details on usage.
1111
12- .. code-block :: console
12+ .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X', 'AM57X')
13+
14+ .. code-block :: console
15+
16+ host# export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-"
17+ host# export SYSROOT_32="${SDK_INSTALL_DIR}/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi"
18+ host# export CC_32="${CROSS_COMPILE_32}gcc --sysroot=${SYSROOT_32}"
19+
20+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X', 'AM57X')
1321
14- host# export CROSS_COMPILE_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-"
15- host# export SYSROOT_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/aarch64-oe-linux"
16- host# export CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
17- host# export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-"
22+ .. code-block :: console
23+
24+ host# export CROSS_COMPILE_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-"
25+ host# export SYSROOT_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/aarch64-oe-linux"
26+ host# export CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
27+ host# export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-"
1828
1929 If the Processor SDK is not installed, the Arm GNU toolchains can be downloaded and setup. Refer to :ref: `external-arm-toolchain ` section for more details on usage.
2030
@@ -46,22 +56,43 @@ The |__SDK_FULL_NAME__| package comes with this toolchain preinstalled at linux-
4656directory within the SDK. Below paths are relative to the <SDK_INSTALL_DIR> and will be
4757referred to using the first column in the following sections.
4858
49- .. list-table :: Linux Devkit Contents
50- :widths: 20 30 50
51- :header-rows: 1
52-
53- * - Variable
54- - Location
55- - Description
56- * - CROSS_COMPILE_64
57- - linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-
58- - Cross compiler toolchain for the ARMv8 architecture
59- * - SYSROOT_64
60- - linux-devkit/sysroots/aarch64-oe-linux/
61- - Sysroot with the cross compiled libraries and headers for the ARMv8 architecture with Linux OS
62- * - ENV_SETUP_64
63- - linux-devkit/environment-setup-aarch64-oe-linux
64- - Shell script that sets environment variables to compile binaries for the ARMv8 linux target
59+ .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X', 'AM57X')
60+
61+ .. list-table :: Linux Devkit Contents
62+ :widths: 20 30 50
63+ :header-rows: 1
64+
65+ * - Variable
66+ - Location
67+ - Description
68+ * - CROSS_COMPILE_32
69+ - linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-
70+ - Cross compiler toolchain for the ARMv8 architecture
71+ * - SYSROOT_32
72+ - linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/
73+ - Sysroot with the cross compiled libraries and headers for the ARMv8 architecture with Linux OS
74+ * - ENV_SETUP_32
75+ - linux-devkit/environment-setup-armv7at2hf-neon-oe-linux-gnueabi
76+ - Shell script that sets environment variables to compile binaries for the ARMv8 linux target
77+
78+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X', 'AM57X')
79+
80+ .. list-table :: Linux Devkit Contents
81+ :widths: 20 30 50
82+ :header-rows: 1
83+
84+ * - Variable
85+ - Location
86+ - Description
87+ * - CROSS_COMPILE_64
88+ - linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-
89+ - Cross compiler toolchain for the ARMv8 architecture
90+ * - SYSROOT_64
91+ - linux-devkit/sysroots/aarch64-oe-linux/
92+ - Sysroot with the cross compiled libraries and headers for the ARMv8 architecture with Linux OS
93+ * - ENV_SETUP_64
94+ - linux-devkit/environment-setup-aarch64-oe-linux
95+ - Shell script that sets environment variables to compile binaries for the ARMv8 linux target
6596
6697.. rubric :: Target Sysroot
6798 :name: cross-compiled-libraries
@@ -79,9 +110,17 @@ also find the header files corresponding to these libraries in the
79110an example if your application wants access to the alsa asound library
80111then you can now do the following command:
81112
82- .. code-block :: console
113+ .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X', 'AM57X')
114+
115+ .. code-block :: console
83116
84- host# ${CROSS_COMPILE_64}gcc -lasound app.c -o app.out
117+ host# ${CROSS_COMPILE_32}gcc -lasound app.c -o app.out
118+
119+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X', 'AM57X')
120+
121+ .. code-block :: console
122+
123+ host# ${CROSS_COMPILE_64}gcc -lasound app.c -o app.out
85124
86125 .. rubric :: Environment-setup script
87126 :name: environment-setup-script
@@ -101,9 +140,17 @@ for you. This script exports variables to perform actions such as:
101140To **use ** the environment-setup script you only need to source it. This
102141is as simple as:
103142
104- .. code-block :: console
143+ .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X', 'AM57X')
105144
106- host# source ${ENV_SETUP_64}
145+ .. code-block :: console
146+
147+ host# source ${ENV_SETUP_32}
148+
149+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X', 'AM57X')
150+
151+ .. code-block :: console
152+
153+ host# source ${ENV_SETUP_64}
107154
108155 .. note ::
109156 :name: when-compiling-the-linux-kernel
@@ -133,7 +180,7 @@ libraries.
133180 .. code-block :: c
134181
135182 #include <stdio.h>
136-
183+
137184 int main() {
138185 printf ("Hello World from TI!!!\n");
139186 return 0;
@@ -145,20 +192,37 @@ libraries.
145192 - **Compile Directly ** : Cross-compile the **helloworld.c ** file using the
146193 cross-compile toolchain directly
147194
148- .. code-block :: console
195+ .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X', 'AM57X')
196+
197+ .. code-block :: console
198+
199+ host# ${CROSS_COMPILE_32}gcc --sysroot=${SYSROOT_32} helloworld.c -o helloworld
149200
150- host# ${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64} helloworld.c -o helloworld
201+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X', 'AM57X')
202+
203+ .. code-block :: console
204+
205+ host# ${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64} helloworld.c -o helloworld
151206
152207 Be sure to give the correct path to the gcc cross compiler and target
153208 sysroot as listed earlier.
154209
155210 - **Using the environement setup script ** : Cross-compile after sourcing
156211 the setup script
157212
158- .. code-block :: console
213+ .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X', 'AM57X')
214+
215+ .. code-block :: console
216+
217+ host# source ${ENV_SETUP_32}
218+ host# ${CC_32} helloworld.c -o helloworld
159219
160- host# source ${ENV_SETUP_64}
161- host# ${CC} helloworld.c -o helloworld
220+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X', 'AM57X')
221+
222+ .. code-block :: console
223+
224+ host# source ${ENV_SETUP_64}
225+ host# ${CC} helloworld.c -o helloworld
162226
163227 3. After the above steps are run you should now have a **helloworld **
164228 executable in your directory that has been compiled for the ARM. A
@@ -178,29 +242,35 @@ libraries.
178242k3r5-devkit
179243^^^^^^^^^^^
180244
181- .. rubric :: Overview
245+ .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X', 'AM57X')
182246
183- The |__SDK_FULL_NAME__ | package comes with an ARMv7 toolchain preinstalled at k3r5-devkit/
184- directory within the SDK. Below paths are relative to the <SDK_INSTALL_DIR>.
185-
186- .. list-table :: k3r5 Devkit Contents
187- :widths: 20 30 50
188- :header-rows: 1
189-
190- * - Variable
191- - Location
192- - Description
193- * - CROSS_COMPILE_32
194- - k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-
195- - Cross compiler toolchain for the ARMv7 architecture
196- * - SYSROOT_32
197- - k3r5-devkit/sysroots/armv7at2hf-vfp-oe-eabi/
198- - Sysroot with the cross compiled libraries and headers for the ARMv7 architecture
199- * - ENV_SETUP_32
200- - k3r5-devkit/environment-setup-armv7at2hf-vfp-oe-eabi
201- - Shell script that sets environment variables to compile binaries for the target
247+ .. attention ::
202248
203- |
249+ The Processor SDK LINUX package for AM335x, AM437x and AM57X devices does not support k3r5-devkit toolchain.
250+
251+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X', 'AM57X')
252+
253+ .. rubric :: Overview
254+
255+ The |__SDK_FULL_NAME__ | package comes with an ARMv7 toolchain preinstalled at k3r5-devkit/
256+ directory within the SDK. Below paths are relative to the <SDK_INSTALL_DIR>.
257+
258+ .. list-table :: k3r5 Devkit Contents
259+ :widths: 20 30 50
260+ :header-rows: 1
261+
262+ * - Variable
263+ - Location
264+ - Description
265+ * - CROSS_COMPILE_32
266+ - k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-
267+ - Cross compiler toolchain for the ARMv7 architecture
268+ * - SYSROOT_32
269+ - k3r5-devkit/sysroots/armv7at2hf-vfp-oe-eabi/
270+ - Sysroot with the cross compiled libraries and headers for the ARMv7 architecture
271+ * - ENV_SETUP_32
272+ - k3r5-devkit/environment-setup-armv7at2hf-vfp-oe-eabi
273+ - Shell script that sets environment variables to compile binaries for the target
204274
205275
206276.. _external-arm-toolchain :
0 commit comments