Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189817 - net-nds/openldap-2.3.37 --as-needed bug with pthread and libldap_r
Summary: net-nds/openldap-2.3.37 --as-needed bug with pthread and libldap_r
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo LDAP project
: 275739 (view as bug list)
Depends on:
Blocks: as-needed
  Show dependency tree
Reported: 2007-08-22 10:40 UTC by Rafał Mużyło
Modified: 2009-08-18 07:29 UTC (History)
1 user (show)

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

fixes some pthread symbols (all for (openldap-2.3.37-as-needed.patch,862 bytes, patch)
2007-10-27 16:34 UTC, Rafał Mużyło
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafał Mużyło 2007-08-22 10:40:05 UTC
OK, this one is a bit tricky. It seems to emerge fine, however result of
ldd -r /usr/lib/ is:
undefined symbol: pthread_create	(/usr/lib/
undefined symbol: pthread_setconcurrency	(/usr/lib/
undefined symbol: pthread_kill	(/usr/lib/
undefined symbol: pthread_attr_setstacksize	(/usr/lib/
undefined symbol: pthread_mutex_trylock	(/usr/lib/
undefined symbol: pthread_join	(/usr/lib/
undefined symbol: pthread_getconcurrency	(/usr/lib/

As openldap does not use automake, I've yet to figure out where it should be fixed.
BTW, is there some easy way to check all of the system libraries for this (undefined symbol) issue ?
Comment 1 Markus Ullmann (RETIRED) gentoo-dev 2007-08-22 11:04:09 UTC
Hrm whole system is as-needed here and no such bug, though looks like some dependent lib doesn't get the dep to pthread right
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2007-08-22 11:08:37 UTC
Libraries are allowed to have undefined symbols and they commonly have them undefined. -lpthread should be used when linking of executables against There is no bug in OpenLDAP.
Comment 3 Rafał Mużyło 2007-08-22 12:47:11 UTC
Did some some digging and I'm thinking the whole situation is FUBAR. seems to be easy to fix, however there are a lot more issues.
The worst I found till now is following:
backend_connection_init is a symbol of slapd, however uses this symbol and is a dependancy of slapd, so we get a circular dependency.

And I think comment #2 is wrong. pthread should be linked to, if only for the effect of having it mentioned in
Comment 4 Rafał Mużyło 2007-10-27 16:32:19 UTC
I was wrong the first time - it's NOT an --as-needed bug, it's a "developer's choice" bug.
Now that I've done some googling, it seems that this is something that was noticed by both debian and fedora and fixed there (if only for pthread symbols) in the same way I fixed it for myself. Below I attach the patch that fixes undefined pthread symbols that I use (as far as I know debian and fedora use almost the same).
Comment 5 Rafał Mużyło 2007-10-27 16:34:17 UTC
Created attachment 134495 [details, diff]
fixes some pthread symbols (all for
Comment 6 Rafał Mużyło 2007-10-27 16:42:52 UTC
One more thing, I don't know if I'm actually using openldap, I noticed this problem while building wine. It was failing to detect ldap because of those unresolved symbols ( it was checking for using standard configure lib check).
Comment 7 Rafał Mużyło 2008-07-26 20:21:24 UTC
OK, as some of the as needed bugs had been given more attention lately,
I'm raising this issue again.
While some of my claims here are invalid, the pthread part is not.
If pthread is not linked into, it will cause problems
with any further linking and WILL cause the standard configure check
to fail.

Why does this part get rejected, while other distros accepted this as a bug ?
Comment 8 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2008-07-29 19:06:33 UTC
I'm withdrawing the second and third sentence in Comment #2.
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2008-10-14 09:18:29 UTC
Fixed in 2.3.43-r1 and 2.4.11-r1.
Comment 10 SpanKY gentoo-dev 2009-07-20 15:38:56 UTC
*** Bug 275739 has been marked as a duplicate of this bug. ***
Comment 11 SpanKY gentoo-dev 2009-08-18 07:29:38 UTC
*** Bug 275739 has been marked as a duplicate of this bug. ***