Skip to content

Commit 7e69b87

Browse files
committed
fix(linux): Standardize CC ENV setup instructions
Cross compile environment is similar across u-boot, TF-A, OPTEE, and Linux builds. Move step by step instructions into GCC_ToolChain RST and reference from other build guides using include directive. Since the CC ENV instructions export CC path using $CROSS_COMPILE_32 and $CROSS_COMPILE_64, use these in legacy build guides as well. Signed-off-by: Judith Mendez <jm@ti.com>
1 parent 344825f commit 7e69b87

8 files changed

Lines changed: 55 additions & 78 deletions

File tree

source/linux/Foundational_Components/Kernel/_Users_Guide.rst

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ Alternatively, Kernel sources can directly be fetched from GIT.
3737
Preparing to Build
3838
------------------
3939

40-
It is important that when using the GCC toolchain provided with the SDK
41-
or stand alone from TI that you do **NOT** source the
42-
*environment-setup* file included with the toolchain when building the
43-
kernel. Doing so will cause the compilation of host side components
44-
within the kernel tree to fail.
45-
4640
.. note::
4741
The following commands are intended to be run from the root of the
4842
kernel tree unless otherwise specified. The root of the kernel tree is
@@ -51,31 +45,17 @@ within the kernel tree to fail.
5145

5246
.. _kernel-compiler:
5347

54-
Compiler
55-
^^^^^^^^
56-
57-
..
58-
[comment] instructions for 32 bit processors
59-
.. ifconfig:: CONFIG_part_family in ('AM335X_family', 'AM437X_family', 'AM57X_family')
60-
61-
Before compiling the kernel or kernel modules the SDK's toolchain needs
62-
to be added to the PATH environment variable
63-
64-
.. code-block:: console
65-
66-
export PATH=<sdk path>/linux-devkit/sysroots/x86_64-arago-linux/usr/bin:$PATH
67-
68-
..
69-
[comment] instructions for 64 bit processors
70-
.. ifconfig:: CONFIG_part_family not in ('AM335X_family', 'AM437X_family', 'AM57X_family')
71-
72-
.. include:: Overview/GCC_ToolChain.rst
73-
:start-after: .. start_include_yocto_toolchain_host_setup
74-
:end-before: .. end_include_yocto_toolchain_host_setup
48+
Setup Cross Compile Environment
49+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7550

76-
The current compiler supported for this release along with download
77-
location can be found in the release notes for the kernel release.
51+
It is important that when using the GCC toolchain provided with the SDK or stand alone
52+
from TI that you do **NOT** source the *environment-setup* file included with the
53+
toolchain when building the kernel. Doing so will cause the compilation of host side
54+
components within the kernel tree to fail.
7855

56+
.. include:: /linux/Overview/GCC_ToolChain.rst
57+
:start-after: .. start_include_yocto_toolchain_host_setup
58+
:end-before: .. end_include_yocto_toolchain_host_setup
7959

8060
Cleaning the Kernel Sources
8161
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -98,7 +78,7 @@ The command to clean the kernel is:
9878

9979
.. code-block:: console
10080
101-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- distclean
81+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" distclean
10282
10383
..
10484
[comment] instructions for 64 bit processors
@@ -131,7 +111,7 @@ a command of the form:
131111

132112
.. code-block:: console
133113
134-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- <defconfig>
114+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" <defconfig>
135115
136116
..
137117
[comment] instructions for 64 bit processors
@@ -160,13 +140,13 @@ Using Default Configurations
160140

161141
.. code-block:: console
162142
163-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- multi_v7_defconfig ti_multi_v7_prune.config no_smp.config
143+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" multi_v7_defconfig ti_multi_v7_prune.config no_smp.config
164144
165145
For RT-Linux,
166146

167147
.. code-block:: console
168148
169-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- multi_v7_defconfig ti_multi_v7_prune.config no_smp.config ti_rt.config
149+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" multi_v7_defconfig ti_multi_v7_prune.config no_smp.config ti_rt.config
170150
171151
172152
..
@@ -215,13 +195,13 @@ To invoke the kernel configuration you simply use a command like:
215195

216196
.. code-block:: console
217197
218-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- <config type>
198+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" <config type>
219199
220200
i.e. for menuconfig the command would look like
221201

222202
.. code-block:: console
223203
224-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- menuconfig
204+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" menuconfig
225205
226206
..
227207
[comment] instructions for 64 bit processors
@@ -265,7 +245,7 @@ Compiling the Kernel
265245

