PelionIoT / nanostack-border-router

Nanostack Border Router implementation
Apache License 2.0
51 stars 48 forks source link

Fix conflicting declarations of main() for GCC_ARM build with "-flto" #197

Closed fkjagodzinski closed 4 years ago

fkjagodzinski commented 4 years ago

Update the main() to be compatible with the declaration from platform/mbed_toolchain.h that adds the MBED_USED attribute. Without the attribute the main() symbol is not emitted with the GCC toolchain using "-Wl,--wrap,main" and "-flto" flags.

This patch is required by https://github.com/ARMmbed/mbed-os/pull/11856.

0xc0170 commented 4 years ago

@artokin @JarkkoPaso Please review and merge, this blocks one of 5.15 PRs to Mbed OS

fkjagodzinski commented 4 years ago

Eventually, I was able to find a less intrusive solution for the undefined reference to 'main' problem.

Please see: https://github.com/ARMmbed/mbed-os/pull/11856#issuecomment-559097300

Big thanks to the reviewers for the quick response and apologies for any inconvenience I might have caused with this PR. Feel free to revert this patch.