# bind-9.8.1_p1 compile fails (dlz related) [SOLVED]

## hanj

Hello All

Having trouble compiling bind-9.8.1_p1. This is the point that it fails:

```
dlopen_driver.o  -Wl,--as-needed ../../lib/lwres/.libs/liblwres.so ../../lib/dns/.libs/libdns.so ../../lib/bind9/.libs/libbind9.so /var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/lib/isccfg/.libs/libisccfg.so ../../lib/isccfg/.libs/libisccfg.so /var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/lib/dns/.libs/libdns.so /var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/lib/isccc/.libs/libisccc.so ../../lib/isccc/.libs/libisccc.so /var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/lib/isc/.libs/libisc.so ../../lib/isc/.libs/libisc.so -L/usr/lib/mysql /usr/lib/mysql/libmysqlclient.so -L/usr/lib/ -L/usr//lib -lnsl -lssl -lcrypto -lz -lcrypt -lm /usr/lib/libdb-4.2.so -lpthread -ldl  -Wl,-rpath -Wl,/usr/lib/mysql

.libs/dlz_bdb_driver.o: In function `bdb_opendb':

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:573: undefined reference to `db_create'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:574: undefined reference to `db_strerror'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:584: undefined reference to `db_strerror'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:595: undefined reference to `db_strerror'

.libs/dlz_bdb_driver.o: In function `bdb_create':

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:643: undefined reference to `db_env_create'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:645: undefined reference to `db_strerror'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:698: undefined reference to `db_strerror'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:660: undefined reference to `db_strerror'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdb_driver.c:710: undefined reference to `db_strerror'

.libs/dlz_bdbhpt_driver.o: In function `bdbhpt_opendb':

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdbhpt_driver.c:619: undefined reference to `db_create'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdbhpt_driver.c:620: undefined reference to `db_strerror'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdbhpt_driver.c:630: undefined reference to `db_strerror'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdbhpt_driver.c:641: undefined reference to `db_strerror'

.libs/dlz_bdbhpt_driver.o: In function `bdbhpt_create':

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdbhpt_driver.c:734: undefined reference to `db_env_create'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdbhpt_driver.c:736: undefined reference to `db_strerror'

/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named/../../contrib/dlz/drivers/dlz_bdbhpt_driver.c:749: undefined reference to `db_strerror'

collect2: ld returned 1 exit status

make[2]: *** [named] Error 1

make[2]: Leaving directory `/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin/named'

make[1]: *** [subdirs] Error 1

make[1]: Leaving directory `/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1/bin'

make: *** [subdirs] Error 1

 * ERROR: net-dns/bind-9.8.1_p1 failed (compile phase):

 *   emake failed

 *

 * If you need support, post the output of 'emerge --info =net-dns/bind-9.8.1_p1',

 * the complete build log and the output of 'emerge -pqv =net-dns/bind-9.8.1_p1'.

 * The complete build log is located at '/var/log/builds/net-dns:bind-9.8.1_p1:20120330-171106.log'.

 * The ebuild environment file is located at '/var/tmp/portage/net-dns/bind-9.8.1_p1/temp/environment'.

 * S: '/var/tmp/portage/net-dns/bind-9.8.1_p1/work/bind-9.8.1-P1'
```

Here are my USE flags for bind:

```
[ebuild     U  ] net-dns/bind-9.8.1_p1 [9.7.4_p1] USE="berkdb dlz* mysql ssl urandom -caps% -doc -geoip -gost% -gssapi -idn -ipv6 -ldap -odbc -pkcs11% -postgres -rpz% -sdb-ldap (-selinux) -threads -xml (-resolvconf%)" 0 kB
```

Here is my emerge --info output:

```
Portage 2.1.10.49 (hardened/linux/x86, gcc-4.3.4, glibc-2.13-r4, 3.0.4-hardened-r5 i686)

=================================================================

System uname: Linux-3.0.4-hardened-r5-i686-AMD_Sempron-tm-_2600+-with-gentoo-2.0.3

Timestamp of tree: Fri, 30 Mar 2012 09:00:01 +0000

app-shells/bash:          4.2_p20

dev-lang/python:          2.5.4-r4, 2.6.6-r2, 2.7.2-r3, 3.1.4-r3, 3.2.2

dev-util/cmake:           2.8.6-r4

dev-util/pkgconfig:       0.26

sys-apps/baselayout:      2.0.3

sys-apps/openrc:          0.9.8.4

sys-apps/sandbox:         2.5

sys-devel/autoconf:       2.13::<unknown repository>, 2.68

sys-devel/automake:       1.4_p6::<unknown repository>, 1.5::<unknown repository>, 1.6.3::<unknown repository>, 1.7.9-r1::<unknown repository>, 1.8.5-r3::<unknown repository>, 1.9.6-r2::<unknown repository>, 1.10.3, 1.11.1

sys-devel/binutils:       2.21.1-r1

sys-devel/gcc:            3.4.6-r2::<unknown repository>, 4.1.2::<unknown repository>, 4.3.4, 4.4.5, 4.5.3-r2

sys-devel/gcc-config:     1.5-r2

sys-devel/libtool:        2.4-r1

sys-devel/make:           3.82-r1

sys-kernel/linux-headers: 3.1 (virtual/os-headers)

sys-libs/glibc:           2.13-r4

Repositories: gentoo x-portage

ACCEPT_KEYWORDS="x86"

ACCEPT_LICENSE="* -@EULA"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=athlon-xp -O3 -pipe -ggdb"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"

CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"

CXXFLAGS="-march=i686 -O2 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"

FFLAGS=""

GENTOO_MIRRORS="http://distfiles.gentoo.org"

LDFLAGS="-Wl,-O1 -Wl,--as-needed"

LINGUAS="en"

PKGDIR="/usr/portage/packages"

PORTAGE_CONFIGROOT="/"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="\ apache2 berkdb bzip2 cli cracklib crypt cxx dri gdbm gpm hardened iconv innodb maildir modules mudflap mysql ncurses nptl nptlonly openmp openssh pam pax_kernel pcre php pic pppd pwdb readline sasl session snmp snortsam ssl sysfs tcpd urandom x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 intel mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa via vmware nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
```

Any ideas what could be the problem. Seems dlz related, but not sure where to go from here. I ran revdep, etc. Everything looks good.

Thanks!

hanji

----------

## hanj

Anyone?

----------

## Hu

You are using a very old sys-libs/db.  Does it work better if you use a newer version?

----------

## hanj

 *Hu wrote:*   

> You are using a very old sys-libs/db.  Does it work better if you use a newer version?

 

Thanks. I had the latest stable.. but I had a ton of old ones. I removed the old versions, revdep-rebuilt.. and all is good.

Thanks for the help!

hanji

----------

