Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88415 - courier-authlib-0.5* doesn't compile using mysql when LDFLAGS are set in system
Summary: courier-authlib-0.5* doesn't compile using mysql when LDFLAGS are set in system
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High critical
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
: 106760 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-08 16:41 UTC by Jan Oravec
Modified: 2005-09-21 05:22 UTC (History)
8 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Oravec 2005-04-08 16:41:40 UTC
When I try to emerge courier-authlib-0.55, the following error happens:

/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: unrecognized option '-Wl'
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3/../../../../x86_64-pc-linux-gnu/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status
make[2]: *** [libauthmysql.la] Error 1

I have the following LDFLAGS set in the system (I suppose it is correct to use -Wl, because automake adds LDFLAGS to gcc and not ld):
LDFLAGS="-Wl,-O1 -Wl,--sort-common"

mysql_config --libs:
-Wl,-O1 -Wl,--sort-common -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto


I've tracked the error to the following:

Either:

1) mysql_config --libs should not report output to be used by gcc, but instead report output useful for ld

or

2) courier-authlib should not do something like:
libauthmysql_la_LDFLAGS = $(commonldflags) $(libauthmysql_t:%=-Wl,%)
which adds another -Wl layer (libauthmysql_t contains @MYSQL_LIBS@ from mysql_config --libs)


Reproducible: Always
Steps to Reproduce:
1. Have compiled some mysql with LDFLAGS in make.conf
2. Try to compile courier-authlib

Actual Results:  
It did not compile

Expected Results:  
It should compile

I believe the 'details' section is enough descriptive.
Comment 1 Jory A. Pratt 2005-06-08 18:58:06 UTC
Scott this is not an issue with LDFLAGS I have built all mysql with LDFLAGS=""
and courier-authlib still chokes I will look into this as soon as possible
seeing I am stuck waiting on this package now as well.
Comment 2 Jory A. Pratt 2005-06-08 19:28:18 UTC
also 0.54* are effected possibly 0.53* as well
Comment 3 Jory A. Pratt 2005-06-09 13:53:28 UTC
Scott I have successfully built libauthmysql.la makefile.in needs modifications
to make this possible I did it after configure by modifing the Makefile I will
see what I can come up with on Makefile.in
Comment 4 Jory A. Pratt 2005-06-10 18:39:19 UTC
Jan I need you to post emerge info please.
Comment 5 Jory A. Pratt 2005-06-10 20:46:02 UTC
this is strictly a mysql issue mysql_config --libs should not report the LDFLAGS
used to compile ... msql will have to adjust package or send upstream not a
courier-authlib problem.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-06-11 00:04:00 UTC
No, I don't agree that mysql_config should not report the ldflags. There are 
cases where "-Wl" flags are required to be passed. Admittedly not common, and 
mysql doesn't use them itself, but they do exist, and a proper solution should 
be used.

Fix your Makefile to not pad any args that already start with -Wl,
Comment 7 Jan Oravec 2005-06-11 03:22:56 UTC
Jory, here is the output of emerge info.

Thanks for working on the fix.

Portage 2.0.51.19 (default-linux/amd64/2005.0, gcc-3.4.3,
glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.11-gentoo-r6 x86_64 AMD Opteron(tm) Processor 242
Gentoo Base System version 1.6.12
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, May 12 2005, 16:32:39)]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.7.9-r1, 1.9.5, 1.5, 1.6.3, 1.8.5-r3
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r4
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CFLAGS="-march=opteron -O3 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=opteron -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.fi.muni.cz/pub/linux/gentoo http://gentoo.ynet.sk/pub"
LDFLAGS="-Wl,-O1 -Wl,--sort-common"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="amd64 acl acpi alsa apache2 bash-completion berkdb bitmap-fonts crypt curl
doc fastcgi font-server fortran gd gdbm gif gpm imap innodb ipv6 java jp2 jpeg
kerberos libwww lzw lzw-tiff maildir mp3 mysql ncurses nls nptl opengl oss pam
pdflib perl pic png postgres python readline slang snmp ssl tcpd tetex tiff
truetype truetype-fonts type1-fonts unicode usb userlocales vhosts xml xml2 xpm
xrandr xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LINGUAS, PORTDIR_OVERLAY
Comment 8 eipi 2005-06-12 10:19:30 UTC
Same problem for me. Moreover, it seems not related to LDFLAGS. I removed the 
LDFLAGS, but it still reports the same problem. 
 
