Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 271509 - dev-libs/protobuf fails to build with --as-needed
Summary: dev-libs/protobuf fails to build with --as-needed
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Krzysztof Pawlik (RETIRED)
: 320933 (view as bug list)
Depends on:
Blocks: as-needed 319371
  Show dependency tree
Reported: 2009-05-28 10:54 UTC by David Sveningsson
Modified: 2013-06-18 09:13 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---

build.log (build.log,85.65 KB, text/plain)
2009-05-28 10:55 UTC, David Sveningsson
emerge --info (emerge_info,4.18 KB, text/plain)
2009-05-28 10:55 UTC, David Sveningsson
drizzle.log (drizzle.log,455.38 KB, text/plain)
2010-05-15 11:45 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
adding epatch and autotools (protobuf-2.3.0.diff,701 bytes, patch)
2010-05-15 12:01 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff
fixing as-needed issues (protobuf-2.3.0-asneeded.patch,1.20 KB, patch)
2010-05-15 12:02 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff
fixing as-needed issues (protobuf-2.3.0-asneeded.patch,705 bytes, patch)
2010-05-22 09:33 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Sveningsson 2009-05-28 10:54:40 UTC
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/ ./.libs/ /var/tmp/portage/dev-libs/protobuf-2.1.0/work/protobuf-2.1.0/src/.libs/ -lz -pthread
./.libs/ 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:
 *     , line   49:  Called src_compile
 *             environment, line 4434:  Called die
 * The specific snippet of code:
 *       emake || die;
 *  The die message:
 *   (no error message)
Comment 1 David Sveningsson 2009-05-28 10:55:10 UTC
Created attachment 192694 [details]
Comment 2 David Sveningsson 2009-05-28 10:55:42 UTC
Created attachment 192695 [details]
emerge --info
Comment 3 Sebastian Luther (few) 2009-05-28 11:22:52 UTC
Does it work with default LDFLAGS?
Comment 4 David Sveningsson 2009-05-28 11:57:49 UTC
(In reply to comment #3)
> Does it work with default LDFLAGS?

Indeed it does, I forgot I had --as-needed in LDFLAGS.
Comment 5 Holger Hoffstätte 2009-08-16 10:56:29 UTC
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
Comment 6 Michal Januszewski (RETIRED) gentoo-dev 2009-09-26 10:49:06 UTC
Same here on amd64 with 2.2.0.  Please reopen if you have any hints about how to reproduce it with 2.2.0.
Comment 7 Simon Arlott 2010-01-26 22:16:35 UTC
This still affects 2.2.0a.

./.libs/ 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.
Comment 8 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-05-15 11:44:25 UTC
Portage (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"
CFLAGS="-O2 -pipe"
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"
FEATURES="buildpkg collision-protect distlocks multilib-strict news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
LINGUAS="en pl"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/usr/portage/local/myoverlay /usr/portage/local/hdf5"
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"
Comment 9 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-05-15 11:45:14 UTC
Created attachment 231543 [details]

It's not fixed.
Comment 10 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-05-15 12:01:36 UTC
Created attachment 231547 [details, diff]
adding epatch and autotools
Comment 11 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-05-15 12:02:05 UTC
Created attachment 231551 [details, diff]
fixing as-needed issues
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2010-05-15 12:15:52 UTC
+  15 May 2010; Samuli Suominen <> protobuf-2.3.0.ebuild,
+  +files/protobuf-2.3.0-asneeded.patch:
+  Fix building with -Wl,--as-needed wrt #271509 by Kacper Kowalik.
Comment 13 Krzysztof Pawlik (RETIRED) gentoo-dev 2010-05-15 12:35:14 UTC
Have you reported this to upstream too?
Comment 14 Samuli Suominen (RETIRED) gentoo-dev 2010-05-15 12:39:19 UTC
Comment 15 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-05-21 20:29:04 UTC
*** Bug 320933 has been marked as a duplicate of this bug. ***
Comment 16 Samuli Suominen (RETIRED) gentoo-dev 2010-05-21 21:37:56 UTC
reopening, the current patch isn't enough (see also the upstream ticket)
Comment 17 Michal Januszewski (RETIRED) gentoo-dev 2010-05-21 21:57:19 UTC
Reassigning as I no longer maintain protobuf.
Comment 18 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-05-22 09:33:41 UTC
Created attachment 232441 [details, diff]
fixing as-needed issues

It was actual trivial bug in acx_threads, should be fine now.
Comment 19 Tiziano Müller (RETIRED) gentoo-dev 2010-06-12 07:03:57 UTC
ok, fixed in -r1, together with the addition of static-libs USE flag.
Comment 20 Fabian Groffen gentoo-dev 2013-06-15 11:17:01 UTC
breaks darwin, #472514
Comment 21 Tiziano Müller (RETIRED) gentoo-dev 2013-06-18 09:13:00 UTC
ok, the real proper fix for this would be:

a) make a patch for the maintained ax_pthread.m4 at 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