Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

This library is HUGE! And whats libsupc++?

huge library
0
Posted

This library is HUGE! And whats libsupc++?

0

Usually the size of libraries on disk isn’t noticeable. When a link editor (or simply “linker”) pulls things from a static archive library, only the necessary object files are copied into your executable, not the entire library. Unfortunately, even if you only need a single function or variable from an object file, the entire object file is extracted. (There’s nothing unique to C++ or libstdc++-v3 about this; it’s just common behavior, given here for background reasons.) Some of the object files which make up libstdc++.a are rather large. If you create a statically-linked executable with -static, those large object files are suddenly part of your executable. Historically the best way around this was to only place a very few functions (often only a single one) in each source/object file; then extracting a single function is the same as extracting a single .o file. For libstdc++-v3 this is only possible to a certain extent; the object files in question contain template classes and templa

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123