libtool: link: x86_64-pc-linux-gnu-g++ -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -march=native -Os -pipe -msse3 -g -ggdb -pthread -Wl,--as-needed -o .libs/protoc main.o ./.libs/libprotobuf.so ./.libs/libprotoc.so /var/tmp/portage/dev-libs/protobuf-2.1.0/work/protobuf-2.1.0/src/.libs/libprotobuf.so -lz -pthread ./.libs/libprotobuf.so: undefined reference to `pthread_once' collect2: ld returned 1 exit status make[2]: *** [protoc] Fel 1 make[2]: Leaving directory `/var/tmp/portage/dev-libs/protobuf-2.1.0/work/protobuf-2.1.0/src' make[1]: *** [all-recursive] Fel 1 make[1]: Leaving directory `/var/tmp/portage/dev-libs/protobuf-2.1.0/work/protobuf-2.1.0' make: *** [all] Fel 2 * * ERROR: dev-libs/protobuf-2.1.0 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 4434: Called die * The specific snippet of code: * emake || die; * The die message: * (no error message)
Created attachment 192694 [details] build.log
Created attachment 192695 [details] emerge --info
Does it work with default LDFLAGS?
(In reply to comment #3) > Does it work with default LDFLAGS? > Indeed it does, I forgot I had --as-needed in LDFLAGS.
Not sure what I'm doing wrong :) but --as-needed gave me no trouble for protobuf 2.1.0 on x86. $cat /var/db/pkg/dev-libs/protobuf-2.1.0/LDFLAGS -Wl,-O1,--as-needed,-z,now
Same here on amd64 with 2.2.0. Please reopen if you have any hints about how to reproduce it with 2.2.0.
This still affects 2.2.0a. ./.libs/libprotobuf.so isn't being compiled with -lpthread, even with the latest gcc (4.4.2) According to the man-page for gcc, "-pthread" is not supported for i386/x86_64 (i.e. it has no effect), so -lpthread should have been specified by libtool. Even the latest libtool (2.2.6b) does this wrong too.
Portage 2.1.8.3 (default/linux/amd64/10.0/developer, gcc-4.5.0-asneeded, glibc-2.11-r1, 2.6.31-gentoo-r10 x86_64) ================================================================= System uname: Linux-2.6.31-gentoo-r10-x86_64-Intel-R-_Core-TM-_i7_CPU_920_@_2.67GHz-with-gentoo-2.0.1 Timestamp of tree: Sat, 15 May 2010 01:00:01 +0000 app-shells/bash: 4.1_p2-r1 dev-lang/python: 2.6.5-r1 dev-util/cmake: 2.8.1-r1 sys-apps/baselayout: 2.0.1 sys-apps/openrc: 0.6.1-r1 sys-apps/sandbox: 2.2 sys-devel/autoconf: 2.65 sys-devel/automake: 1.11.1 sys-devel/binutils: 2.20.1 sys-devel/gcc: 4.5.0 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.6b virtual/os-headers: 2.6.33 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="buildpkg collision-protect distlocks multilib-strict news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox" GENTOO_MIRRORS="http://gentoo.zie.pg.gda.pl http://gentoo.po.opole.pl ftp://gentoo.po.opole.pl http://gentoo.mirror.pw.edu.pl/ " LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LDFLAGS="-Wl,--as-needed,--hash-style=gnu,-O1" LINGUAS="en pl" MAKEOPTS="-j8" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local/myoverlay /usr/portage/local/hdf5" SYNC="rsync://158.75.7.69/gentoo-portage" USE="X a52 aac acl acpi alsa amd64 apache2 berkdb bluetooth bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gpm gtk hal iconv ipv6 jpeg lcms libnotify mad mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib mysql ncurses nls nptl nptlonly ogg opengl openmp pam pango pcre pdf perl png ppds pppd python qt3support readline reflection sdl session snmp spell spl sse sse2 ssl startup-notification svg sysfs tcpd tiff truetype unicode usb vorbis x264 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en pl" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="vga" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Created attachment 231543 [details] drizzle.log It's not fixed.
Created attachment 231547 [details, diff] adding epatch and autotools
Created attachment 231551 [details, diff] fixing as-needed issues
+ 15 May 2010; Samuli Suominen <ssuominen@gentoo.org> protobuf-2.3.0.ebuild, + +files/protobuf-2.3.0-asneeded.patch: + Fix building with -Wl,--as-needed wrt #271509 by Kacper Kowalik.
Have you reported this to upstream too?
http://code.google.com/p/protobuf/issues/detail?id=188
*** Bug 320933 has been marked as a duplicate of this bug. ***
reopening, the current patch isn't enough (see also the upstream ticket)
Reassigning as I no longer maintain protobuf.
Created attachment 232441 [details, diff] fixing as-needed issues It was actual trivial bug in acx_threads, should be fine now.
ok, fixed in -r1, together with the addition of static-libs USE flag.
breaks darwin, #472514
ok, the real proper fix for this would be: a) make a patch for the maintained ax_pthread.m4 at http://git.savannah.gnu.org/cgit/autoconf-archive.git containing the changes made by protobuf devs (the part about detecting GCC inconsistencies) since this upstream already has sections for darwin b) have the protobuf devs change to use ax_pthread.m4 from a maintained source