Inefficient linker?

Hi,

I just noticed that the code size increases if I add a library to the libraries path, even if I don’t use it.
On AVR using WinAVR a library or even a function in a library is only linked into the code if I really use it.

Are there some compiler/linker switches for such optimizations?

BTW.: Who eats up that much RAM? If I compile the default firmware with the tinker app bss is at 12kB bytes. The spark only has 20kB. I don’t need that cloud stuff. Only want to connect to wifi and do a socket based communication with my server. Can I somehow reduce RAM usage.

1 Like

Hi @Bluescreen

I think eventually there will be some switches you can throw to control what gets linked, but right now if you don’t want major parts of the code base, you have to just go in and delete it yourself.

I have not looked in a while but the Spark protocol object for the cloud used about 2000 bytes of RAM in the past plus there are some 1024 byte buffers for the wireless LAN. After a few big-ticket items like that, you rapidly get down to the under 100 byte buffers used in various places.

The great thing about this project is that if you don’t need certain features, it is all open-source.