This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with static linking


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).
See http://people.redhat.com/drepper/no_static_linking.html

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]