If I compile all the libraries statically will I avoid having to always gather the shared libraries when it core dumps
Yes.
However, contrary to popular belief, statically linked binaries are less portable than dynamically linked ones (at least on Linux).
In particular, if you use any of these functions: gethostbyname
, gethostbyaddr
, getpwent
, getpwnam
, getpwuid
(and a whole lot more), you will get a warning at link time, similar to this:
Using 'getpwuid' in statically linked applications requires at runtime
the shared libraries from the glibc version used for linking.
What this warning means is that IF your customer has a different version of glibc installed from the one you used at link time (i.e. different from your system libc), THEN your program will likely crash. Since that is a clearly worse situation than your current one, I don't believe static linking is a good solution for you.