[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: protobuf*



it looks like protobuf is not properly built, because there are
pthread_* symbols references in its .so, but there's no NEEDED entry for
libpthread. At least when trying to configure protobuf-c, linking fails,
and when trying to link a stupid program (e.g. int main(void) { return
0;) against libprotobuf, one has to use -lpthread -lprotobuf,
-lprotobuf being insufficient. I *think* protobuf is at fault here, but
I'd like some input before reporting the bug there.


The libprotobuf.so.4.0.0 should be linked against libpthread.so due to -pthread flag. Maybe bug of libtool or rest of the toolchain.

It looks like long standing bug in the libtool [1]:

#468555 libtool: linking with g++ uses -nostdlib and does not add -lpthread or -lgcc

In [2]:
****************************
The docs say:
No startup files and only the libraries you specify will be passed to the
linker.

So this is not a GCC bug as it says only the libraries you specify will be
passed to the linker, and -pthread is not you specifing a library.
****************************

Petr

[1] http://bugs.debian.org//cgi-bin/bugreport.cgi?bug=468555
[2] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460


Reply to: