Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 514008 - =media-libs/libdc1394-2.2.1: error: undefined reference to 'pthread_join'
Summary: =media-libs/libdc1394-2.2.1: error: undefined reference to 'pthread_join'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: underlinking
  Show dependency tree
 
Reported: 2014-06-20 12:52 UTC by Samuli Suominen (RETIRED)
Modified: 2014-06-20 12:55 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuli Suominen (RETIRED) gentoo-dev 2014-06-20 12:52:10 UTC
Making all in examples
make[2]: Entering directory '/var/tmp/portage/media-libs/libdc1394-2.2.1/work/libdc1394-2.2.1-abi_x86_64.amd64/examples'
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/libdc1394-2.2.1/work/libdc1394-2.2.1/examples -I..  -I/var/tmp/portage/media-libs/libdc1394-2.2.1/work/libdc1394-2.2.1   -Wall -Wunused -std=gnu99 -O2 -pipe -march=native -frecord-gcc-switches -Wimplicit-function-declaration -c -o dc1394_reset_bus.o /var/tmp/portage/media-libs/libdc1394-2.2.1/work/libdc1394-2.2.1/examples/dc1394_reset_bus.c
/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc  -Wall -Wunused -std=gnu99 -O2 -pipe -march=native -frecord-gcc-switches -Wimplicit-function-declaration  -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o dc1394_reset_bus dc1394_reset_bus.o ../dc1394/libdc1394.la -lm 
libtool: link: x86_64-pc-linux-gnu-gcc -Wall -Wunused -std=gnu99 -O2 -pipe -march=native -frecord-gcc-switches -Wimplicit-function-declaration -Wl,-O1 -Wl,--hash-style=gnu -o .libs/dc1394_reset_bus dc1394_reset_bus.o  -Wl,--as-needed ../dc1394/.libs/libdc1394.so -lraw1394 -lusb-1.0 -lm
../dc1394/.libs/libdc1394.so: error: undefined reference to 'pthread_join'
../dc1394/.libs/libdc1394.so: error: undefined reference to 'pthread_create'
collect2: error: ld returned 1 exit status
Makefile:585: recipe for target 'dc1394_reset_bus' failed
make[2]: *** [dc1394_reset_bus] Error 1
make[2]: Leaving directory '/var/tmp/portage/media-libs/libdc1394-2.2.1/work/libdc1394-2.2.1-abi_x86_64.amd64/examples'
Makefile:592: recipe for target 'all-recursive' failed
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2014-06-20 12:52:51 UTC
capture.c in dc1394/usb/ directory is using pthread, but never links to it

--- libdc1394-2.2.1.orig/dc1394/usb/Makefile.am	2013-01-28 04:43:18.000000000 +0200
+++ libdc1394-2.2.1/dc1394/usb/Makefile.am	2014-06-20 15:44:07.852505248 +0300
@@ -8,7 +8,7 @@
 endif
 
 AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/dc1394 $(LIBUSB_CFLAGS)
-libdc1394_usb_la_LIBADD = $(LIBUSB_LIBS)
+libdc1394_usb_la_LIBADD = $(LIBUSB_LIBS) -lpthread
 libdc1394_usb_la_SOURCES =  \
 	control.c \
 	usb.h \
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2014-06-20 12:54:17 UTC
patch added to tree
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2014-06-20 12:55:46 UTC
for reference, this was with binutils's ld.gold, not ld.bfd, and using libusb-1.0.19 (which doesn't return -lpthread with pkg-config and --libs)