Including whole Amazon FreeRTOS library rather than only a part of it

haperera wrote on March 6, 2020:


First of all, I know that you would think that why someone would need such a thing when I am gonna ask this question.

So my need is to have all the AmazonFreeRTOS library included in my binary though I am using few functions from it. (for example, lets say I am using MQTT demo application that is already included. Although it may only use few functions from the actual library, I need to put all the library inside the final executable rather than only the functions that is been used.) Yeah! you may definitely think that what's the reason to do so. Basically, for my research work, I need to build an executable so that it include all the Amazon FreeRTOS in it. It would be very convenient and easy for me if I have a way to put all the library rather than trying to use each and every part of it manually in my application.

Through the system workbench, I have been using '-Wl,–whole-archive' option to instruct the linker but I was unable to achieve my goal. To be specific, the demo application I am trying to build is for STMicro Electronics. Is there any way that I could get to my goal? May be trying with linker or a compiler flag, or any other way?

Thank you so much!

Have you looked into using KEEP() in your linker script? It is used like below to ensure that the vector able is not stripped:

KEEP(*(.isr_vector)) /* Startup code */


1 Like


This appears to be a duplicate of a Git Issue that was resolved.