266246
.. code-block:: console
267247
268-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- zImage
248+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" zImage
269249
270250
This will result in a kernel image file being created in the
271251
:file:`arch/arm/boot/` directory called :file:`zImage`.
@@ -356,7 +336,7 @@ Compiling the Device Tree Binaries
356336

357337
.. code-block:: console
358338
359-
make DTC_FLAGS=-@ ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- <dt filename>.dtb
339+
make DTC_FLAGS=-@ ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" <dt filename>.dtb
360340
361341
The compiled device tree file with be located in :file:`arch/arm/boot/dts/ti/omap`.
362342

@@ -365,13 +345,13 @@ Compiling the Device Tree Binaries
365345

366346
.. code-block:: console
367347
368-
make DTC_FLAGS=-@ ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- am335x-boneblack.dtb
348+
make DTC_FLAGS=-@ ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" am335x-boneblack.dtb
369349
370350
Alternatively, you can build every device tree binary with command
371351

372352
.. code-block:: console
373353
374-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- dtbs
354+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" dtbs
375355
376356
..
377357
[comment] instructions for 64 bit processors
@@ -460,7 +440,7 @@ Compiling the Kernel Modules
460440

461441
.. code-block:: console
462442
463-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- modules
443+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" modules
464444
465445
..
466446
[comment] instructions for 64 bit processors

source/linux/Foundational_Components/U-Boot/BG-Build-K3.rst

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ Build
1515
the top-level directory and can be identified by looking for the
1616
"licenses" directory.
1717

18-
.. rubric:: Setting up the toolchain paths
19-
20-
.. include:: ../../Overview/GCC_ToolChain.rst
21-
:start-after: .. start_include_yocto_toolchain_host_setup
22-
:end-before: .. end_include_yocto_toolchain_host_setup
23-
2418
.. code-block:: console
2519
2620
$ cd <path to tf-a dir>
@@ -80,15 +74,7 @@ Several prebuilt images are required from the TI Processor SDK for building U-Bo
8074
- ti-linux-firmware (BINMAN_INDIRS): Prebuilt binaries for DM and SYSFW available `here
8175
<https://git.ti.com/cgit/processor-firmware/ti-linux-firmware/log/?h=ti-linux-firmware>`__.
8276

83-
All of these are available in the SDK at :file:`<path to tisdk>/board-support/prebuilt-images>`
84-
85-
Go :ref:`here <download-and-install-sdk>` to download and install the SDK.
86-
87-
.. rubric:: Setting up the toolchain paths
88-
89-
.. include:: ../../Overview/GCC_ToolChain.rst
90-
:start-after: .. start_include_yocto_toolchain_host_setup
91-
:end-before: .. end_include_yocto_toolchain_host_setup
77+
All of these binaries are available in the SDK at :file:`<path to tisdk>/board-support/prebuilt-images>`
9278

9379
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')
9480

source/linux/Foundational_Components/U-Boot/BG-Build-OMAP.rst

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,13 @@ target name. That way if you are working with multiple configuration
2424
targets it is very easy to know which folder contains the u-boot
2525
binaries that you are interested in.
2626

27-
.. rubric:: Setting the tool chain path
28-
29-
We strongly recommend using the toolchain that came with the Linux Core
30-
release that corresponds to this U-Boot release. For e.g:
31-
32-
.. code-block:: console
33-
34-
$ export PATH=$HOME/<TOOLCHAIN_PATH>/bin:$PATH
35-
3627
.. rubric:: Cleaning the Sources
3728

3829
If you did not use a separate object directory:
3930

4031
.. code-block:: console
4132
42-
$ make CROSS_COMPILE=arm-none-linux-gnueabihf- distclean
33+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" distclean
4334
4435
.. ifconfig:: CONFIG_part_variant in ('AM335X')
4536

@@ -122,26 +113,26 @@ with:
122113

123114
.. code-block:: console
124115
125-
$ make CROSS_COMPILE=arm-none-linux-gnueabihf- O=am335x_evm am335x_evm_defconfig
126-
$ make CROSS_COMPILE=arm-none-linux-gnueabihf- O=am335x_evm
116+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" O=am335x_evm am335x_evm_defconfig
117+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" O=am335x_evm
127118
128119
.. ifconfig:: CONFIG_part_variant in ('AM437X')
129120

130121
Then (Use ``am43xx_evm`` and 'AM437x GP EVM' in this example):
131122

