This is the mail archive of the
mailing list for the GCC project.
Re: Problem with static linking
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Zachary Turner <divisortheory at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 16 Jul 2009 10:16:15 +0200
- Subject: Re: Problem with static linking
- References: <email@example.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jul 15, 2009 at 09:37:32PM -0500, Zachary Turner wrote:
> So I guess I have three questions. 1) Is this actually a problem or
> are these errors spurious? 2) Why do they disappear when I delete the
They are likely spurious. You get tons of valgrind warnings with dynamically
linked ld.so/libc.so as well, they are just suppressed through a default valgrind
suppression file. Obviously it is not possible to do the same with
statically linked programs. valgrind doesn't grok tricks used e.g. in SSE2 strlen
and a bunch of other memory/string ops.
> -static option? and 3) Is there a way to fix them? I've even gone so
> far as to manually run collect2 specifying my own hand edited command
> line, but nothing I've tried there has worked either.
Don't link statically, there are many reasons not to and only very few
reasons for it (primarily exception is some system recovery tools that are
supposed to work even when shared libraries are hosed).