When using icc to build db, it fails to link correctly due to duplicate symbols. caused by incorrect predep_objects and postdep_objects entries in the created libtool. icpc links its own versions of crti.o, crtbeginS.o, crtendS.o and crtn.o, causing the duplicate symbols Reproducible: Always Steps to Reproduce: 1. CC="icc" CXX="icpc" emerge sys-libs/db Actual Results: program compiles fine, but fails to link with the following error: icpc -shared /usr/lib/crti.o /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtbeginS.o .libs/cxx_db.o ... whole lot of objects here ... .libs/xa_map.o -Wl,-rpath,/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110 -Wl,-rpath,/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110 -L/usr/lib/../i686-pc-linux-gnu/lib -L/usr/i686-pc-linux-gnu/lib -L/usr/i686-pc-linux-gnu/bin -lpthread -L/opt/intel_cc_80/lib -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110 -L/usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/../../.. -L/usr/lib -lsvml -limf -lm /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/libstdc++.so -lcxaguard -lirc -lc -lgcc_s -lirc_s /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtendS.o /usr/lib/crtn.o -Wl,-soname -Wl,libdb_cxx-4.2.so -o .libs/libdb_cxx-4.2.so /usr/lib/crti.o: In function `_init': /var/tmp/portage/glibc-2.3.5/work/build-default-i686-pc-linux-gnu-nptl/csu/crti.S:12: multiple definition of `_init' /usr/lib/crti.o:/var/tmp/portage/glibc-2.3.5/work/build-default-i686-pc-linux-gnu-nptl/csu/crti.S:12: first defined here /usr/lib/crti.o: In function `_fini': /var/tmp/portage/glibc-2.3.5/work/build-default-i686-pc-linux-gnu-nptl/csu/crti.S:(.fini+0x0): multiple definition of `_fini' /usr/lib/crti.o:/var/tmp/portage/glibc-2.3.5/work/build-default-i686-pc-linux-gnu-nptl/csu/crti.S:(.fini+0x0): first defined here /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtbeginS.o:(.data.rel+0x0): multiple definition of `__dso_handle' /usr/lib/gcc/i686-pc-linux-gnu/3.4.3-20050110/crtbeginS.o:(.data.rel+0x0): first defined here make: *** [libdb_cxx-4.2.la] Error 1 Expected Results: build should have linked correctly. when compiling by hand, it is possible to use these sed commands sed -i -e s/\$predep_objects// libtool sed -i -e s/\$postdep_objects// libtool to remove the objects from the list to be linked, and it completes fine. are there options that could be passed to libtool to prevent it from thinking it has to link these objects? Gentoo Base System version 2.4.16 Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-r0, 2.6.10-hashix2 i686) ================================================================= System uname: 2.6.10-hashix2 i686 Intel(R) Pentium(R) M processor 1700MHz dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.8 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.16 sys-devel/libtool: 1.5.18 virtual/os-headers: 2.6.11 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O -xB -x none" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O -xB -x none" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig candy distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/portage/local" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 4kstacks acpi alsa avi berkdb bitmap-fonts cpudetection crypt cups custom-cflags divx4linux dvd dvdread emboss encode fbcon foomaticdb fortran gdbm gif gtk2 imlib ipv6 jpeg libg++ libwww mad mikmod mmap mmx mmxext motif mp3 mpeg ncurses nptl nptlonly oggvorbis opengl oss pdflib perl pic png python quicktime readline rtc spell sse sse2 ssl svga tcltk tcpd threads truetype truetype-fonts type1-fonts userlocales win32codecs xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS
Libtool is a bloody idiot. I'll look at your fix, see whether it works properly.
better sed commands (maybe?). these blank out the variable where it is declared instead. putting them after the configure call works on my system, and don't affect compiles with gcc sed -i -e s/predep_objects=".*"/predep_objects=""/ libtool sed -i -e s/postdep_objects=".*"/postdep_objects=""/ libtool
Unsupported compiler.