Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 720994 - media-gfx/iscan-3.62.0 : ../.../libutsushi.so: error: undefined reference to pthread_create
Summary: media-gfx/iscan-3.62.0 : ../.../libutsushi.so: error: undefined reference to ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Marcin Deranek
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-05-04 20:23 UTC by Toralf Förster
Modified: 2020-07-16 14:38 UTC (History)
2 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,14.86 KB, text/plain)
2020-05-04 20:23 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,58.86 KB, text/plain)
2020-05-04 20:23 UTC, Toralf Förster
Details
environment (environment,93.42 KB, text/plain)
2020-05-04 20:23 UTC, Toralf Förster
Details
etc.portage.tbz2 (etc.portage.tbz2,10.64 KB, application/x-bzip)
2020-05-04 20:23 UTC, Toralf Förster
Details
logs.tbz2 (logs.tbz2,15.13 KB, application/x-bzip)
2020-05-04 20:23 UTC, Toralf Förster
Details
media-gfx:iscan-3.62.0:20200504-193947.log (media-gfx:iscan-3.62.0:20200504-193947.log,104.01 KB, text/plain)
2020-05-04 20:23 UTC, Toralf Förster
Details
temp.tbz2 (temp.tbz2,32.25 KB, application/x-bzip)
2020-05-04 20:23 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2020-05-04 20:23:18 UTC
libtool: link: x86_64-pc-linux-gnu-g++ -Wall -O2 -pipe -march=native -falign-functions=32:25:16 -fno-common -Wl,-O1 -Wl,--defsym=__gentoo_check_ldflags__=0 -o .libs/verify verify-verify.o verify-verify-compound-protocol.o verify-verify-compound-scanning.o  -L/usr/lib64 -Wl,--as-needed -Wl,--no-as-needed ./.libs/libdrv-esci.so ../../lib/.libs/libutsushi.so -lboost_unit_test_framework-mt ../../connexions/.libs/libcnx-usb.so -lusb-1.0 ../../connexions/.libs/libcnx-hexdump.so /var/tmp/portage/media-gfx/iscan-3.62.0/work/utsushi-0.62.0/lib/.libs/libutsushi.so -lboost_filesystem -lboost_system -lboost_program_options-mt //usr/lib64/libltdl.so -ldl -ludev -ltiff -Wl,-rpath -Wl,/usr/lib64/utsushi
../../lib/.libs/libutsushi.so: error: undefined reference to pthread_create
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:836: verify] Error 1
make[3]: Leaving directory /var/tmp/portage/media-gfx/iscan-3.62.0/work/utsushi-0.62.0/drivers/esci

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_hardened-abi32+64-20200503-182741

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-9.3.0 *
Available Python interpreters, in order of preference:
  [1]   python3.7 (uninstalled)
  [2]   python3.6
  [3]   python3.8 (fallback)
  [4]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby24 (with Rubygems)
  [2]   ruby25 (with Rubygems) *
The Glorious Glasgow Haskell Compilation System, version 8.0.2

  timestamp(s) of HEAD at this tinderbox image:
/var/db/repos/gentoo	Mon 04 May 2020 06:38:56 PM UTC

emerge -qpvO media-gfx/iscan
[ebuild  N    ] media-gfx/iscan-3.62.0  USE="-graphicsmagick -gui"
Comment 1 Toralf Förster gentoo-dev 2020-05-04 20:23:20 UTC
Created attachment 636078 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2020-05-04 20:23:23 UTC
Created attachment 636080 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2020-05-04 20:23:26 UTC
Created attachment 636082 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2020-05-04 20:23:28 UTC
Created attachment 636084 [details]
etc.portage.tbz2
Comment 5 Toralf Förster gentoo-dev 2020-05-04 20:23:31 UTC
Created attachment 636086 [details]
logs.tbz2
Comment 6 Toralf Förster gentoo-dev 2020-05-04 20:23:34 UTC
Created attachment 636088 [details]
media-gfx:iscan-3.62.0:20200504-193947.log
Comment 7 Toralf Förster gentoo-dev 2020-05-04 20:23:36 UTC
Created attachment 636090 [details]
temp.tbz2
Comment 8 Marcin Deranek 2020-05-05 17:15:02 UTC
I narrowed it to gold linker. Building iscan with bfd works just fine.

Surprisingly library in question is linked with libpthread:

/var/tmp/portage/media-gfx/iscan-3.62.0/work/utsushi-0.62.0/drivers/esci # x86_64-pc-linux-gnu-g++ -Wall -O2 -pipe -march=native -falign-functions=32:25:16 -fno-common -Wl,-O1 -Wl,--defsym=__gentoo_check_ldflags__=0 -o .libs/verify verify-verify.o verify-verify-compound-protocol.o verify-verify-compound-scanning.o  -L/usr/lib64 -Wl,--as-needed -Wl,--no-as-needed ./.libs/libdrv-esci.so ../../lib/.libs/libutsushi.so -lboost_unit_test_framework-mt ../../connexions/.libs/libcnx-usb.so -lusb-1.0 ../../connexions/.libs/libcnx-hexdump.so /var/tmp/portage/media-gfx/iscan-3.62.0/work/utsushi-0.62.0/lib/.libs/libutsushi.so -lboost_filesystem -lboost_system -lboost_program_options-mt //usr/lib64/libltdl.so -ldl -ludev -ltiff -Wl,-rpath -Wl,/usr/lib64/utsushi
../../lib/.libs/libutsushi.so: error: undefined reference to 'pthread_create'
collect2: error: ld returned 1 exit status

/var/tmp/portage/media-gfx/iscan-3.62.0/work/utsushi-0.62.0/drivers/esci # ldd ../../lib/.libs/libutsushi.so | fgrep pthread
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f7363748000)


Interestingly explicitly adding -lpthread/-pthread or removing -ltiff from command line makes the thing compile just fine. Switching to bfd linked (-fuse-ld=bfd) also works fine. Feels like bug in gold linker.
Comment 9 Larry the Git Cow gentoo-dev 2020-07-16 14:38:56 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72080b86d2e93f9d9ec984ad2df0bc456e8c4918

commit 72080b86d2e93f9d9ec984ad2df0bc456e8c4918
Author:     Marcin Deranek <marcin.deranek@booking.com>
AuthorDate: 2020-05-19 16:38:46 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-07-16 14:38:40 +0000

    media-gfx/iscan: Explicitly use pthreads so we can use gold linker
    
    Closes: https://bugs.gentoo.org/720994
    Signed-off-by: Marcin Deranek <marcin.deranek@slonko.net>
    Closes: https://github.com/gentoo/gentoo/pull/15879
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 media-gfx/iscan/iscan-3.62.0.ebuild | 2 ++
 1 file changed, 2 insertions(+)