goo/GooMutex.h includes <pthread.h> and defines pthread_mutex_* aliases which are used in poppler. Those become undefined references on platforms which do not include libpthread in libc: g++ -Wall -Wno-unused -g -Wall -O2 -o .libs/pdffonts pdffonts.o parseargs.o ../poppler/.libs/libpoppler.so -lfontconfig /usr/lib/libjpeg.so /usr/lib/libfreetype.so -lz ../poppler/.libs/libpoppler.so: undefined reference to `pthread_mutex_unlock' collect2: ld returned 1 exit status make[3]: *** [pdffonts] Error 1 This is the case e.g. on GNU/Hurd, which has its own libpthread library outside of glibc currently. Adding -lpthread to libpoppler_la_LDFLAGS in poppler/Makefile.am makes poppler build fine on these platforms. I am not sure whether this might have negative side-effects (all programs using libpoppler getting -lpthread as well, maybe?), so there might be a better fix.
Created attachment 7840 [details] [review] proposed patch
does adding -pthread to gcc CXXFLAGS works also for you?
(In reply to comment #2) > does adding -pthread to gcc CXXFLAGS works also for you? Yes, that makes it build fine as well, though I am not sure adding it always is desired, but I am not sure about the implications.
On some systems (like OSF), adding -pthread in compiler flags is needed as soon as you include pthread.h. So this is needed whenever you include GooMutex.h.
What's the status of this? Did it get fixed in the meantime? Michael
It doesn't look to be fixed. Only the Qt3 bindings have anything that I can see related to pthread. The original patch can't go in as-is though (because it will break on anything that doesn't have a libpthread). Could you possibly have a look at the m4/qt4.m4 code, and try to come up with an equivalent test? It should try to compile some problematic code, and only add -lpthread if it breaks.
3 years and no answer to Brad questions so i understand you guys are not interested in this anymore, closing it as wontfix. Reopen if you become interested again
I have to say I don't remember having seen Brad questions. Anyway, in the meantime goo stopped using aliases, and with the libpthread-stubs library, hurd now has pthread_mutex_* weak symbols which make poppler build, so it's actually fixed.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.