Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532422 - dev-qt/qtsql-4.8.6-r1 USE="abi_x86_32 abi_x86_64 mysql" - ld: cannot find -lmysqlclient_r -lz
Summary: dev-qt/qtsql-4.8.6-r1 USE="abi_x86_32 abi_x86_64 mysql" - ld: cannot find -lm...
Status: RESOLVED DUPLICATE of bug 532408
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: qt-4.8.6-stable
  Show dependency tree
 
Reported: 2014-12-13 09:39 UTC by David Carlos Manuelda
Modified: 2014-12-18 19:00 UTC (History)
1 user (show)

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


Attachments
build log (build.log,767.93 KB, text/plain)
2014-12-13 09:41 UTC, David Carlos Manuelda
Details
mariadb build log (dev-db:mariadb-10.0.15-r1:20141218-173522.log.xz,139.40 KB, application/x-xz)
2014-12-18 17:41 UTC, David Carlos Manuelda
Details
emerge --info (emergeinfo.txt,19.23 KB, text/plain)
2014-12-18 17:56 UTC, David Carlos Manuelda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlos Manuelda 2014-12-13 09:39:41 UTC
When trying to build on amd64 with abi_x86_32 enabled (in emul-linux-x86-* and also per package setting as suggested by emerge), I found that qtsql can't be compiled with the summary error.

Last lines are:
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libmysqlclient_r.so when searching for -lmysqlclient_r
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../lib32/libmysqlclient_r.so when searching for -lmysqlclient_r
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/../lib32/libmysqlclient_r.so when searching for -lmysqlclient_r
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../libmysqlclient_r.so when searching for -lmysqlclient_r
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib32/libmysqlclient_r.so when searching for -lmysqlclient_r
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib/libmysqlclient_r.so when searching for -lmysqlclient_r
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmysqlclient_r
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libz.so when searching for -lz
collect2: error: ld returned 1 exit status
Makefile:116: recipe for target '../../../../plugins/sqldrivers/libqsqlmysql.so' failed

locate libmysqlclient_r.so gives:
/usr/lib32/libmysqlclient_r.so
/usr/lib32/libmysqlclient_r.so.18
/usr/lib32/libmysqlclient_r.so.18.0.0
/usr/lib64/libmysqlclient_r.so
/usr/lib64/libmysqlclient_r.so.18
/usr/lib64/libmysqlclient_r.so.18.0.0

and libz:
/lib32/libz.so.1
/lib32/libz.so.1.2.8
/lib64/libz.so.1
/lib64/libz.so.1.2.8
/usr/lib32/libz.so
/usr/lib64/libz.so

So I guess the problem is not in the graphite2 ebuild but something about it not being able to find it.

Reproducible: Always
Comment 1 David Carlos Manuelda 2014-12-13 09:41:03 UTC
Created attachment 391540 [details]
build log
Comment 2 David Carlos Manuelda 2014-12-17 04:39:11 UTC
I think it could be better to cc multilib herd also, since it seems to affect only when builing with multilib option
Comment 3 David Carlos Manuelda 2014-12-17 05:00:31 UTC
I've been watching the logs, and I saw in compilation line the following: -L/usr/lib32/mysql, but according to locate, mariadb installed the lib directly under /usr/lib32, not under mysql subfolder.

Can this be the cause?
Comment 4 David Carlos Manuelda 2014-12-17 22:40:01 UTC
Another test, it builds with -mysql flag so problem is definitelly caused by multilib build with mysql support.
Comment 5 Davide Pesavento (RETIRED) gentoo-dev 2014-12-18 15:29:22 UTC
Among the linking errors of the -m32 build there is:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib32/libmysqlclient_r.so when searching for -lmysqlclient_r

This is strange... why is it incompatible? Please rebuild mysql/mariadb and try again.
Comment 6 David Carlos Manuelda 2014-12-18 15:48:18 UTC
Rebuild both, zlib and mariadb with same result.

This is very strange, because the only 2 things that fails to build in multilib has in common the can't find -lz (this one, and bug #532408)

I think I discovered what is happenning:

This is correct
zero stormbyte # file /lib/libz.so.1.2.8 
/lib/libz.so.1.2.8: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
zero stormbyte # file /lib32/libz.so.1.2.8 
/lib32/libz.so.1.2.8: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped


But I discovered that the one that is under /usr/lib{32,64} is not actually a symlink, nor a library, it is text file containing:

cat /usr/lib32/libz.so 
/* GNU ld script
   Since Gentoo has critical dynamic libraries in /lib, and the static versions
   in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
   run into linking problems.  This "fake" dynamic lib is a linker script that
   redirects the linker to the real lib.  And yes, this works in the cross-
   compiling scenario as the sysroot-ed linker will prepend the real path.

   See bug http://bugs.gentoo.org/4411 for more info.
 */
OUTPUT_FORMAT ( elf32-i386 )
GROUP ( /lib32/libz.so.1 )

So if compilation is, according to the message, trying to find libz.so inside /usr/lib32, it will find the text file and not the shared library.

May it be the cause?
Comment 7 David Carlos Manuelda 2014-12-18 15:51:30 UTC
Oh, I think I found the cause:

file /usr/lib32/libmysqlclient.so.18.0.0 
/usr/lib32/libmysqlclient.so.18.0.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

