Re: Problem with static linking

2009-07-17 Thread Andrew Haley
On 07/16/2009 09:08 PM, Zachary Turner wrote: > > There's also much less to deal with from a Q/A and tech support > perspective if you use static linking with a closed source > application, since you can produce 1 binary which works across > multiple distributions and kernels without the user comp

Re: Problem with static linking

2009-07-16 Thread Zachary Turner
On Thu, Jul 16, 2009 at 12:57 PM, Ian Lance Taylor wrote: > > Jakub Jelinek writes: > > >> -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. >

Re: Problem with static linking

2009-07-16 Thread Frank Ch. Eigler
Andrew Haley writes: >> [...] It makes heavy use of >> C++, STL, and boost and we'd like to (if possible) link *everything* >> statically. This means libc, libgcc, libstdc++, boost, libpthread, >> etc. > [...] > However, I really implore you: by all means link statically to everything > else, bu

Re: Problem with static linking

2009-07-16 Thread Ian Lance Taylor
Jakub Jelinek writes: >> -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

Re: Problem with static linking

2009-07-16 Thread Alfred M. Szmidt
However, I really implore you: by all means link statically to everything else, but leave libc dynamically linked. I'm not aware of any reason not to link libc dynamically, and not doing so leads to a ton of problems. Problems also arise if one uses functions that use NSS (eg. getXbyY

Re: Problem with static linking

2009-07-16 Thread Jakub Jelinek
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

Re: Problem with static linking

2009-07-16 Thread Andrew Haley
Zachary Turner wrote: > Hello, I've been trying to write a program that links to static > libraries, and I've been having a lot of difficulties. Was wondering > if someone can help me identify what's going wrong. > > The codebase is large, but is new to linux. It was originally > developed on wi

Re: Problem with static linking

2009-07-15 Thread Ian Lance Taylor
Zachary Turner writes: > The codebase is large, but is new to linux. It was originally > developed on windows and then ported to linux. It makes heavy use of > C++, STL, and boost and we'd like to (if possible) link *everything* > statically. This means libc, libgcc, libstdc++, boost, libpthre

Problem with static linking

2009-07-15 Thread Zachary Turner
Hello, I've been trying to write a program that links to static libraries, and I've been having a lot of difficulties. Was wondering if someone can help me identify what's going wrong. The codebase is large, but is new to linux. It was originally developed on windows and then ported to linux. I