This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

linking fails with unrecognized emulation mode

Did somebody ever get the following error message:

/usr/lib/gcc/arm-none-eabi/7.1.0/../../../../arm-none-eabi/bin/ld: unrecognised emulation mode: cpu=cortex-m4 Supported emulations: armelf collect2: error: ld returned 1 exit status

The linker options are:

arm-none-eabi-gcc -Xlinker -Map=_build/nrf52832_xxaa.map -mthumb -mabi=aapcs -L /path/to/nRF5_SDK_11_0_0_89a8197/components/toolchain/gcc -T -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Wl,--gc-sections --specs=nano.specs -lc -lnosys     -o .o

People that had the same problem, solved it, but did not post a solution:

answers.launchpad.net/.../253559

The target is a NRF52832

Setting -mcpu=blah

I get this note:

rm-none-eabi-gcc: note: valid arguments to '-mcpu=' are: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a12 cortex-a15 cortex-a15.cortex-a7 cortex-a17 cortex-a17.cortex-a7 cortex-a32 cortex-a35 cortex-a5 cortex-a53 cortex-a57 cortex-a57.cortex-a53 cortex-a7 cortex-a72 cortex-a72.cortex-a53 cortex-a73 cortex-a73.cortex-a35 cortex-a73.cortex-a53 cortex-a8 cortex-a9 cortex-m0 cortex-m0.small-multiply cortex-m0plus cortex-m0plus.small-multiply cortex-m1 cortex-m1.small-multiply cortex-m23 cortex-m3 cortex-m33 cortex-m4 cortex-m7 cortex-r4 cortex-r4f cortex-r5 cortex-r7 cortex-r8 ep9312 exynos-m1 fa526 fa606te fa626 fa626te fa726te falkor fmp626 generic-armv7-a iwmmxt iwmmxt2 marvell-pj4 mpcore mpcorenovfp native qdf24xx strongarm strongarm110 strongarm1100 strongarm1110 xgene1 xscale; did you mean 'arm10e'?

which enlists cortex-m4.

Any ideas?

Related