Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16496 - mysql 3.23.55 compile error ("undefined reference to 'errno'", probably glibc 2.3.2pre)
Summary: mysql 3.23.55 compile error ("undefined reference to 'errno'", probably glibc...
Status: RESOLVED DUPLICATE of bug 16480
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Donny Davies (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-27 14:55 UTC by Christian Rubbert
Modified: 2005-07-17 13:06 UTC (History)
0 users

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 Christian Rubbert 2003-02-27 14:55:35 UTC
Hello! 
This is a fresh gentoo install with mysql in USE and ~x86 in ACCEPT_KEYWORDS 
(emerge info enclosed). 
 
mysql.o(.text+0x1a18): In function `com_source(String*, char*)': 
: undefined reference to `errno'  
collect2: ld returned 1 exit status 
make[2]: *** [mysql] Error 1 
make[1]: *** [all-recursive] Error 1 
make: *** [all] Error 2 
 
!!! ERROR: dev-db/mysql-3.23.55 failed. 
!!! Function src_compile, Line 101, Exitcode 2 
!!! compile problem 
 
This happens to other users as well (forums, irc and alt.os.linux.gentoo). It is always 
reproducible. 
 
In the forums I found a hint that it's the latest glibc's fault. Although on downgrading I 
messed up and had to reinstall, therefore I cannot confirm that yet. 
 
Portage 2.0.46-r12 (default-x86-1.4, gcc-3.2.2, glibc-2.3.2_pre1-r0) 
================================================================= 
System uname: 2.4.20-gentoo-r1 i686 Pentium III (Coppermine) 
GENTOO_MIRRORS="ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/ 
http://gentoo.oregonstate.edu/ http://www.ibiblio.org/pub/Linux/distributions/gentoo" 
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config 
/usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/share/config" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
PORTDIR="/usr/portage" 
DISTDIR="/usr/portage/distfiles" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR_OVERLAY="" 
USE="x86 oss 3dnow apm arts avi crypt cups encode gif gpm imlib jpeg kde libg++ 
libwww mikmod mmx mpeg ncurses nls pdflib png qt qtmt quicktime sdl spell svga 
truetype xml2 xmms xv zlib gdbm berkdb slang readline java X tcpd pam ssl perl 
python oggvorbis gtk motif opengl -gnome alsa lame dvd ipv6 imap mysql" 
COMPILER="gcc3" 
CHOST="i686-pc-linux-gnu" 
CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer -fforce-addr 
-falign-functions=4 -fprefetch-loop-arrays" 
CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer -fforce-addr 
-falign-functions=4 -fprefetch-loop-arrays" 
ACCEPT_KEYWORDS="x86 ~x86" 
MAKEOPTS="-j2" 
AUTOCLEAN="yes" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
FEATURES="sandbox ccache"
Comment 1 Romans 2003-02-27 19:30:45 UTC
Problem exists no more after frest system update, bug can be closed. 
Comment 2 Angel Utiel 2003-02-27 23:15:44 UTC
I have compiled mysql with glibc-2.3.2pre

My solution: is add "-DHAVE_ERRNO_AS_DEFINE=1" in CFLAGS, in /etc/make.conf

my CFLAGS is:
CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer -DHAVE_ERRNO_AS_DEFINE=1"
and compile fine, mysql and mysqlcc.

~# qpkg -I -v glibc
sys-libs/glibc-2.3.2_pre1 *
~# qpkg -I -v mysql
dev-db/mysqlcc-0.8.7 *
dev-db/mysql-3.23.55 *


And, I want to know, if "-DHAVE_ERRNO_AS_DEFINE=1" is the correct form, like mysql does, ex:

#ifdef HAVE_ERRNO_AS_DEFINE
#include <errno.h>			/* errno is a define */
#else
extern int errno;			/* declare errno */
#endif
Comment 3 Clemens Schwaighofer 2003-02-28 04:53:55 UTC
I got the same error when compileing mysql 3.2.55 or 4.0.10. Also with ucspi-tcp.

I tried to update everyting (emerge -u world) but it didn't fix it. when I added the -DHAVE_ERRNO_AS_DEFINE=1 I could compile mysql (tried it with 4.0.10).

my emerge info is:
Portage 2.0.46-r12 (default-x86-1.4, gcc-3.2.2, glibc-2.3.2_pre1-r0)
=================================================================
System uname: 2.4.20-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 1.60GHz
GENTOO_MIRRORS="http://gentoo.oregonstate.edu/ http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="oss 3dnow apm arts avi cups encode gif gtk imlib jpeg kde gnome libg++ libwww mikmod motif mpeg ncurses oggvorbis opengl pdflib png qt qtmt quicktime sdl spell svga truetype X xml2 xmms xv gdbm berkdb slang readline java gpm canna cjk crypt freewnn ipv6 mmx nls pam perl python ssl tcpd zlib x86 mysql postgres"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -DHAVE_ERRNO_AS_DEFINE=1"
CXXFLAGS="-march=pentium4 -O3 -pipe -DHAVE_ERRNO_AS_DEFINE=1"
ACCEPT_KEYWORDS="x86 ~x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
FEATURES="sandbox ccache"
Comment 4 SpanKY gentoo-dev 2003-03-01 16:23:41 UTC

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