|
From: Tom H. <th...@cy...> - 2004-06-04 07:56:17
|
In message <Pin...@ye...>
Nicholas Nethercote <nj...@ca...> wrote:
> On Thu, 3 Jun 2004, Tom Hughes wrote:
>
>> The only thing I'm not sure about is statically linked programs
>> but I'm not sure you can statically link a multithreaded program.
>
> You can -- I just tried it. But Memcheck didn't like it, gave lots of
> uninitialised warnings and then bombed out with:
>
> ==29475== Valgrind detected that your program requires
> ==29475== the following unimplemented functionality:
> ==29475== clone(): not supported by Valgrind.
> We do now support programs linked against
> libpthread.so, though. Re-run with -v and ensure that
> you are picking up Valgrind's implementation of libpthread.so.
>
> I guess V's libpthread.so isn't overriding the statically linked system
> one.
Well it won't - if you're statically linked against libpthread then
the dynamic linker won't try and load the dynamic version because it
won't be listed as a dependency and all the calls to the functions in
it will have been resolved anyway.
I wasn't sure it would work even without valgrind because of the way
libpthread normally uses dynamic linker tricks to override functions
in the main C library but I guess there must be weak symbol tricks or
something to make it work in static links.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|