Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 113975

Summary: net-libs/courier-{authlib-0.57,imap} fail to link in bdbobj when USE=-gdbm
Product: Gentoo Linux Reporter: SpanKY <vapier>
Component: Current packagesAssignee: Net-Mail Packages <net-mail+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: andrei.ivanov, iggy, jsbronder, Martin.vGagern, mihailim, robbat2, rockoo, swtaylor, toffanin.mauro, zeth
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: courier-authlib.log
courier-authlib-0.57-bdbobj.tar.bz2
build.log from courier-imap-4.0.6-r2

Description SpanKY gentoo-dev 2005-11-29 20:14:22 UTC
looks like the autotool handling in the package is all screwed up ... the error only happens when USE=-gdbm

make[3]: Entering directory `/var/tmp/portage/courier-authlib-0.57-r1/work/courier-authlib-0.57/bdbobj'
Compiling bdbobj.c
Compiling bdbobj2.c
Compiling bdbobj3.c
Linking libbdbobj.la
Compiling testbdb.C
Linking testbdb
./.libs/libbdbobj.a(bdbobj.o): In function `.L11':
bdbobj.c:(.text+0xf6): undefined reference to `db_create'
collect2: ld returned 1 exit status
make[3]: *** [testbdb] Error 1
make[3]: Leaving directory `/var/tmp/portage/courier-authlib-0.57-r1/work/courier-authlib-0.57/bdbobj'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/courier-authlib-0.57-r1/work/courier-authlib-0.57/bdbobj'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/courier-authlib-0.57-r1/work/courier-authlib-0.57'
make: *** [all] Error 2

!!! ERROR: net-libs/courier-authlib-0.57-r1 failed.
!!! Function src_compile, Line 101, Exitcode 2
!!! Compile problem
!!! If you need support, post the topmost build error, NOT this status message.







Portage 2.0.53_rc7 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r3, 2.6.14.2-grsec i686)
=================================================================
System uname: 2.6.14.2-grsec i686 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.12.0_pre9
ccache version 2.4 [enabled]    
dev-lang/python:     2.3.4-r1, 2.4.2
sys-apps/sandbox:    1.2.13     
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r1, 2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=i686 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/alias /var/qmail/control /var/vpopmail/domains /var/vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -pipe -march=i686 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks noauto noinfo sandbox sfperms"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/root/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac acl alsa apm audiofile avi berkdb bitmap-fonts boundschecking bzip2 crypt dvd dvdread eds emboss encode expat font-server foomaticdb gif gmp gpm gstreamer gtk gtk2 imlib ipv6 jpeg kde lcms libg++ libwww mad mikmod mmx mng motif mp3 mpeg multislot mysql ncurses nptl nvidia ogg oggvorbis opengl oss pcre pdflib php png qt quicktime readline real sdl spell ssl tcpd theora tiff truetype truetype-fonts type1-fonts udev vorbis win32codecs xml2 xprint xv xvid zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS
Comment 1 SpanKY gentoo-dev 2005-11-29 20:23:53 UTC
seems courier-imap has the same bug
Comment 2 Tuan Van (RETIRED) gentoo-dev 2005-11-29 21:01:38 UTC
WFM.
# emerge courier-authlib -vp

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] net-libs/courier-authlib-0.57-r1  +berkdb +crypt -debug -gdbm
+ldap +mysql +pam -postgres 0 kB

Total size of downloads: 0 kB

please post your `equery l -d db` and full emerge log.
Comment 3 SpanKY gentoo-dev 2005-11-29 22:15:02 UTC
$ qlist -I -v sys-libs/db
sys-libs/db-1.85-r3
sys-libs/db-3.2.9-r10
sys-libs/db-4.1.25_p1-r4
sys-libs/db-4.2.52_p2
Comment 4 SpanKY gentoo-dev 2005-11-29 22:19:57 UTC
Created attachment 73829 [details]
courier-authlib.log

you can clearly see that after ./configure is run, `make` triggers calls to
autoheader/aclocal/automake ... which means the autotool code in the ebuild is
broken
Comment 5 SpanKY gentoo-dev 2005-11-29 22:21:00 UTC
vapier / # emerge courier-authlib courier-imap -pv

