7 years, 4 months ago.

Eclipse Make Compile Fail When using mbed-cli gnuarmeclipse Exporter

I've spent a few hours trying to get my program to compile for the LPC1768 target using mbed-cli, Eclipse IDE (with GNU ARM Eclipse plug-in) and the GCC ARM toolchain to no avail:

I keep getting the following linker error:

arm-none-eabi-g++: error: ./mbed-os/features/FEATURE_LWIP/lwi-interface/lwip/src/netif/lwip_lowpan6.o: No such file or directory

It's as if it hasn't compiled the lwip_lowpan6.c file...

I checked the targets.json file in mbed-os for the LPC1768 target and LWIP is included as a supported feature, so it should be being compiled?

I'm using Windows 10 x64 and the GnuWin32 tools for make.

My process so far has been:

  1. Import project using mbed-cli
  2. Export project using mbed-cli (mbed export -m LPC1768 -i gnuarmeclipse) to set it up for Eclipse
  3. Run a "Build all" in Eclipse for the Release build configuration (as set up by the mbed-cli gnuarmeclipse exporter)

I seem to be able to get it to build successfully if I bypass make and just force the build configuration to directly call the mbed-cli "mbed compile", but then any compile errors don't get automatically flagged up in the source code viewer of the IDE.

Any suggestions?

Thanks

Paul

Looking in to the build log a little more, it seems that the gcc linker thinks the path to the lwip_lowpan6.o file contains .../lwi-interface... rather than ../lwip-interface/.. as it should be. It is randomly dropping characters from the object paths.

I then found these similar issues online that indicate that its not the linker, but a limitation of the Windows cmd.exe. You cannot pass in more than 8191 characters per command.

  1. https://stackoverflow.com/questions/20777521/linker-dropping-characters-on-object-files-passed-into-it
  2. http://asf.atmel.com/bugzilla/show_bug.cgi?id=1965

Since the mbed-cli automatically generated makefile linker command has well in excess of 8191 characters with all the mbed-os object files that are being passed in, I'm willing to bet this is the issue.

However, the Windows mbed-cli "compile" command manages to get around this. Presumably because it calls the linker via Python rather than Windows cmd.exe?

Are there any ways around this limitation?

Thanks

Paul

posted by Paul Harris 01 Jul 2017

Actually we get around it by placing all of the command line arguments into a file and having the linker read its arguments from that file.

posted by the other jimmy 05 Jul 2017

Other things to note: when exporting to GNU ARM Eclipse, mbed CLI and the mbed OS tools do not geterata a Makefile. Instead they generate a GNU ARM Eclipse managed project. The GNU ARM Eclipse plugin is what is generating your makefile here.

I make this distinction because there is another exporter, eclipse_gcc_arm, that exports an unmanaged project. For this exporter mbed CLI and the mbed OS tools generate the Makefile.

posted by the other jimmy 05 Jul 2017

1 Answer

7 years, 4 months ago.

Hi Paul,

I'm sorry to hear that. According to https://mcuoneclipse.com/2015/03/29/solving-the-8192-character-command-line-limit-on-windows/:

The solution is available from the version v2.6.1 or later of the GNU ARM Eclipse Plugins build tools

Let me know if upgrading helps!

-Jimmy

Accepted Answer

You should probably do a clean build after upgrading. Just in case.

posted by the other jimmy 05 Jul 2017

Thanks Jimmy. I've fixed the issue by installing the latest GNU Eclipse Plugin Windows Build tools :)

posted by Paul Harris 12 Jul 2017

I'm glad that worked for you. I also updated the docs to include a message about this particular error with a recommendation to upgrade to a version after 2.6.1.

posted by the other jimmy 12 Jul 2017