132123
.. code-block:: console
133124
134-
$ make CROSS_COMPILE=arm-none-linux-gnueabihf- O=am43xx_evm am43xx_evm_defconfig
135-
$ make CROSS_COMPILE=arm-none-linux-gnueabihf- O=am43xx_evm
125+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" O=am43xx_evm am43xx_evm_defconfig
126+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" O=am43xx_evm
136127
137128
.. ifconfig:: CONFIG_part_variant in ('AM57X')
138129

139130
Then (Use ``am57xx_evm`` and 'AM57x GP EVM' in this example):
140131

141132
.. code-block:: console
142133
143-
$ make CROSS_COMPILE=arm-none-linux-gnueabihf- O=am57xx_evm am57xx_evm_defconfig
144-
$ make CROSS_COMPILE=arm-none-linux-gnueabihf- O=am57xx_evm
134+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" O=am57xx_evm am57xx_evm_defconfig
135+
$ make CROSS_COMPILE="$CROSS_COMPILE_32" O=am57xx_evm
145136
146137
.. note::
147138

source/linux/Foundational_Components/U-Boot/BG-Setup-K3.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ git repositories including commit history.
4848

4949
U-Boot sources can also be directly fetched from GIT. The GIT repository URL,
5050
branch and commit id is available in :ref:`release-specific-build-information`.
51+
52+
*******************************
53+
Setup Cross Compile Environment
54+
*******************************
55+
56+
.. include:: /linux/Overview/GCC_ToolChain.rst
57+
:start-after: .. start_include_yocto_toolchain_host_setup
58+
:end-before: .. end_include_yocto_toolchain_host_setup

source/linux/Foundational_Components/U-Boot/BG-Setup-OMAP.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,10 @@ repo URL, branch and commit id can be found in the release notes:
4646

4747
- ti-u-boot version: :ref:`release-specific-build-information`
4848

49+
*******************************
50+
Setup Cross Compile Environment
51+
*******************************
4952

53+
.. include:: /linux/Overview/GCC_ToolChain.rst
54+
:start-after: .. start_include_yocto_toolchain_host_setup
55+
:end-before: .. end_include_yocto_toolchain_host_setup

source/linux/Foundational_Components_ATF.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ Where <hash> is the commit shown in :ref:`release-specific-build-information`.
9090

9191
|
9292
93-
.. rubric:: Setting up the toolchain paths
93+
.. rubric:: Setup Cross Compile Environment
9494

95-
.. include:: Overview/GCC_ToolChain.rst
95+
.. include:: /linux/Overview/GCC_ToolChain.rst
9696
:start-after: .. start_include_yocto_toolchain_host_setup
9797
:end-before: .. end_include_yocto_toolchain_host_setup
9898

source/linux/Foundational_Components_OPTEE.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ Where <hash> is the OPTEE commit shown in :ref:`release-specific-build-informati
3131

3232
|
3333
34-
Setting up the toolchain paths
35-
------------------------------
34+
Setup Cross Compile Environment
35+
-------------------------------
3636

37-
.. include:: Overview/GCC_ToolChain.rst
37+
.. include:: /linux/Overview/GCC_ToolChain.rst
3838
:start-after: .. start_include_yocto_toolchain_host_setup
3939
:end-before: .. end_include_yocto_toolchain_host_setup
4040

source/linux/Overview/GCC_ToolChain.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ GCC ToolChain Setup
55

66
.. start_include_yocto_toolchain_host_setup
77
8-
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.
8+
The cross compile version supported in this release can be found in the release
9+
notes for the kernel release.
10+
11+
Before compiling any of the sources referenced in this document, set the cross
12+
compiler paths to the toolchains packaged in the Processor SDK [Recommended] as
13+
shown below. Refer to :ref:`yocto-toolchain` section for more details on usage.
914

1015
.. ifconfig:: CONFIG_part_variant in ('AM335X', 'AM437X', 'AM57X')
1116

@@ -35,7 +40,8 @@ Before compiling any of the sources referenced in this document, set the cross c
3540
host# export SYSROOT_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/armv7at2hf-vfp-oe-eabi"
3641
host# export CFLAGS32="--sysroot=${SYSROOT_32}"
3742
38-
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.
43+
If the Processor SDK is not installed, the Arm GNU toolchains can be downloaded and setup.
44+
Refer to :ref:`external-arm-toolchain` section for more details on usage.
3945

4046
.. end_include_yocto_toolchain_host_setup
4147

0 commit comments

Comments
 (0)