[ebuild   R   ] net-libs/courier-authlib-0.57-r1  +berkdb +crypt -debug -gdbm* -ldap +mysql -pam -postgres 0 kB 
[ebuild   R   ] net-mail/courier-imap-4.0.4  +berkdb -debug -fam -gdbm* +ipv6 -nls (-selinux) 0 kB 
Comment 6 Tuan Van (RETIRED) gentoo-dev 2005-11-30 10:50:21 UTC
(In reply to comment #4)
> Created an attachment (id=73829) [edit]
> courier-authlib.log
> 
> you can clearly see that after ./configure is run, `make` triggers calls to
> autoheader/aclocal/automake ... which means the autotool code in the ebuild is
> broken

because we should run aclocal && autoheader && autoconf instead just autoconf
after we patch the source to support slotted db. but I don't that is the problem.
From your log:
checking for db_create_4002 in -ldb-4.2... (cached) yes
checking for db_create_4002... (cached) yes
checking for db_create_4001... (cached) no
checking for db_create_4000... (cached) no
checking for db_create... (cached) no
look fine. it configure courier-auth to use "-ldb-4.2". check that your
/usr/include/db.h does not point to /usr/include/db3/db.h. Although this problem
has been fixed a long time ago by maintainers of sys-libs/db.
Comment 7 SpanKY gentoo-dev 2005-11-30 10:56:13 UTC
it may not be the problem but it's still wrong

lrwxrwxrwx  1 root root 10 Jun  3 15:33 /usr/include/db.h -> db4.2/db.h
Comment 8 Tuan Van (RETIRED) gentoo-dev 2005-11-30 11:00:20 UTC
please post your `grep db_create /usr/include/db4.2/db.h`
Comment 9 SpanKY gentoo-dev 2005-11-30 11:12:28 UTC
 * Flags private to db_create.
#define db_create db_create_4002
int db_create __P((DB **, DB_ENV *, u_int32_t));
Comment 10 Tuan Van (RETIRED) gentoo-dev 2005-11-30 11:24:32 UTC
please tar up
/var/tmp/portage/courier-authlib-0.57-r1/work/courier-authlib-0.57/bdbobj then
email it to me or attached here.
Comment 11 SpanKY gentoo-dev 2005-12-01 01:16:46 UTC
Created attachment 73876 [details]
courier-authlib-0.57-bdbobj.tar.bz2
Comment 12 Tuan Van (RETIRED) gentoo-dev 2005-12-01 09:07:01 UTC
(In reply to comment #11)  
> Created an attachment (id=73876) [edit]  
> courier-authlib-0.57-bdbobj.tar.bz2  
>   
  
I unpacked the tarball and try `make` doesn't work, `make clean && make work`.  
The Makefile looks good to me. So I really don't have any more idea why is it  
failed to link. I notice you have  ccache enabled. I'd suggest you try with 
ccache disabled. 
Comment 13 SpanKY gentoo-dev 2005-12-01 10:51:00 UTC
ccache wouldnt cause this and indeed, the build fails still w/ccache disabled
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2006-06-18 04:04:51 UTC
*** Bug 137157 has been marked as a duplicate of this bug. ***
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2006-06-24 05:38:43 UTC
*** Bug 137820 has been marked as a duplicate of this bug. ***
Comment 16 MT 2006-07-08 04:59:21 UTC
the bdbobj problem with courier-authlib and sys-libs/db happen only if sys-libs/db* are compiled with LDFLAGS="-Wl,--as-needed"

to FIX recompile sys-libs/db* without --as-needed.
Comment 17 Mihai Limbasan 2006-07-17 09:03:15 UTC
(In reply to comment #16)
> the bdbobj problem with courier-authlib and sys-libs/db happen only if
> sys-libs/db* are compiled with LDFLAGS="-Wl,--as-needed"
> 
> to FIX recompile sys-libs/db* without --as-needed.
> 

Incorrect. It also occurs with an empty LDFLAGS on a brand spanking new x86 system, but with -gdbm. It's not a LDFLAGS issue.
Comment 18 MT 2006-07-18 05:13:16 UTC
> Incorrect. It also occurs with an empty LDFLAGS on a brand spanking new x86
> system, but with -gdbm. It's not a LDFLAGS issue.

for me compile perfectly with -gdbm.



Calculating dependencies... done!
[ebuild   R   ] net-mail/courier-imap-4.0.1  USE="berkdb fam nls -debug -gdbm -ipv6" 2,961 kB

Total size of downloads: 2,961 kB


Calculating dependencies... done!
[ebuild   R   ] net-libs/courier-authlib-0.58  USE="berkdb crypt mysql pam -debug -gdbm -ldap -postgres" 1,959 kB

Total size of downloads: 1,959 kB


i can reproduce this bug only with LDFLAG --as-needed enabled
Comment 19 Mihai Limbasan 2006-07-18 12:47:08 UTC
I failed to mention the toolchain on the system - gcc 4.1.1, binutils 2.17, glibc 2.4, latest stable BDB.
Comment 20 Jakub Moc (RETIRED) gentoo-dev 2006-08-09 06:56:13 UTC
*** Bug 143346 has been marked as a duplicate of this bug. ***
Comment 21 Jakub Moc (RETIRED) gentoo-dev 2006-08-11 08:27:52 UTC
*** Bug 143577 has been marked as a duplicate of this bug. ***
Comment 22 Luca Longinotti (RETIRED) gentoo-dev 2007-04-08 14:42:49 UTC
net-libs/courier-authlib-0.59.2 and net-mail/courier-imap-4.0.6-r2 work perfectly fine with GDBM disabled and BerkDB enabled.
Closing this.
Best regards, CHTEKK.
Comment 23 Martin von Gagern 2007-09-16 18:48:08 UTC
(In reply to comment #22)
> net-libs/courier-authlib-0.59.2 and net-mail/courier-imap-4.0.6-r2 work
> perfectly fine with GDBM disabled and BerkDB enabled.

Still got this with net-mail/courier-imap-4.0.6-r2 on a hardened system, or more correctly, on a system I'm currently transitioning to hardened. So this is a remerge. The exact error message now looks like this here:

i686-pc-linux-gnu-g++ -O2 -march=i686 -fomit-frame-pointer -o testbdb testbdb.o  ./.libs/libbdbobj.a /usr/lib/libdb-4.2.so -lpthread
./.libs/libbdbobj.a(bdbobj.o): In function `.L13':
bdbobj.c:(.text+0x186): undefined reference to `db_create'
collect2: ld returned 1 exit status
make[3]: *** [testbdb] Error 1

Details about my config:
net-mail/courier-imap-4.0.6-r2 (berkdb -debug fam -gdbm ipv6 -nls -selinux)
sys-libs/db-4.2.52_p4-r2(-bootstrap -doc -elibc_FreeBSD -java -nocxx -tcl -test)
sys-libs/db-4.5.20_p2(-bootstrap -doc -elibc_FreeBSD -java -nocxx -tcl -test)
sys-devel/gcc-3.4.6-r2 with profile i686-pc-linux-gnu-3.4.6
Comment 24 Martin von Gagern 2007-09-16 19:32:38 UTC
Created attachment 131072 [details]
build.log from courier-imap-4.0.6-r2
Comment 25 Martin von Gagern 2007-09-16 22:52:09 UTC
(In reply to comment #23)
> sys-libs/db-4.2.52_p4-r2
> sys-libs/db-4.5.20_p2

Emerging sys-libs/db-4.3.29-r2 solved the issue.
Maybe you should adjust the dependencies in the ebuild.
Comment 26 Justin Bronder (RETIRED) gentoo-dev 2007-09-26 22:33:02 UTC
(In reply to comment #25)
This occured on my machine as well with db 4.2.52_p4-r2 and 4.5.20_p2.  I believe the problem is due, in part, to the fact that the configure scripts don't check for db-4.5, and hence fall back to db-4.2 in some wierd state based on /usr/include/db.h defining the version to be 4.5.20.

Simply adding db-4.5 to all of the configure.in scripts in the top source directory and bdbobj/ fixes the problem.  This could be fixed by updating courier-imap-${PV}-db4-{bdbobj_,-}configure.in.patch
Comment 27 Sami Samhuri 2008-01-20 06:17:57 UTC
Still broken guys.  I have sys-libs/db-4.2 and 4.5 installed and courier-authlib-0.58 fails to build on amd64.  equery says that courier-authlib depends on 4.5, and /usr/include/db.h points to 4.5.


sjs@zaphod% equery l -d db
[ Searching for package 'db' in all categories among: ]
 * installed packages
[I--] [  ] sys-libs/db-4.2.52_p4-r2 (4.2)
[I--] [  ] sys-libs/db-4.5.20_p2 (4.5)


sjs@zaphod% ls -ld /usr/include/db*
lrwxrwxrwx 1 root root  10 Jun 29  2007 /usr/include/db.h -> db4.5/db.h
drwxr-xr-x 2 root root 120 Nov  1  2006 /usr/include/db4.2/
drwxr-xr-x 2 root root 120 Jun 29  2007 /usr/include/db4.5/
lrwxrwxrwx 1 root root  14 Jun 29  2007 /usr/include/db_185.h -> db4.5/db_185.h


sjs@zaphod% emerge info
*** Deprecated use of action 'info', use '--info' instead
Portage 2.1.3.9 (default-linux/amd64/2006.0, gcc-3.4.6, glibc-2.5-r4, 2.6.16.18-xen x86_64)
=================================================================
System uname: 2.6.16.18-xen x86_64 AMD Athlon(tm) 64 Processor 3300+
Timestamp of tree: Sat, 19 Jan 2008 10:00:01 +0000
app-shells/bash:     3.2_p17
dev-lang/python:     2.4.4-r5
dev-python/pycrypto: 2.0.1-r5
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-mtune=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg distlocks metadata-transfer nostrip sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="aim amd64 apache2 authdaemond bash-completion berkdb bitmap-fonts bzip2 cgi clearpasswd cli cracklib crypt ctype curl curlwrappers dri eds emboss encode fam fastcgi foomaticdb gd gif gpm gstreamer iconv imagemagick imap isdnlog jpeg jpeg2k libwww logrotate lzw lzw-tiff maildir mbox memcache midi mp3 mpeg msn mudflap mysql mysqli ncurses nls nptl nptlonly openmp pam pcre pdo perl php png posix pppd python qt3 qt4 quicktime readline reflection ruby sasl sdl session sockets spamassassin spell spl ssl tcpd tiff truetype truetype-fonts type1-fonts unicode userlocales utf8 valias vhosts virtual-users webdav xattr xml xorg xv yahoo zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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 mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon 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 deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i810 mach64 mga neomagic nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY