g++ -g -O2 -L/usr/lib -o protoxs perlxs_generator.o perlxs_helpers.o main.o -lprotoc -lprotobuf
/usr/lib/libprotobuf.so: undefined reference to `pthread_once'
Applies to at least 2.1.0 as well
libprotobuf.lafor 2.3.0 (just committed) contains -lpthread.
Is this version stable too, or are we supposed to just tolerate the older versions being broken until it is? (the two protobuf-dependent things I have tried to build fail because of this)
All versions of protobuf are marked as ~arch, so yes, you need to use 2.3.0.
Also you can add -lpthread on your own to link line, like:
g++ -g -O2 -L/usr/lib -o protoxs perlxs_generator.o perlxs_helpers.o main.o -lprotoc -lprotobuf -lpthread
2.1.0 really should be fixed or removed...
Furthermore, even 2.3.0 is still broken.
Please define "broken" - you get errors while trying to merge something, compile on your own?
I define "broken" as not complying with the relevant specifications, in this case the ELF format. A symptom of this brokenness is that non-threaded applications using libprotobuf will fail to link, including autoconf tests.
To test: ldd /usr/lib/libprotobuf.so | grep pthread || echo BROKEN
ELF file format has exactly nothing to do with what you're suggesting here.
Your problem seems to be coming from misunderstanding how programs/libraries depend on each other. There are some possibilities:
* use pkg-config to find paths and libraries (and in fact this is the thing that you should do for any package/library that installs pkg-config file)
* use -lpthread on your command line
If you still feel that there's a problem with protobuf's Makefile (linking actually) please report this upstream.
Please review section 5-19 of the ELF specification: http://www.sco.com/developers/devspecs/gabi41.pdf
For reference, the upstream bug is http://code.google.com/p/protobuf/issues/detail?id=103
Luke: please don't reopen this bug. If you feel so strong about this problem please create a new issue at http://code.google.com/p/protobuf/issues/list