[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] sys-libs/db and dll hell
From:       "Robin H. Johnson" <robbat2 () gentoo ! org>
Date:       2010-08-31 21:05:05
Message-ID: robbat2-20100831T205459-310891026Z () orbis-terrarum ! net
[Download RAW message or body]


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 #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic