Skip to content

Commit

Permalink
docs(GCC_ToolChain): Update cross-compile instructions for AM335x/AM437x
Browse files Browse the repository at this point in the history
Update the cross-compile commands and instructions for AM335x/AM437x adding about CFLAGS to avoid the build errors

Signed-off-by: Telukula Jeevan Kumar Sahu <[email protected]>
  • Loading branch information
jeevantelukula committed Nov 21, 2024
1 parent bbc3c89 commit 772594c
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions source/linux/Overview/GCC_ToolChain.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ libraries.
.. code-block:: c
#include <stdio.h>
int main() {
printf ("Hello World from TI!!!\n");
return 0;
Expand All @@ -145,20 +145,40 @@ 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.

- **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
Expand Down

0 comments on commit 772594c

Please sign in to comment.