Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 29 additions & 21 deletions source/linux/Overview/GCC_ToolChain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,37 @@
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.

.. note::

Run the following commands on the host machine.

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

.. code-block:: console

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-"
Comment thread
jeevantelukula marked this conversation as resolved.
Resolved
host# export SYSROOT_32="${SDK_INSTALL_DIR}/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi"
host# export CFLAGS="-march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard"
host# export CC_32="${CROSS_COMPILE_32}gcc ${CFLAGS} --sysroot=${SYSROOT_32}"
export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-"

Check warning on line 23 in source/linux/Overview/GCC_ToolChain.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Headings] Use sentence-style capitalization in 'linux-devkit'. Raw Output: {"message": "[RedHat.Headings] Use sentence-style capitalization in 'linux-devkit'.", "location": {"path": "source/linux/Overview/GCC_ToolChain.rst", "range": {"start": {"line": 23, "column": 51}}}, "severity": "INFO"}

Check warning on line 23 in source/linux/Overview/GCC_ToolChain.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Linux' rather than 'linux'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Linux' rather than 'linux'.", "location": {"path": "source/linux/Overview/GCC_ToolChain.rst", "range": {"start": {"line": 23, "column": 51}}}, "severity": "WARNING"}
export SYSROOT_32="${SDK_INSTALL_DIR}/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi"

Check warning on line 24 in source/linux/Overview/GCC_ToolChain.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Linux' rather than 'linux'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Linux' rather than 'linux'.", "location": {"path": "source/linux/Overview/GCC_ToolChain.rst", "range": {"start": {"line": 24, "column": 45}}}, "severity": "WARNING"}
export CFLAGS="-march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard"
export CC_32="${CROSS_COMPILE_32}gcc ${CFLAGS} --sysroot=${SYSROOT_32}"

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

.. code-block:: console

host# export CROSS_COMPILE_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-"
host# export SYSROOT_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/aarch64-oe-linux"
host# export CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
host# export CFLAGS64="--sysroot=${SYSROOT_64}"
host# export KCFLAGS="--sysroot=${SYSROOT_64}"
host# export LDFLAGS="--sysroot=${SYSROOT_64}"
export CROSS_COMPILE_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-"
export SYSROOT_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/aarch64-oe-linux"
export CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
export CFLAGS64="--sysroot=${SYSROOT_64}"
export KCFLAGS="--sysroot=${SYSROOT_64}"
export LDFLAGS="--sysroot=${SYSROOT_64}"

.. ifconfig:: CONFIG_part_variant not in ('AM335X', 'AM437X', 'AM57X', 'AM62LX')

.. code-block:: console

host# export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-"
host# export SYSROOT_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/armv7at2hf-vfp-oe-eabi"
host# export CFLAGS32="--sysroot=${SYSROOT_32}"
export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-"

Check warning on line 43 in source/linux/Overview/GCC_ToolChain.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Headings] Use sentence-style capitalization in 'k3r5-devkit'. Raw Output: {"message": "[RedHat.Headings] Use sentence-style capitalization in 'k3r5-devkit'.", "location": {"path": "source/linux/Overview/GCC_ToolChain.rst", "range": {"start": {"line": 43, "column": 51}}}, "severity": "INFO"}
export SYSROOT_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/armv7at2hf-vfp-oe-eabi"
export CFLAGS32="--sysroot=${SYSROOT_32}"

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.
Expand Down Expand Up @@ -334,14 +338,18 @@
The environment variables defined here will be referenced in the build
commands of the Foundational Components in this document.

.. note::

Run the following commands on the host machine.

.. code-block:: console

host# COMPILER_PATH=/opt/arm-toolchain
host# mkdir -p $COMPILER_PATH
host# wget -c https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz -O - | tar -xv -J -C $COMPILER_PATH
host# wget -c https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz -O - | tar -xv -J -C $COMPILER_PATH
host# export CROSS_COMPILE_64=$COMPILER_PATH/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
host# export CROSS_COMPILE_32=$COMPILER_PATH/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
host# export CC_64="${CROSS_COMPILE_64}gcc"
host# export CC_32="${CROSS_COMPILE_32}gcc"
COMPILER_PATH=/opt/arm-toolchain
mkdir -p $COMPILER_PATH
wget -c https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf.tar.xz -O - | tar -xv -J -C $COMPILER_PATH
wget -c https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-linux-gnu.tar.xz -O - | tar -xv -J -C $COMPILER_PATH
export CROSS_COMPILE_64=$COMPILER_PATH/arm-gnu-toolchain-13.3.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
export CROSS_COMPILE_32=$COMPILER_PATH/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
export CC_64="${CROSS_COMPILE_64}gcc"
export CC_32="${CROSS_COMPILE_32}gcc"

Loading