diff --git a/source/linux/Overview/GCC_ToolChain.rst b/source/linux/Overview/GCC_ToolChain.rst index 700a51d38..a673e326d 100644 --- a/source/linux/Overview/GCC_ToolChain.rst +++ b/source/linux/Overview/GCC_ToolChain.rst @@ -12,33 +12,37 @@ 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. +.. 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-" - 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-" + export SYSROOT_32="${SDK_INSTALL_DIR}/linux-devkit/sysroots/armv7at2hf-neon-oe-linux-gnueabi" + 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-" + 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. @@ -334,14 +338,18 @@ into a ```` directory in Linux Host using x86_64 architecture. 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"