Re: weak symbols

2015-04-08 Thread Philip Guenther
On Tue, 7 Apr 2015, Martijn van Duren wrote: I'm currently experimenting with weak symbols for a library that I want to be thread safe without hard linking in the entire libpthread. To test this I've set up the following code: ... When compiling with pthread it seems it only resolves

Re: weak symbols

2015-04-08 Thread Martijn van Duren
On 04/08/15 08:10, Philip Guenther wrote: On Tue, 7 Apr 2015, Martijn van Duren wrote: I'm currently experimenting with weak symbols for a library that I want to be thread safe without hard linking in the entire libpthread. To test this I've set up the following code: ... When compiling

Re: weak symbols

2015-04-08 Thread Ted Unangst
Martijn van Duren wrote: Could you inform me on the preferred way for making a library thread safe? - always linking in lpthread into the library (which causes some extra bloat in the loading of the extra library). - making the required symbols available via weak symbols, as per my original

weak symbols

2015-04-07 Thread Martijn van Duren
Hello misc@, I'm currently experimenting with weak symbols for a library that I want to be thread safe without hard linking in the entire libpthread. To test this I've set up the following code: #include fcntl.h #include stdio.h #include errno.h #include pthread.h #include unistd.h