Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 499462 - =media-libs/ilmbase-2.1.0 not linked to libpthread
Summary: =media-libs/ilmbase-2.1.0 not linked to libpthread
Status: RESOLVED DUPLICATE of bug 496810
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-27 16:16 UTC by Ștefan Talpalaru
Modified: 2014-01-28 04:13 UTC (History)
1 user (show)

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


Attachments
ilmbase-2.1.0-asneeded.patch (ilmbase-2.1.0-asneeded.patch,483 bytes, patch)
2014-01-27 16:17 UTC, Ștefan Talpalaru
Details | Diff
ilmbase-2.1.0.ebuild.diff (ilmbase-2.1.0.ebuild.diff,314 bytes, patch)
2014-01-27 16:18 UTC, Ștefan Talpalaru
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ștefan Talpalaru 2014-01-27 16:16:40 UTC
When trying to link media-libs/openexr-2.1.0 against media-libs/ilmbase-2.1.0, the following error messages appear:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/libIlmThread.so: undefined reference to `sem_init'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/libIlmThread.so: undefined reference to `sem_destroy'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/libIlmThread.so: undefined reference to `pthread_create'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/libIlmThread.so: undefined reference to `sem_post'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/libIlmThread.so: undefined reference to `sem_trywait'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/libIlmThread.so: undefined reference to `sem_getvalue'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/libIlmThread.so: undefined reference to `sem_wait'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../lib64/libIlmThread.so: undefined reference to `pthread_join'


Reproducible: Always
Comment 1 Ștefan Talpalaru 2014-01-27 16:17:31 UTC
Created attachment 368886 [details, diff]
ilmbase-2.1.0-asneeded.patch
Comment 2 Ștefan Talpalaru 2014-01-27 16:18:38 UTC
Created attachment 368888 [details, diff]
ilmbase-2.1.0.ebuild.diff

This patch, modeled after ilmbase-1.0.0-asneeded.patch, fixes the problem for me (~amd64).
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-01-27 17:20:07 UTC

*** This bug has been marked as a duplicate of bug 496810 ***
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2014-01-27 17:49:11 UTC
I have ilmbase-2.1.0 and it doesn't link against -lpthread either, and correctly so, because the pkg-config file has all the information required (and because compiler's -pthread includes the -lpthread functionality)

$ objdump -p /usr/lib64/libIlmThread.so |grep NEEDED
  NEEDED               libIex-2_1.so.11
  NEEDED               libstdc++.so.6
  NEEDED               libc.so.6
  NEEDED               libgcc_s.so.1

no needed entry

-pthread in pkg-config files:

$ pkg-config --libs IlmBase
-lImath -lHalf -lIex -lIexMath -lIlmThread -pthread 
$ pkg-config --cflags IlmBase
-pthread -I/usr/include/OpenEXR 

and during the compile of openexr:

using pkg-config to set ILMBASE_CXXFLAGS and ILMBASE_LDFLAGS:
    ILMBASE_CXXFLAGS = -pthread -I/usr/include/OpenEXR 
    ILMBASE_LDFLAGS = 
    ILMBASE_LIBS = -lImath -lHalf -lIex -lIexMath -lIlmThread -pthread 

so ILMBASE_LIBS includes -lpthread because it has -pthread
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2014-01-27 17:52:36 UTC
I meant the compile is succesful despite of no -lpthread linkage thanks to pkg-config. Any clue what's different in your system it doesn't work? Using libtool-2.4.2, binutils-2.24, gcc-4.8.x with non-gold compiler...

$ ld -v
GNU ld (GNU Binutils) 2.24

Just trying to make some sense to the patch which looks redudant to me. :/
Comment 6 Ștefan Talpalaru 2014-01-27 18:24:30 UTC
It was probably the linker in binutils-2.24-r1. After upgrading to binutils-2.24-r2 I no longer need this patch. The problem was triggered by ilmbase and openexr being emerged before the new binutils when doing an emerge -uDN @world .
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2014-01-28 04:13:35 UTC
(In reply to Stefan Talpalaru from comment #6)
> It was probably the linker in binutils-2.24-r1. After upgrading to
> binutils-2.24-r2 I no longer need this patch. The problem was triggered by
> ilmbase and openexr being emerged before the new binutils when doing an
> emerge -uDN @world .

oh. bug 497976 then...