Skip to content

Commit aa7a0ed

Browse files
docs(GCC_ToolChain): Update cross-compile instructions for AM335x/AM437x
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]>
1 parent 9208381 commit aa7a0ed

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

source/linux/Overview/GCC_ToolChain.rst

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ libraries.
133133
.. code-block:: c
134134
135135
#include <stdio.h>
136-
136+
137137
int main() {
138138
printf ("Hello World from TI!!!\n");
139139
return 0;
@@ -145,20 +145,40 @@ libraries.
145145
- **Compile Directly** : Cross-compile the **helloworld.c** file using the
146146
cross-compile toolchain directly
147147

148-
.. code-block:: console
148+
.. ifconfig:: CONFIG_part_variant in ('AM335X', 'AM437X')
149+
150+
.. code-block:: console
151+
152+
host# ${CROSS_COMPILE_64}gcc ${CFLAGS} --sysroot=${SYSROOT_64} helloworld.c -o helloworld
153+
154+
Pass the CFLAGS: :file:`-march=armv7-a` :file:`-mthumb` :file:`-mfpu=neon` :file:`-mfloat-abi=hard`
155+
to the cross compiler to avoid the build issues.
156+
157+
.. ifconfig:: CONFIG_part_variant not in ('AM335X', 'AM437X')
149158

150-
host# ${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64} helloworld.c -o helloworld
159+
.. code-block:: console
160+
161+
host# ${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64} helloworld.c -o helloworld
151162
152163
Be sure to give the correct path to the gcc cross compiler and target
153164
sysroot as listed earlier.
154165

155166
- **Using the environement setup script** : Cross-compile after sourcing
156167
the setup script
157168

158-
.. code-block:: console
169+
.. ifconfig:: CONFIG_part_variant in ('AM335X', 'AM437X')
170+
171+
.. code-block:: console
172+
173+
host# source ${ENV_SETUP_64}
174+
host# ${CC} ${CFLAGS} helloworld.c -o helloworld
175+
176+
.. ifconfig:: CONFIG_part_variant not in ('AM335X', 'AM437X')
177+
178+
.. code-block:: console
159179
160-
host# source ${ENV_SETUP_64}
161-
host# ${CC} helloworld.c -o helloworld
180+
host# source ${ENV_SETUP_64}
181+
host# ${CC} helloworld.c -o helloworld
162182
163183
3. After the above steps are run you should now have a **helloworld**
164184
executable in your directory that has been compiled for the ARM. A

0 commit comments

Comments
 (0)