mail-mta/exim with mysql support enabled does not compile with dev-db/mariadb-5.2.4, installed from mysql overlay Reproducible: Always Steps to Reproduce: 1. emerge dev-db/mariadb-5.2.4 from mysql overlay 2. enable mysql USE flag in mail-mta/exim 3. try to emerge mail-mta/exim Actual Results: # emerge -avt exim These are the packages that would be merged, in reverse order: Calculating dependencies... done! [ebuild U ] mail-mta/exim-4.74-r1 [4.72-r1] USE="dkim dovecot-sasl exiscan-acl gnutls lmtp mysql pam perl sasl spf srs ssl syslog tcpd -X -dcc -dnsdb -dsn -ipv6 -ldap -maildir -mbx -nis -postgres -radius -sqlite" 0 kB Total: 1 package (1 upgrade), Size of downloads: 0 kB Would you like to merge these packages? [Yes/No] Y >>> Verifying ebuild manifests >>> Emerging (1 of 1) mail-mta/exim-4.74-r1 * exim-4.74.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ] * system_filter.exim.gz RMD160 SHA1 SHA256 size ;-) ... [ ok ] * Package: mail-mta/exim-4.74-r1 * Repository: gentoo * Maintainer: grobian@gentoo.org net-mail@gentoo.org * USE: amd64 dkim dovecot-sasl elibc_glibc exiscan-acl gnutls kernel_linux lmtp multilib mysql pam perl sasl spf srs ssl syslog tcpd userland_GNU >>> Unpacking source... >>> Unpacking exim-4.74.tar.bz2 to /var/tmp/portage/mail-mta/exim-4.74-r1/work ................................. x86_64-pc-linux-gnu-gcc -o exim x86_64-pc-linux-gnu-gcc -o exim -rdynamic -ldl acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o directory.o dns.o drtables.o enq.o exim.o expand.o filter.o filtertest.o globals.o dkim.o header.o host.o ip.o log.o lss.o match.o moan.o os.o parse.o queue.o rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o store.o string.o tls.o tod.o transport.o tree.o verify.o lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o local_scan.o perl.o malware.o mime.o regex.o spam.o spool_mbox.o demime.o bmi_spam.o spf.o srs.o dcc.o version.o \ routers/routers.a transports/transports.a lookups/lookups.a \ auths/auths.a pdkim/pdkim.a \ -lresolv -lnsl -lcrypt -lm -lspf2 -lsrs_alt -lpam -lsasl2 -lwrap -Wl,-O1 -Wl,--as-needed \ -ldb -lmysqlclient \ -Wl,-E -Wl,-O1 -Wl,--as-needed -L/usr/lib64/perl5/5.12.2/x86_64-linux/CORE -lperl -lnsl -ldl -lm -lcrypt -lutil -lc -lgnutls -ltasn1 -lgcrypt -lpcre -Wl,-O1 -Wl,--as-needed /usr/lib/gcc/x86_64-pc-linux-gnu/4.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status make[1]: *** [exim] Error 1 make[1]: Leaving directory `/var/tmp/portage/mail-mta/exim-4.74-r1/work/exim-4.74/build-exim-gentoo' make: *** [all] Error 2 emake failed * ERROR: mail-mta/exim-4.74-r1 failed: * make failed * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 2863: Called die * The specific snippet of code: * emake -j1 CC="$(tc-getCC)" FULLECHO='' || die "make failed" * * If you need support, post the output of 'emerge --info =mail-mta/exim-4.74-r1', * the complete build log and the output of 'emerge -pqv =mail-mta/exim-4.74-r1'. * The complete build log is located at '/var/tmp/portage/mail-mta/exim-4.74-r1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/mail-mta/exim-4.74-r1/temp/environment'. * S: '/var/tmp/portage/mail-mta/exim-4.74-r1/work/exim-4.74' >>> Failed to emerge mail-mta/exim-4.74-r1, Log file: >>> '/var/tmp/portage/mail-mta/exim-4.74-r1/temp/build.log' * Messages for package mail-mta/exim-4.74-r1: * ERROR: mail-mta/exim-4.74-r1 failed: * make failed * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 2863: Called die * The specific snippet of code: * emake -j1 CC="$(tc-getCC)" FULLECHO='' || die "make failed" * * If you need support, post the output of 'emerge --info =mail-mta/exim-4.74-r1', * the complete build log and the output of 'emerge -pqv =mail-mta/exim-4.74-r1'. * The complete build log is located at '/var/tmp/portage/mail-mta/exim-4.74-r1/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/mail-mta/exim-4.74-r1/temp/environment'. * S: '/var/tmp/portage/mail-mta/exim-4.74-r1/work/exim-4.74' Expected Results: successfull compilation and installation of mail-mta/exim Solution, that works for me: #################### cd /usr/lib64/ ln -s mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so ln -s mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so.16 ln -s mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so.16.0 ln -s mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so.16.0.0 ln -s mysql/libmysqlclient_r.so.16.0.0 /usr/lib64/libmysqlclient_r.so ln -s mysql/libmysqlclient_r.so.16.0.0 /usr/lib64/libmysqlclient_r.so.16 ln -s mysql/libmysqlclient_r.so.16.0.0 /usr/lib64/libmysqlclient_r.so.16.0 ln -s mysql/libmysqlclient_r.so.16.0.0 /usr/lib64/libmysqlclient_r.so.16.0.0 #################### after making symlinks exim compiles and installs successfully ################################### ################################### # emerge --info Portage 2.1.9.25 (hardened/linux/amd64, gcc-4.4.4, glibc-2.11.2-r3, 2.6.32-hardened-r34-0 x86_64) ================================================================= System uname: Linux-2.6.32-hardened-r34-0-x86_64-Intel-R-_Core-TM-2_Quad_CPU_Q6600_@_2.40GHz-with-gentoo-1.12.14 Timestamp of tree: Mon, 14 Feb 2011 15:00:01 +0000 app-shells/bash: 4.1_p9 dev-lang/python: 2.6.6-r1, 3.1.2-r4 dev-util/cmake: 2.8.1-r2 sys-apps/baselayout: 1.12.14-r1 sys-apps/sandbox: 2.4 sys-devel/autoconf: 2.65-r1 sys-devel/automake: 1.10.3, 1.11.1 sys-devel/binutils: 2.20.1-r1 sys-devel/gcc: 4.4.4-r2 sys-devel/gcc-config: 1.4.1 sys-devel/libtool: 2.2.10 sys-devel/make: 3.81-r2 virtual/os-headers: 2.6.30-r1 (sys-kernel/linux-headers) ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -fforce-addr -mtune=nocona -march=nocona" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /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="-O2 -pipe -fforce-addr -mtune=nocona -march=nocona" DISTDIR="/var/db/portage_distfiles" FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en ru" MAKEOPTS="-j1" PKGDIR="/var/db/portage_packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/var/db/portage" PORTDIR_OVERLAY="/var/lib/layman/mysql /var/lib/layman/scarabeus" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="acl acpi amd64 audit bash-completion berkdb bzip2 caps chroot cli cracklib crypt cups cxx dri gdbm gnutls hardened iconv justify logrotate mhash mktemp mmx modules mudflap multilib ncurses nptl nptlonly openmp pam pcre perl pic pppd python readline session sse sse2 ssl sysfs syslog tcpd unicode urandom vhosts xattr xinetd xorg 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 mmap_emul 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 cgi cgid 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" APACHE2_MPMS="itk" 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 ru" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS # ###################################
@mysql: is that libmysqlclient on purpose installed like that? If so, how is an application to find out how to link correctly?
How are you getting your MySQL libraries? You should be invoking: # mysql_config --libs The install location for the library is correct at /usr/$(get_libdir)/mysql/
> You should be invoking: > # mysql_config --libs > # mysql_config --libs -Wl,-O1 -Wl,--as-needed -rdynamic -L/usr/lib64/mysql -lmysqlclient -L/usr//lib -lz -lcrypt -lnsl -lm -L/usr/lib/ -lssl -lcrypto # And I get the same output in systems, with mysql installed instead of mariadb. Dovecot, PHP, and many other packages, that require mysql, build successfully with mariadb, I've got troubles only with mail-mta/exim. BTW # cd /usr/lib64/ # ln -s mysql/libmysqlclient.so.16.0.0 /usr/lib64/libmysqlclient.so is enough to build exim with mariadb successfully, no other symlinks are needed.
I'm almost sure that this happens to Exim, because it doesn't call mysql-config, but just blindly assumes -lmysqlclient. I think we can call mysql-config and add it's -L stuff to the LDFLAGS within the ebuild.
This was probably caused by the update done to the mysql_fx eclass to address bug 348788 that broke mysql_lib_symlinks. I've fixed it now. In any case, apps building against mysql should use "mysql_config --libs" to determine the directory where libs are installed
@grobian: The mysql team fixed this already, so closing. please reopen if the problem persists on new mysql installs.
thanks!