How to remove unused libraries? #719
-
Hi, Please share your suggestions. Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This sdk doesn't come with S3. That is something that would be found in the non-IoT sdk (aws-sdk-cpp). We don't have any configurations for not building device tunneling, etc. You could try modifying the CMakeLists to remove the services that you don't need, but that is not something that is supported or tested by this sdk. A few other questions to make sure I understand what you want from this sdk. What version of this sdk were you using before/after you saw the 1.5MB size increase? What size requirements do you want from this sdk? |
Beta Was this translation helpful? Give feedback.
-
If I build aws-iot-device-sdk-cpp-v2 with the build options mentioned in the readme, it does build libaws-c-s3.a. we dont need aws_s3_library, how can I remove it. Could you please point me where can I find all CMAKE flags. I had used v1.10.9 in production few years back now planning to update with the latest SDK. After updating to the latest version, noticed the application size increased by 1.5MB. This sdk is used in memory constrained hardware platform, which runs on embedded linux, where 1.5MB is a sizeable change. What I need from this SDK: Mqtt client(pub/sub),Shadow, Jobs. |
Beta Was this translation helpful? Give feedback.
-
Assuming static linkage, you're only going to pick up what the linker can't strip based on call-site analysis, regardless of how many extra libraries are linked against. That stripping isn't perfect though (the codebase has plenty of vtable-esque constructions and unified configuration structures that will degrade how much can be left out, unfortunately). A few things to try if you're not already doing so:
In the long term, we are starting to think about modularity (given that the codebase isn't very modular at all), but any changes are likely to (1) be breaking, and (2) be a long way off. |
Beta Was this translation helpful? Give feedback.
Assuming static linkage, you're only going to pick up what the linker can't strip based on call-site analysis, regardless of how many extra libraries are linked against. That stripping isn't perfect though (the codebase has plenty of vtable-esque constructions and unified configuration structures that will degrade how much can be left out, unfortunately).
A few things to try if you're not already doing so: