How can I make sure that all the static libs are required in all situations?
Does a perl -e 'print("hello\n");' really need all the libaries? if not, is there a way the select which ones I compile in the bin? (and know which ones are included in a previously built binary)
I've never bothered to look at how to configure static vs. dynamic compilation but given that both versions exist it must be possible.
I wouldn't worry about it too much though, as another nice feature of virtual memory systems works in your favor: paging. What Linux basically does when loading a binary is just to mark it loaded but paged out to its file. Then when something accesses the image in memory it gets automagically loaded, but in chunks of usually 4 KB, the size of an MMU page. So stuff that's never run is also likely never loaded, unless it has other code that has already been run in its vicinity. It's all pretty damn efficient anyway unless it's C++.
That was my initial thought as well ... meh 1.2M when we live in a much larger world now; however, I started looking at it and while my stock redhat binary is 16K, my own build (perlbrew) is 900K -- the difference being whether libperl (and libresolv) are static or not. It's an interesting build question at a minimum -- like the vendors are not doing default builds.