Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 100723 - heimdal-0.7 doesn't build with sys-libs/db-4.2 and sys-libs/db-3 both installed
Summary: heimdal-0.7 doesn't build with sys-libs/db-4.2 and sys-libs/db-3 both installed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Kerberos Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-29 09:16 UTC by Stefaan De Roeck (RETIRED)
Modified: 2005-09-14 05:43 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefaan De Roeck (RETIRED) gentoo-dev 2005-07-29 09:16:07 UTC
On my machine, building heimdal-0.7 ends with this error message:

/bin/sh ../../libtool --mode=link i686-pc-linux-gnu-gcc  -Wall
-Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations
-Wnested-externs -O3 -march=pentium4 -fomit-frame-pointer -pipe
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE   -o convert_db  convert_db.o
libhdb.la  ../krb5/libkrb5.la ../asn1/libasn1.la -L/usr/athena/lib -lcrypto
../../lib/vers/libvers.la ../../lib/roken/libroken.la -lcrypt   -lresolv -pthread
i686-pc-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wbad-function-cast -Wmissing-declarations -Wnested-externs -O3 -march=pentium4
-fomit-frame-pointer -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o
.libs/convert_db convert_db.o -pthread  ./.libs/libhdb.so
/var/tmp/portage/heimdal-0.7/work/heimdal-0.7/lib/krb5/.libs/libkrb5.so
-L/usr/athena/lib ../krb5/.libs/libkrb5.so
/var/tmp/portage/heimdal-0.7/work/heimdal-0.7/lib/asn1/.libs/libasn1.so
/var/tmp/portage/heimdal-0.7/work/heimdal-0.7/lib/roken/.libs/libroken.so -ldl
../asn1/.libs/libasn1.so /usr/athena/lib/libcom_err.a -lcrypto
../../lib/vers/.libs/libvers.a ../../lib/roken/.libs/libroken.so -ldb -lcrypt
-lresolv
./.libs/libhdb.so: undefined reference to `db_create'
collect2: ld returned 1 exit status
make[1]: *** [convert_db] Error 1
make[1]: Leaving directory `/var/tmp/portage/heimdal-0.7/work/heimdal-0.7/lib/hdb'
make: *** [all] Error 2

it seems db3.o (inside libhdb.so) requires the symbol db_create.  db3.c seems to
do an inaccurate check if it can include db4/db.h (there are other names for the
db includes of 4.x), and then chooses to include db3/db.h.  Whereas on machines
that don't have db3, it would fall back to db.h, which is again a link to
db4.2/db.h.  If the latter is included, the #define db_create db_create_4002 or
so would have been used, hence the unresolved symbol doesn't show up.  I think :)

sderoeck@olympia ~ $ equery l sys-libs/db
[ Searching for package 'db' in 'sys-libs' among: ]
 * installed packages
[I--] [  ] sys-libs/db-4.2.52_p2 (4.2)
[I--] [  ] sys-libs/db-1.85-r2 (1)
[I--] [  ] sys-libs/db-4.1.25_p1-r4 (4.1)
[I--] [  ] sys-libs/db-3.2.9-r10 (3)
Comment 1 Stefaan De Roeck (RETIRED) gentoo-dev 2005-07-30 10:16:13 UTC
It seems to me that heimdal links with -ldb, unconditionally (this is, not
depending on what versions of include files it found).  Therefore, I would
expect it to include /usr/include/db.h, as I assume db.h and libdb.so point to
(possibly by softlinks) to files of the same db-version.

In the same reasoning, if you would allow some kind of detection of the best
suited db-version available, it would not be done at compile-time (as in gcc
-c), but at configure time, because then a suitable libdb-x.so + dbx/db.h
combination could be detected.  

As gentoo seems to take care that a link points to the latest version installed,
I would go for the option in the first paragraph.
Comment 2 Martin Mokrejš 2005-08-22 12:30:46 UTC
If I remember right, heimdal does not support db-4.2, only 4.1 (or even up to
4.0, am not sure now). Please check the email lists, it was mentioned there. I'm
sure.
Comment 3 Stefaan De Roeck (RETIRED) gentoo-dev 2005-09-05 03:19:46 UTC
Martin, could you point us to the e-mail you're referring to?  It seems to me
the heimdal-discuss archive is not very search friendly, and they may not like
it if I wget -r their whole html-frontend for the list.
Comment 5 Stefaan De Roeck (RETIRED) gentoo-dev 2005-09-14 05:43:21 UTC
Fixed in heimdal-0.7-r1.  

Many thanks to robbat2 for helping me on this one.  Fix now consists of only
using /usr/include/db.h and /usr/lib/libdb.so, so we're guaranteed to use the
same version of includes/libraries, and detecting more specific version
properties using these files.