Thursday, February 17, 2022

[SOLVED] How do I use the gcc -marm option in Raspberry Pi?

Issue

I am using Ubuntu in Raspberry Pi 4.

I understand that there is an option called -marm in gcc. However, using the option to compile results in an error.

gcc error unrecognized command line option '-marm'

The development environment was installed through build-essential, and I wonder if additional settings are needed.


Solution

You get this error because there is no -marm option in gcc. There is an -march option ( arch -> 'architecture' | https://wiki.gentoo.org/wiki/GCC_optimization#-march) and an -m option ( https://gcc.gnu.org/onlinedocs/gcc/GNU_002fLinux-Options.html ) .

As RPi is based on an ARM the gcc has the following options : https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html#ARM-Options ( https://gcc.gnu.org/onlinedocs/gcc/Submodel-Options.html#Submodel-Options 3.19 Machine-Dependent Options )



Answered By - ralf htp
Answer Checked By - Katrina (WPSolving Volunteer)