My emerge info: 
Portage 2.0.51.19 (default-linux/amd64/2004.3, gcc-3.4.3, 
glibc-2.3.4.20041102-r1, 2.6.9-gentoo-r12 x86_64) 
================================================================= 
System uname: 2.6.9-gentoo-r12 x86_64 AMD Opteron(tm) Processor 242 
Gentoo Base System version 1.4.16 
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Jun  3 2005, 17:06:30)] 
ccache version 2.3 [enabled] 
dev-lang/python:     2.3.5 
sys-apps/sandbox:    [Not Present] 
sys-devel/autoconf:  2.13, 2.59-r6 
sys-devel/automake:  1.5, 1.9.5, 1.8.5-r3, 1.6.3, 1.7.9-r1, 1.4_p6 
sys-devel/binutils:  2.15.92.0.2-r10 
sys-devel/libtool:   1.5.16 
virtual/os-headers:  2.6.8.1-r4 
ACCEPT_KEYWORDS="amd64" 
AUTOCLEAN="yes" 
CFLAGS="-march=opteron -O2 -pipe -fomit-frame-pointer" 
CHOST="x86_64-pc-linux-gnu" 
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
CXXFLAGS="-march=opteron -O2 -pipe -fomit-frame-pointer" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict" 
GENTOO_MIRRORS="ftp://pandemonium.tiscali.de/pub/gentoo/ 
http://pandemonium.tiscali.de/pub/gentoo/ http://mir.zyrianes.net/gentoo/ 
ftp://mir.zyrianes.net/gentoo/ ftp://194.117.143.70/mirrors/gentoo" 
LANG="fr_FR@euro" 
LC_ALL="fr_FR@euro" 
LDFLAGS="-Wl,-O1" 
LINGUAS="en fr" 
MAKEOPTS="-j3" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="/usr/local/portage" 
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" 
USE="amd64 X aalib accessibility acl acpi alsa apache2 arts audiofile 
authdaemond avi berkdb bitmap-fonts brltty caps cdparanoia crypt cups curl dga 
djbfft dvb dvd dvdread edl eds emacs encode esd fam fbcon flac font-server 
foomaticdb fortran fpx fusion gd gdbm ggi gif gimpprint gnokii gnome gnomedb 
gphoto2 graphviz gstreamer gtk guile idea imagemagick imlib innodb irda jack 
java javamail jikes jp2 jpeg jpeg2k junit kde kdeenablefinal lcms ldap libcaca 
libclamav libg++ libwww live lzw lzw-tiff mad matroska mdb mikmod mmap mng 
motif mozdevelop mozilla mozsvg mozxmlterm mp3 mpeg mysql nas ncurses network 
nls nptl nvidia oav odbc ogg oggvorbis opengl oss pam perl pg-hier 
pg-intdatetime pg-vacuumdelay png portaudio postgres povray ppds python qt 
quotas readline rtc samba sasl scanner sdl slang speex spell sqlite ssl svg 
tcltk tcpd tetex tga theora threads tiff truetype truetype-fonts type1-fonts 
unicode usb userlocales vorbis wifi winbind wmf xine xml xml2 xmms xpm xprint 
xrandr xv xvid xvmc zlib linguas_en linguas_fr userland_GNU kernel_linux 
elibc_glibc" 
Unset:  ASFLAGS, CBUILD, CTARGET 
 
 
Comment 9 Jory A. Pratt 2005-06-12 11:22:42 UTC
The only work around for this right now is to compile mysql with LDFLAGS=""
which will then allow courier-authlib to build correctly .. If I modify makefile
it will build fine problem is that -Wl is need if no LDFLAGS are specified by
user.  I will continue to work on a way to make this all work for us sorry for
the delays.
Comment 10 Jakub Moc (RETIRED) gentoo-dev 2005-07-11 09:14:36 UTC
A quick patch for those who don't want to recompile MySQL just to be able to
compile courier-authlib

--- Makefile.in.orig    2005-03-01 03:22:03.000000000 +0100
+++ Makefile.in 2005-07-11 17:52:21.000000000 +0200
@@ -544,7 +544,7 @@
 libauthmysql_la_SOURCES = authmysql.c preauthmysql.c authmysqllib.c authmysql.h
 libauthmysql_la_DEPENDENCIES = $(commonlibdep)
 libauthmysql_la_LIBADD = $(commonlibadd)
-libauthmysql_la_LDFLAGS = $(commonldflags) $(libauthmysql_t:%=-Wl,%)
+libauthmysql_la_LDFLAGS = $(commonldflags) $(libauthmysql_t)

 # The authcustom module
 libauthcustom_la_SOURCES = authcustom.c preauthcustom.c authcustom.h

And a patch for the ebuild:

--- courier-authlib-0.55.ebuild.orig    2005-05-30 05:38:11.000000000 +0200
+++ courier-authlib-0.55.ebuild 2005-07-11 18:01:59.000000000 +0200
@@ -55,6 +55,10 @@
                        autoconf ||  die "recreate bdbobj/configure failed"
                eend $?
        fi
+       if use mysql ; then
+               epatch ${FILESDIR}/mysql-ldflags.patch || die "MySQL patch failed!"
+               einfo "Patching makefile for MySQL successful!"
+       fi
        sed -i -e'/for dir in/a@@INDENT@@/etc/courier-imap \\' ${S}/authmigrate.in
        sed -i -e'/for dir in/a@@INDENT@@/etc/courier/authlib \\'
${S}/authmigrate.in
        sed -i -e"s|@@INDENT@@|         |g" ${S}/authmigrate.in


I don't know how to check for LDFLAGS in an ebuild, so this patch will probably
fail if you compiled MySQL with empty LDFLAGS.
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2005-07-17 11:18:52 UTC
Mass re-assign, seems like mail-mta/courier needs a maintainer. 
Comment 12 Gergan Penkov 2005-07-26 11:37:45 UTC
failing for me for courier-authlib-0.56, strangely I didn't have any problems
with 0.55. 
Moreover, the Jakub Moc's patch solves the problem for me.
Comment 13 Francesco R. (RETIRED) gentoo-dev 2005-07-26 17:02:45 UTC
fixed upstream in 0.57
courier-authlib/courier-authlib-0.57 is in CVS.

It fix the problem. At least using a manually modified "mycnf_conf" to produce
an otput similar to that of comment #1.
The bug was reproducible this way with courier-authlib/courier-authlib-0.56 .

closing, feel free to reopen if something wrong ... only don't send me an email
may not reach the destination ;)
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2005-09-21 02:06:35 UTC
*** Bug 106760 has been marked as a duplicate of this bug. ***
Comment 15 Francesco R. (RETIRED) gentoo-dev 2005-09-21 05:22:38 UTC
0.57-r1 is now stable for "x86" and "amd64"