2

I am trying to build my project with the gcc compiler, but I get this error:

gcc: error: unrecognized command line option '-mthumb'

Isn't -mthumb a default option for gcc?


output of gcc --version:

gcc (GNU Tools for ARM Embedded Processors) 4.8.4 20140526 (release)
[ARM/embedded-4_8-branch revision 211358]

make version is 3.81

I am building with make version 3.81 for the Cortex-M4 architecture.

3
  • Just to add -mthumb is documented for GCC 4.4 and 8.2. Perhaps posting the command line would have helped, in case the options has become entwined in some other context? Oct 12, 2018 at 14:58
  • ahh, so you say it was probably because of a too old make in his case, @simon.watts? I got the same error when trying to compile an ARM project on an x86 GCC, as this is an ARM specific option.
    – hoijui
    Oct 14, 2018 at 8:32
  • 1
    @hoijui I don't think this is a make issue -- that would often exhibit as empty variables (expansions from missing make functions - run with --warn-undefined-variables). I was just checking when the -mthumb option was added to GCC, and it certainly predates 4.8.4. I would question whether there is something different in the ARM branch compared to baseline, or whether its possible the option appeared on the command line where something else was expected (such as a parameter to a preceding option, or similar). Oct 15, 2018 at 9:39

0

You must log in to answer this question.

Browse other questions tagged .