Why is the 64bit libmysqlclient library is stored in lib32 ?? Probably a bug in mariadb ebuild?
Comment 8 David Carlos Manuelda 2014-12-18 15:59:01 UTC
Should I post a new bug against mariadb/mysql and block this one, or simply change bug topic?
Comment 9 Davide Pesavento (RETIRED) gentoo-dev 2014-12-18 17:00:42 UTC
Do you have mysql or mariadb installed? Please post the `emerge -pv` for that package.
Comment 10 Davide Pesavento (RETIRED) gentoo-dev 2014-12-18 17:04:22 UTC
@mysql-bugs guys, see comment #7
Comment 11 David Carlos Manuelda 2014-12-18 17:35:13 UTC
I have mariadb installed according to (looking which one is going to be rebuilt):

emerge -pv dev-db/mysql dev-db/mariadb

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] dev-db/mariadb-10.0.15-r1  USE="community embedded extraengine pam perl ssl xml -cluster -debug -jemalloc -latin1 -max-idx-128 -minimal -odbc -oqgraph -profiling (-selinux) -sphinx -static -static-libs -systemtap -tcmalloc {-test} -tokudb" ABI_X86="32 (64) (-x32)" 0 KiB
[ebuild  N     ] dev-db/mysql-5.6.22  USE="community perl ssl -cluster -debug -embedded -extraengine -jemalloc -latin1 -max-idx-128 -minimal -profiling (-selinux) -static -static-libs -systemtap -tcmalloc {-test}" ABI_X86="32 (64) (-x32)" 33.799 KiB
[blocks B      ] dev-db/mariadb ("dev-db/mariadb" is blocking dev-db/mysql-5.6.22)
[blocks B      ] dev-db/mysql ("dev-db/mysql" is blocking dev-db/mariadb-10.0.15-r1)
Comment 12 David Carlos Manuelda 2014-12-18 17:41:29 UTC
Created attachment 391968 [details]
mariadb build log
Comment 13 Brian Evans (RETIRED) gentoo-dev 2014-12-18 17:54:40 UTC
(In reply to David Carlos Manuelda from comment #7)
> Oh, I think I found the cause:
> 
> file /usr/lib32/libmysqlclient.so.18.0.0 
> /usr/lib32/libmysqlclient.so.18.0.0: ELF 64-bit LSB shared object, x86-64,
> version 1 (SYSV), dynamically linked, stripped
> 
> Why is the 64bit libmysqlclient library is stored in lib32 ?? Probably a bug
> in mariadb ebuild?

Works here:

grknight@tetsusaiga ~ $ file /usr/lib32/libmysqlclient.so.18.0.0
/usr/lib32/libmysqlclient.so.18.0.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=19ceacf961bb7db61dfa11f70dab7b9b5e19f70e, stripped

grknight@tetsusaiga ~ $ eix -e mariadb
[I] dev-db/mariadb
     Available versions:  [M](~)5.1.67{tbz2}[1] [M](~)5.2.14{tbz2}[1] [M](~)5.3.12[1] 5.5.39{tbz2}[1] 5.5.40-r1 5.5.40-r1[1] (~)10.0.15{tbz2} (~)10.0.15{tbz2}[1] (~)10.0.15-r1 [M](~)10.1.0_alpha{tbz2}[1] [M](~)10.1.2_alpha[1] [M]**9999[1] {big-tables bindist cluster +community cracklib debug embedded extraengine galera innodb-lz4 innodb-lzo jemalloc latin1 libevent max-idx-128 minimal odbc oqgraph pam pbxt +perl profiling selinux sphinx ssl sst-rsync sst-xtrabackup static static-libs systemtap tcmalloc test tokudb xml ABI_MIPS="n32 n64 o32" ABI_PPC="32 64" ABI_S390="32 64" ABI_X86="32 64 x32"}
     Installed versions:  10.0.15-r1(02:33:21 PM 12/15/2014)(community embedded extraengine jemalloc latin1 oqgraph pam perl profiling ssl tokudb xml -cluster -debug -max-idx-128 -minimal -odbc -selinux -sphinx -static -static-libs -systemtap -tcmalloc -test ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="32 64 -x32")
     Homepage:            http://mariadb.org/
     Description:         An enhanced, drop-in replacement for MySQL

[1] "mysql" /usr/local/portage/layman/mysql
Comment 14 Davide Pesavento (RETIRED) gentoo-dev 2014-12-18 17:56:11 UTC
(In reply to David Carlos Manuelda from comment #12)
> Created attachment 391968 [details]
> mariadb build log

I don't see any -m32 in this build log...
Comment 15 David Carlos Manuelda 2014-12-18 17:56:36 UTC
Created attachment 391970 [details]
emerge --info
Comment 16 David Carlos Manuelda 2014-12-18 18:02:12 UTC
(In reply to Davide Pesavento from comment #14)
> (In reply to David Carlos Manuelda from comment #12)
> > Created attachment 391968 [details]
> > mariadb build log
> 
> I don't see any -m32 in this build log...

Yes, that is the problem, just that I don't know why it is not using CXXFLAGS_x86 or adding the -m32 flag. Only this (and graphite2) exhibits this bad behavior when building multilib.

Anyways I've added emerge --info output if it helps, because here it is not working :(
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-12-18 19:00:15 UTC

*** This bug has been marked as a duplicate of bug 532408 ***