@@ -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')
13+
14+ .. code-block :: console
1315
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-"
16+ host# export CROSS_COMPILE_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-"
17+ host# export SYSROOT_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi"
18+ host# export CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
19+
20+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X')
21+
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,41 @@ 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')
60+ .. list-table :: Linux Devkit Contents
61+ :widths: 20 30 50
62+ :header-rows: 1
63+
64+ * - Variable
65+ - Location
66+ - Description
67+ * - CROSS_COMPILE_64
68+ - linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-
69+ - Cross compiler toolchain for the ARMv8 architecture
70+ * - SYSROOT_64
71+ - linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi/
72+ - Sysroot with the cross compiled libraries and headers for the ARMv8 architecture with Linux OS
73+ * - ENV_SETUP_64
74+ - linux-devkit/environment-setup-armv7at2hf-neon-oe-linux-gnueabi
75+ - Shell script that sets environment variables to compile binaries for the ARMv8 linux target
76+
77+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X')
78+ .. list-table :: Linux Devkit Contents
79+ :widths: 20 30 50
80+ :header-rows: 1
81+
82+ * - Variable
83+ - Location
84+ - Description
85+ * - CROSS_COMPILE_64
86+ - linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-
87+ - Cross compiler toolchain for the ARMv8 architecture
88+ * - SYSROOT_64
89+ - linux-devkit/sysroots/aarch64-oe-linux/
90+ - Sysroot with the cross compiled libraries and headers for the ARMv8 architecture with Linux OS
91+ * - ENV_SETUP_64
92+ - linux-devkit/environment-setup-aarch64-oe-linux
93+ - Shell script that sets environment variables to compile binaries for the ARMv8 linux target
6594
6695.. rubric :: Target Sysroot
6796 :name: cross-compiled-libraries
@@ -145,40 +174,20 @@ libraries.
145174 - **Compile Directly ** : Cross-compile the **helloworld.c ** file using the
146175 cross-compile toolchain directly
147176
148- .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X')
149-
150- .. code-block :: console
151-
152- host# ${CROSS_COMPILE_64}gcc ${CFLAGS} --sysroot=${SYSROOT_64} helloworld.c -o helloworld
153-
154- Pass the CFLAGS: :file: `-march=armv7-a ` :file: `-mthumb ` :file: `-mfpu=neon ` :file: `-mfloat-abi=hard `
155- to the cross compiler to avoid the build issues.
156-
157- .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X')
177+ .. code-block :: console
158178
159- .. code-block :: console
160-
161- host# ${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64} helloworld.c -o helloworld
179+ host# ${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64} helloworld.c -o helloworld
162180
163181 Be sure to give the correct path to the gcc cross compiler and target
164182 sysroot as listed earlier.
165183
166184 - **Using the environement setup script ** : Cross-compile after sourcing
167185 the setup script
168186
169- .. ifconfig :: CONFIG_part_variant in ('AM335X', 'AM437X')
170-
171- .. code-block :: console
172-
173- host# source ${ENV_SETUP_64}
174- host# ${CC} ${CFLAGS} helloworld.c -o helloworld
175-
176- .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X')
177-
178- .. code-block :: console
187+ .. code-block :: console
179188
180- host# source ${ENV_SETUP_64}
181- host# ${CC} helloworld.c -o helloworld
189+ host# source ${ENV_SETUP_64}
190+ host# ${CC} helloworld.c -o helloworld
182191
183192 3. After the above steps are run you should now have a **helloworld **
184193 executable in your directory that has been compiled for the ARM. A
@@ -195,32 +204,34 @@ libraries.
195204
196205.. _k3r5-devkit :
197206
198- k3r5-devkit
199- ^^^^^^^^^^^
207+ .. ifconfig :: CONFIG_part_variant not in ('AM335X', 'AM437X')
200208
201- .. rubric :: Overview
209+ k3r5-devkit
210+ ^^^^^^^^^^^
202211
203- The |__SDK_FULL_NAME__ | package comes with an ARMv7 toolchain preinstalled at k3r5-devkit/
204- directory within the SDK. Below paths are relative to the <SDK_INSTALL_DIR>.
205-
206- .. list-table :: k3r5 Devkit Contents
207- :widths: 20 30 50
208- :header-rows: 1
209-
210- * - Variable
211- - Location
212- - Description
213- * - CROSS_COMPILE_32
214- - k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-
215- - Cross compiler toolchain for the ARMv7 architecture
216- * - SYSROOT_32
217- - k3r5-devkit/sysroots/armv7at2hf-vfp-oe-eabi/
218- - Sysroot with the cross compiled libraries and headers for the ARMv7 architecture
219- * - ENV_SETUP_32
220- - k3r5-devkit/environment-setup-armv7at2hf-vfp-oe-eabi
221- - Shell script that sets environment variables to compile binaries for the target
212+ .. rubric :: Overview
222213
223- |
214+ The |__SDK_FULL_NAME__ | package comes with an ARMv7 toolchain preinstalled at k3r5-devkit/
215+ directory within the SDK. Below paths are relative to the <SDK_INSTALL_DIR>.
216+
217+ .. list-table :: k3r5 Devkit Contents
218+ :widths: 20 30 50
219+ :header-rows: 1
220+
221+ * - Variable
222+ - Location
223+ - Description
224+ * - CROSS_COMPILE_32
225+ - k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-
226+ - Cross compiler toolchain for the ARMv7 architecture
227+ * - SYSROOT_32
228+ - k3r5-devkit/sysroots/armv7at2hf-vfp-oe-eabi/
229+ - Sysroot with the cross compiled libraries and headers for the ARMv7 architecture
230+ * - ENV_SETUP_32
231+ - k3r5-devkit/environment-setup-armv7at2hf-vfp-oe-eabi
232+ - Shell script that sets environment variables to compile binaries for the target
233+
234+ |
224235
225236
226237.. _external-arm-toolchain :
0 commit comments