CLI GNU ARM Eclipse (managed CDT) project Export - Bad Linker Command Line

23 Jun 2017

I used the mbed CLI to export to a GNU ARM Eclipse (managed CDT) project.

The created project compiles OK, but the link fails:

arm-none-eabi-g++: error: unrecognized command line option '--wrap=main'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_malloc_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_free_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_realloc_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=_calloc_r'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=exit'
arm-none-eabi-g++: error: unrecognized command line option '--wrap=atexit'

The Linker options are wrong: /media/uploads/awneil/2017-06-23_1e86oHW.png

The 'wrap' options need the -Wl prefix to be passed-through to the Linker

https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/Link-Options.html

If I export to an Eclipse_gcc_arm (makefile) project from the online compiler, it gets this correct.

23 Jun 2017

So I tried the Eclipse makefile Export - and that doesn't work properly either!

https://developer.mbed.org/forum/bugs-suggestions/topic/27892/

23 Jun 2017

Hi Andrew,

I responded to your issue on github https://github.com/ARMmbed/mbed-os/issues/4624

23 Jun 2017

Thanks - I was just about to make the reference!