diff --git a/source/linux/Overview/GCC_ToolChain.rst b/source/linux/Overview/GCC_ToolChain.rst index d7e7ee8ce..4632b8abc 100644 --- a/source/linux/Overview/GCC_ToolChain.rst +++ b/source/linux/Overview/GCC_ToolChain.rst @@ -133,7 +133,7 @@ libraries. .. code-block:: c #include - + int main() { printf ("Hello World from TI!!!\n"); return 0; @@ -145,9 +145,20 @@ libraries. - **Compile Directly** : Cross-compile the **helloworld.c** file using the cross-compile toolchain directly - .. code-block:: console + .. ifconfig:: CONFIG_part_variant in ('AM335X', 'AM437X') + + .. code-block:: console + + host# ${CROSS_COMPILE_64}gcc ${CFLAGS} --sysroot=${SYSROOT_64} helloworld.c -o helloworld + + Pass the CFLAGS: :file:`-march=armv7-a` :file:`-mthumb` :file:`-mfpu=neon` :file:`-mfloat-abi=hard` + to the cross compiler to avoid the build issues. + + .. ifconfig:: CONFIG_part_variant not in ('AM335X', 'AM437X') - host# ${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64} helloworld.c -o helloworld + .. code-block:: console + + host# ${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64} helloworld.c -o helloworld Be sure to give the correct path to the gcc cross compiler and target sysroot as listed earlier. @@ -155,10 +166,19 @@ libraries. - **Using the environement setup script** : Cross-compile after sourcing the setup script - .. code-block:: console + .. ifconfig:: CONFIG_part_variant in ('AM335X', 'AM437X') + + .. code-block:: console + + host# source ${ENV_SETUP_64} + host# ${CC} ${CFLAGS} helloworld.c -o helloworld + + .. ifconfig:: CONFIG_part_variant not in ('AM335X', 'AM437X') + + .. code-block:: console - host# source ${ENV_SETUP_64} - host# ${CC} helloworld.c -o helloworld + host# source ${ENV_SETUP_64} + host# ${CC} helloworld.c -o helloworld 3. After the above steps are run you should now have a **helloworld** executable in your directory that has been compiled for the ARM. A