Skip to content

Commit 589b53c

Browse files
jmentijeevantelukula
authored andcommitted
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 4b648a9 commit 589b53c

8 files changed

Lines changed: 54 additions & 75 deletions

File tree

source/linux/Foundational_Components/Kernel/_Users_Guide.rst

Lines changed: 21 additions & 39 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,19 @@ 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')
48+
Setup Cross Compile Environment
49+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7150

72-
.. include:: Overview/GCC_ToolChain.rst
73-
:start-after: .. start_include_yocto_toolchain_host_setup
74-
:end-before: .. end_include_yocto_toolchain_host_setup
51+
.. important::
7552

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

58+
.. include:: Overview/GCC_ToolChain.rst
59+
:start-after: .. start_include_yocto_toolchain_host_setup
60+
:end-before: .. end_include_yocto_toolchain_host_setup
7961

8062
Cleaning the Kernel Sources
8163
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -98,7 +80,7 @@ The command to clean the kernel is:
9880

9981
.. code-block:: console
10082
101-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- distclean
83+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" distclean
10284
10385
..
10486
[comment] instructions for 64 bit processors
@@ -131,7 +113,7 @@ a command of the form:
131113

132114
.. code-block:: console
133115
134-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- <defconfig>
116+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" <defconfig>
135117
136118
..
137119
[comment] instructions for 64 bit processors
@@ -160,13 +142,13 @@ Using Default Configurations
160142

161143
.. code-block:: console
162144
163-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- multi_v7_defconfig ti_multi_v7_prune.config no_smp.config
145+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" multi_v7_defconfig ti_multi_v7_prune.config no_smp.config
164146
165147
For RT-Linux,
166148

167149
.. code-block:: console
168150
169-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- multi_v7_defconfig ti_multi_v7_prune.config no_smp.config ti_rt.config
151+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" multi_v7_defconfig ti_multi_v7_prune.config no_smp.config ti_rt.config
170152
171153
172154
..
@@ -215,13 +197,13 @@ To invoke the kernel configuration you simply use a command like:
215197

216198
.. code-block:: console
217199
218-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- <config type>
200+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" <config type>
219201
220202
i.e. for menuconfig the command would look like
221203

222204
.. code-block:: console
223205
224-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- menuconfig
206+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" menuconfig
225207
226208
..
227209
[comment] instructions for 64 bit processors
@@ -265,7 +247,7 @@ Compiling the Kernel
265247

266248
.. code-block:: console
267249
268-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- zImage
250+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" zImage
269251
270252
This will result in a kernel image file being created in the
271253
:file:`arch/arm/boot/` directory called :file:`zImage`.
@@ -356,7 +338,7 @@ Compiling the Device Tree Binaries
356338

357339
.. code-block:: console
358340
359-
make DTC_FLAGS=-@ ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- <dt filename>.dtb
341+
make DTC_FLAGS=-@ ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" <dt filename>.dtb
360342
361343
The compiled device tree file with be located in :file:`arch/arm/boot/dts/ti/omap`.
362344

@@ -365,13 +347,13 @@ Compiling the Device Tree Binaries
365347

366348
.. code-block:: console
367349
368-
make DTC_FLAGS=-@ ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- am335x-boneblack.dtb
350+
make DTC_FLAGS=-@ ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" am335x-boneblack.dtb
369351
370352
Alternatively, you can build every device tree binary with command
371353

372354
.. code-block:: console
373355
374-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- dtbs
356+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" dtbs
375357
376358
..
377359
[comment] instructions for 64 bit processors
@@ -460,7 +442,7 @@ Compiling the Kernel Modules
460442

461443
.. code-block:: console
462444
463-
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- modules
445+
make ARCH=arm CROSS_COMPILE="$CROSS_COMPILE_32" modules
464446
465447
..
466448
[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:: ../../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:: ../../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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ 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

9595
.. include:: Overview/GCC_ToolChain.rst
9696
:start-after: .. start_include_yocto_toolchain_host_setup

source/linux/Foundational_Components_OPTEE.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ 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

3737
.. include:: Overview/GCC_ToolChain.rst
3838
:start-after: .. start_include_yocto_toolchain_host_setup

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)