Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88360 - dev-perl/DBD-mysql does not compile against static mysql on amd64
Summary: dev-perl/DBD-mysql does not compile against static mysql on amd64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL: http://bugs.mysql.com/bug.php?id=8796
Whiteboard:
Keywords:
: 141999 180675 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-08 08:13 UTC by Pierre Fortin Carrier
Modified: 2007-07-11 08:18 UTC (History)
6 users (show)

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


Attachments
mysql.eclass.diff (mysql.eclass.diff,376 bytes, patch)
2007-05-23 20:59 UTC, Jakub Moc (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Fortin Carrier 2005-04-08 08:13:25 UTC
When I try to emerge DBD-mysql against a mysql server builded with USE flags "+static -ssl" on a system installed from 2005.0 AMD64 the build fail with:

Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/lib" /usr/bin/perl5.8.5 myld gcc  -shared -L/usr/local/lib dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so   -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm
make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1

!!! ERROR: dev-perl/DBD-mysql-2.1027 failed.
!!! Function perl-module_src_compile, Line 100, Exitcode 2
!!! compilation failed

The same emerge against a mysql emerged with USE="-static -ssl" compile with success.

Reproducible: Always
Steps to Reproduce:
1.USE="static -ssl" emerge mysql
2.emerge DBD-mysql #dont compile

3.USE="-static -ssl" emerge mysql
4.emerge DBD-mysql #compile cleanly
Actual Results:  
DBD-mysql dont compile

Expected Results:  
clean compile and install

On x86 (other system) with same version of package the DBD-mysql compile without
problem in both case (with a mysql static or non-static)

mysql version used:  4.0.24.ebuild
DBD-mysql-2.1027

# emerge info
Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3, glibc-2.3.4.20041102
-r1, 2.6.11.6 x86_64)
=================================================================
System uname: 2.6.11.6 x86_64 AMD Opteron(tm) Processor 244
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4-r1 [2.3.4 (#1, Mar  4 2005, 20:56:1
9)]
dev-lang/python:     2.3.4-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r7
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/shar
e/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linu
x/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 acpi alsa berkdb bitmap-fonts crypt font-server fortran gif gpm inn
odb jp2 jpeg lzw lzw-tiff mbox mp3 mysql ncurses nls opengl oss pam perl png p
ython readline ssl tcpd threads tiff truetype truetype-fonts type1-fonts usb u
serlocales xml2 xpm xrandr xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
Comment 1 Michael Cummings (RETIRED) gentoo-dev 2005-04-19 09:36:22 UTC
amd64 - can you help? I don't have hardware to even begin to approach this with
Comment 2 Michael Cummings (RETIRED) gentoo-dev 2005-05-16 09:22:01 UTC
amd64 ping
Comment 3 Olivier Crete (RETIRED) gentoo-dev 2005-05-16 19:08:56 UTC
This is the full error, seems like you are trying to build a .so (which has to
be -fPIC) against the .a (which is not -fPIC in this case).. I'm not sure if the
.a should be -fPIC (making this a mysql/amd64 bug) or if building non-static
against static is wrong.


Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
rm -f blib/arch/auto/DBD/mysql/mysql.so
LD_RUN_PATH="/lib" /usr/bin/perl5.8.5 myld gcc  -shared -L/usr/local/lib
dbdimp.o mysql.o  -o blib/arch/auto/DBD/mysql/mysql.so   -L/usr/lib/mysql
-lmysqlclient -lz -lcrypt -lnsl -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld:
/usr/lib/mysql/libmysqlclient.a(libmysql.o): relocation R_X86_64_32 against `a
local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/mysql/libmysqlclient.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2005-09-04 04:12:15 UTC
Mass re-assign.
Comment 5 Simon Stelling (RETIRED) gentoo-dev 2005-11-06 08:51:25 UTC
(In reply to comment #3)
> I'm not sure if the
> .a should be -fPIC (making this a mysql/amd64 bug) or if building non-static
> against static is wrong.

The latter is the case. I'd suggest to check if mysql was built with USE=static,
but that's up to the perl herd
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2005-11-09 09:11:02 UTC
Mass re-assign.
Comment 7 Yuval Yaari (RETIRED) gentoo-dev 2006-06-10 15:06:32 UTC
blubb says that compiling non-static against static is really wrong; Pierre wrote that he did USE=static.
Not a bug, then?
Comment 8 Pierre Fortin Carrier 2006-06-12 09:14:00 UTC
Hi,

I effectively used USE="static" but i think it may still be a bug.  
 
I think The fact that libmysqlclient.a is not build with -fPIC, when the USE flag "static" is defined, prevents the build of tools that depend on MySQL like dev-perl/DBD-mysql on X86_64.

I have hope that this thread will explain better than I am:
http://bugs.mysql.com/bug.php?id=8796

I must also says that I no longuer have access to a X86_64 system, so I was unable to confirm that this bug exist anymore prior to my post.  Pershap it's already fixed?

take care,
Comment 9 Yuval Yaari (RETIRED) gentoo-dev 2006-06-12 13:58:33 UTC
From the thread you referred to:
> Thank you for your bug report. This issue has been committed to our
> source repository of that product and will be incorporated into the
> next release.

amd64, any chance you could help us with this one?
It should be fixed in MySQL >=4.1.11
Comment 10 Simon Stelling (RETIRED) gentoo-dev 2006-07-31 05:07:38 UTC
*** Bug 141999 has been marked as a duplicate of this bug. ***
Comment 11 Pavel Kolla 2006-09-20 07:55:25 UTC
confirm on the bug, USE="static" means no DBD-mysql, no problem with no static compilation

# emerge -v DBD-mysql

...snip...

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/mysql/libmysqlclient.a(libmysql.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/mysql/libmysqlclient.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1

!!! ERROR: dev-perl/DBD-mysql-3.0004 failed.
Call stack:
  ebuild.sh, line 1546:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  ebuild.sh, line 1255:   Called perl-module_src_compile
  perl-module.eclass, line 138:   Called die

Portage 2.1.1 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.4-r3, 2.6.17-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8 x86_64 Intel(R) Xeon(TM) CPU 3.60GHz
Gentoo Base System version 1.12.5
Last Sync: Wed, 20 Sep 2006 13:30:08 +0000
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
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-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://cs.ubishops.ca/pub/gentoo http://adelie.polymtl.ca/ http://gentoo.osuosl.org/ ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ ftp://ftp.gtlib.gatech.edu/pub/gentoo http://www.gtlib.gatech.edu/pub/gentoo ftp://mirror.iawnet.sandia.gov/pub/gentoo/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://gentoo.llarian.net/ ftp://gentoo.llarian.net/pub/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LINGUAS=""
MAKEOPTS="-j3"
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'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 apache2 berkdb bitmap-fonts cgi cli crypt cups dlloader dri elibc_glibc fast-cgi fcgi fortran gd gdbm gpm imap input_devices_evdev input_devices_keyboard input_devices_mouse isdnlog kernel_linux libg++ libwww maildir mysql ncurses nls nptl nptlonly pam pcre perl ppds pppd python ql readline reflection sasl session snmp sperl spl ssl tcpd truetype-fonts type1-fonts udev unicode userland_GNU video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i810 video_cards_mga video_cards_neomagic video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 12 Yuval Yaari (RETIRED) gentoo-dev 2006-09-20 08:02:14 UTC
(In reply to comment #11)
> confirm on the bug, USE="static" means no DBD-mysql, no problem with no static
> compilation

What version of MySQL do you have?
Comment 13 Simon Stelling (RETIRED) gentoo-dev 2006-09-20 08:06:29 UTC
this is more of mysql's territory
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2006-10-18 01:02:04 UTC
@blubb - could you go rant a bit on the upstream bug? They've closed it as NEEDINFO.
Comment 15 Simon Stelling (RETIRED) gentoo-dev 2006-10-18 02:32:34 UTC
(In reply to comment #14)
> @blubb - could you go rant a bit on the upstream bug? They've closed it as
> NEEDINFO.

Done. Closing it as needinfo when a comment above mine the problem was described very precisely looks a bit dumb, but oh well...
Comment 16 Christoph Mende (RETIRED) gentoo-dev 2007-04-16 13:15:07 UTC
I can reproduce this with DBD-mysql-3.0008 and DBD-mysql-4.00.4-r1 trying to link against a statically built mysql-5.0.38, the error is exactly the same as mention in comment #3. Didn't try with mysql4 yet as everything on this system is linked against mysql5 ;>
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2007-04-16 14:12:14 UTC
(In reply to comment #16)
> Didn't try with mysql4 yet as everything on this system is linked against mysql5 

Not needed, I did test w/ mysql-4.1.22-r1 and it's definitely still broken. Thanks.
Comment 18 Jakub Moc (RETIRED) gentoo-dev 2007-05-23 20:59:07 UTC
Created attachment 120126 [details, diff]
mysql.eclass.diff

Someone test this patch please and report back.
Comment 19 Jakub Moc (RETIRED) gentoo-dev 2007-06-03 07:56:24 UTC
*** Bug 180675 has been marked as a duplicate of this bug. ***
Comment 20 Christoph Mende (RETIRED) gentoo-dev 2007-06-20 21:48:20 UTC
(In reply to comment #18)
> mysql.eclass.diff
Works fine with DBD-mysql-4.00.5 compiled against a statically linked mysql-5.0.42
Comment 21 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-06-21 01:14:23 UTC
angelos: could you please test with mysql-4.0 and mysql-4.1 as well?
Comment 22 Christoph Mende (RETIRED) gentoo-dev 2007-06-21 01:43:26 UTC
mysql-4.1 works too, mysql-4.0 fails to compile with some funny syntax errors, but that also happens without that change
Comment 23 Jakub Moc (RETIRED) gentoo-dev 2007-06-29 08:49:09 UTC
(In reply to comment #22)
> mysql-4.1 works too, mysql-4.0 fails to compile with some funny syntax errors,
> but that also happens without that change

Thanks for testing. :) Apply and close, really stale one.
Comment 24 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-07-11 08:18:15 UTC
in cvs.