emerge doomlegacy-1.40 fails at link stage due to undefined reference to `errno`. I can fix it by including <errno.h> in linux_x/i_sound.c. Here's a patch: --- linux_x/i_sound.c.orig 2003-03-02 23:48:57.000000000 -0500 +++ linux_x/i_sound.c 2003-03-02 23:49:51.000000000 -0500 @@ -84,6 +84,8 @@ #include <sys/time.h> #include <sys/types.h> +#include <errno.h> + #if !defined(LINUX) && !defined(SCOOS5) && !defined(_AIX) #include <sys/filio.h> #endif @@ -261,7 +263,7 @@ int* arg ) { int rc; - extern int errno; +// extern int errno; rc = ioctl(fd, command, arg); if (rc < 0) Reproducible: Always Steps to Reproduce: 1.emerge doomlegacy 2. 3. Actual Results: undefined reference to `errno' in objs/i_sound.o Portage 2.0.47-r7 (default-x86-1.4, gcc-3.2.2, glibc-2.3.2_pre1-r0) ================================================================= System uname: 2.4.20-gentoo-r1 i686 AMD Athlon(tm) Processor GENTOO_MIRRORS=" ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo ftp://csociety-ftp.ecn.purdue.edu/pub/gentoo/ http://194.83.57.11/sites/www.ibiblio.org/gentoo/" CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb" 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 perl esd -arts -avi -berkdb -crypt -cups -encode -imlib -kde -libg++ -libwww -mikmod -motif -nls -oggvorbis -pam -python -qt -qtmt -sdl -slang -ssl -svga -tcpd -xmms x86 3dnow apm bonobo gdbm gif gnome gpm gtk java jpeg maildir mmx mozilla mpeg ncurses opengl pdflib pic png quicktime readline spell tcltk tetex truetype X xml2 xv zlib" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-march=athlon-tbird -O3 -fomit-frame-pointer -pipe" CXXFLAGS="-march=athlon-tbird -O3 -fomit-frame-pointer -pipe" ACCEPT_KEYWORDS="x86 ~x86" MAKEOPTS="-j2" AUTOCLEAN="yes" SYNC="rsync://rsync.gentoo.org/gentoo-portage" FEATURES="sandbox ccache userpriv usersandbox"
I can also confirm this bug
thats not the only file with 'extern int errno' ;) anyways, i tweaked the ebuild/source/makefile and added changes to cvs ... http://cvs.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-x86/app-games/doomlegacy/doomlegacy-1.40-r1.ebuild?rev=1.1&content-type=text/vnd.viewcvs-markup http://cvs.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-x86/app-games/doomlegacy/files/1.40-errno.patch?rev=1.1&content-type=text/vnd.viewcvs-markup http://cvs.gentoo.org/cgi-bin/viewcvs.cgi/gentoo-x86/app-games/doomlegacy/files/makefile.patch.diff?r1=1.1&r2=1.2