public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] sys-libs/db and dll hell
@ 2010-08-31 16:27 Eray Aslan
  2010-08-31 21:05 ` Robin H. Johnson
  0 siblings, 1 reply; 3+ messages in thread
From: Eray Aslan @ 2010-08-31 16:27 UTC (permalink / raw
  To: gentoo-dev

Hi,

app-crypt/heimdal looks for db header files in db4/db.h db3/db.h db.h 
db_185.h - in that order - and links with ldb.  In Gentoo, we do not 
have a db4 directory but rather db3 db4.7 db4.8 db5.0 etc.

Consequently, when both sys-libs/db-3 and sys-libs/db-4 are present, 
heimdal links against libdb, which is a symlink against libdb-4.x, but 
uses headers from db-3.  Result is a segfault in heimdal - serves it 
right for mixing it up :) .

* I am guessing this is not the first time.  Any pointers on how to 
solve this gracefully?  inheriting db-use in ebuild and sedding works but
	- is ugly
	- there is a bunch of #ifdef db4/db.h's in the source so sedding the 
configure script is not enough
	- this is a security related package so I try to refrain from patching
* I can submit upstream a proper patch that will make the code look at 
db.h first and db4/db.h db3/db.h later.  Is there a (unwritten?) rule 
that says look at db.h first? Any links?
* All linuxes I checked work correctly if the code looks at db.h first. 
  What's the case in *BSD, Solaris, etc?  Is Linux a special case in 
this regard?

Thanks
-- 
Eray



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] sys-libs/db and dll hell
  2010-08-31 16:27 [gentoo-dev] sys-libs/db and dll hell Eray Aslan
@ 2010-08-31 21:05 ` Robin H. Johnson
  2010-09-06  5:29   ` Eray Aslan
  0 siblings, 1 reply; 3+ messages in thread
From: Robin H. Johnson @ 2010-08-31 21:05 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2074 bytes --]

On Tue, Aug 31, 2010 at 07:27:57PM +0300, Eray Aslan wrote:
> app-crypt/heimdal looks for db header files in db4/db.h db3/db.h db.h 
> db_185.h - in that order - and links with ldb.  In Gentoo, we do not 
> have a db4 directory but rather db3 db4.7 db4.8 db5.0 etc.
And the reason we don't have it, nor a symlink for it, is that if you
build against db4.7 and then upgrade the backing library to db4.8, some
bad things have happened in the past.

> Consequently, when both sys-libs/db-3 and sys-libs/db-4 are present, 
> heimdal links against libdb, which is a symlink against libdb-4.x, but 
> uses headers from db-3.  Result is a segfault in heimdal - serves it 
> right for mixing it up :) .
Same problem can happen within db4 version per above.

> * I am guessing this is not the first time.  Any pointers on how to 
> solve this gracefully?  inheriting db-use in ebuild and sedding works but
> 	- is ugly
> 	- there is a bunch of #ifdef db4/db.h's in the source so sedding the 
> configure script is not enough
> 	- this is a security related package so I try to refrain from patching
> * I can submit upstream a proper patch that will make the code look at 
> db.h first and db4/db.h db3/db.h later.  Is there a (unwritten?) rule 
> that says look at db.h first? Any links?
It should iterate supported versions of DB, from highest to lowest.
db.h should come at the end because it may be part of db-1.85.

Unfortunately there isn't really any graceful fix. The buildsystem needs
to be patched, ideally to allow explicit passing of the DB include
directory and file to link. DB_VERSION_MAJOR/DB_VERSION_MINOR are the
best defines to check, they will work from db3 onwards.

db-use was intended to help packages where can specify the include dir
and library directly. heimdel will need patching becase of those ifdefs,
but that's the price for supporting

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail     : robbat2@gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85

[-- Attachment #2: Type: application/pgp-signature, Size: 330 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] sys-libs/db and dll hell
  2010-08-31 21:05 ` Robin H. Johnson
@ 2010-09-06  5:29   ` Eray Aslan
  0 siblings, 0 replies; 3+ messages in thread
From: Eray Aslan @ 2010-09-06  5:29 UTC (permalink / raw
  To: gentoo-dev

On 01.09.2010 00:05, Robin H. Johnson wrote:
> Unfortunately there isn't really any graceful fix. The buildsystem needs
> to be patched, ideally to allow explicit passing of the DB include
> directory

Patch for the above accepted by upstream [1].  So, all is good.  Nice to
have a responsive upstream.

Thanks for the pointers.
-- 
Eray

[1]
http://github.com/heimdal/heimdal/commit/a1c14b231996ebd72de69df1de472f08e82c2288



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-09-06  5:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-31 16:27 [gentoo-dev] sys-libs/db and dll hell Eray Aslan
2010-08-31 21:05 ` Robin H. Johnson
2010-09-06  5:29   ` Eray Aslan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox