Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 147585

Summary: dev-db/libpq-8.1.4 fails to build with 'threads' use flag
Product: Gentoo Linux Reporter: Maciej Grela <thermal>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: High    
Version: 2006.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Maciej Grela 2006-09-14 10:07:13 UTC
I`ve encountered a problem trying to emerge libpq-8.1.4 (from the experimental ~x86 branch).

# ACCEPT_KEYWORDS="~x86" emerge libpq

....

checking thread safety of required library functions... no
configure: error:
*** Thread test program failed.  Your platform is not thread-safe.
*** Check the file 'config.log'for the exact reason.
***
*** You can use the configure option --enable-thread-safety-force
*** to force threads to be enabled.  However, you must then run
*** the program in src/tools/thread and add locking function calls
*** to your applications to guarantee thread safety.


!!! ERROR: dev-db/libpq-8.1.4 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  libpq-8.1.4.ebuild, line 76:   Called die

In config.log we find:

configure:22534: checking thread safety of required library functions
configure:22562: i686-pc-linux-gnu-gcc -o conftest -O2 -mcpu=i686 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclar
`-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.
/var/tmp/portage/libpq-8.1.4/temp/ccICcp7q.o: In function `main':
conftest.c:(.text+0x112): undefined reference to `pthread_create'
conftest.c:(.text+0x12b): undefined reference to `pthread_create'
conftest.c:(.text+0x16d): undefined reference to `pthread_join'
conftest.c:(.text+0x17e): undefined reference to `pthread_join'
collect2: ld returned 1 exit status
configure:22565: $? = 1
configure: program exited with status 1
configure: failed program was:

It looks like the configure script doesn`t add -lpthread to the compiler invocation causing a link error. I`d try to fix it myself, but unfortunately my knowledge of autoconf is not sufficient.

my emerge --info:

newhope x86 # emerge --info
Portage 2.1.1 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r3, 2.6.16-gentoo-r9-newhope i686)
=================================================================
System uname: 2.6.16-gentoo-r9-newhope i686 AMD Athlon(tm) XP 1700+
Gentoo Base System version 1.12.5
Last Sync: Thu, 14 Sep 2006 13:30:06 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.3.5-r2, 2.4.3-r3
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -mcpu=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS=""
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer nodoc parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://gentoo.prz.rzeszow.pl http://gentoo.zie.pg.gda.pl"
LANG="pl_PL"
LC_ALL="pl_PL"
LINGUAS="en pl"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow 3dnowext X aalib acl acpi adns alsa apache2 bash-completion berkdb bitmap-fonts bluetooth bzip2 cairo caps cdr cli crypt cups curl dbus dedicated dio dlloader dmi dri dvd elibc_glibc embedded emboss encode esd exif ffmpeg fftw foomaticdb fortran ftp gd gdbm gif glitz glut gmp gnutls gpgme gpm gsm gtk gtk2 hal iconv idn imap input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 irda isdnlog jabber jack java javascript joystick jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kernel_linux ldap libcaca libg++ libwww linguas_en linguas_pl lm_sensors logrotate mad maildir matroska mikmod mime mmx mmxext motif mp3 mpeg mysql ncurses netboot nls nntp nptl nptlonly ogg openal opengl pam pcre perl png pop postgres pppd python qt qt3 quicktime readline real reflection rtc samba sasl sdl sensord session sharedmem slp smartcard smime snmp sockets socks5 sox speex spl sse ssl svg sysfs tcpd tetex theora threads threadstruetype tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU userlocales vcd video_cards_i810 video_cards_mach64 video_cards_nv video_cards_r128 video_cards_radeon video_cards_s3 video_cards_s3virge video_cards_savage video_cards_sis video_cards_tdfx video_cards_v4l video_cards_vesa video_cards_vga video_cards_via vorbis win32codecs xcomposite xine xinerama xinetd xml xml2 xmms xorg xv xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-14 10:22:51 UTC
> `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead.


*** This bug has been marked as a duplicate of 129727 ***