We want to wrap all the STM32CubeMX generated code into a static library and make the application link with this library and a few others.
The whole project structure builds and links fine, but it does not run. On inspection I find that the output HEX file is 40kB smaller than the same project built as a "flat" structure (meaning: linking the application with all the object files individually rather than one static lib).
After a long period of head-scratching, I finally found that I need to link with this specific library using the --whole_archive option.
I learned this by manually linking the project myself from the command line and trying different ilinkarm.exe command line options.
How do I configure the EWARM project to link in such a manner? I see no option for it.
I don't mind if there was a "global" switch, even when it means that all libraries are linked as a whole archive even when it's just this one library that really needs it.
I also don't mind editing the EWP file manually should this option not be exposed in the EWARM UI. It would mean careful management of the EWP file in the version control system as I would imagine such a hidden option would be lost the next time a dev reconfigures the project in EWARM, but at this stage it's a "needs must" situation.