Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55434 - Cannot emerge (compile) libz with distcc - undefined reference to `errno'
Summary: Cannot emerge (compile) libz with distcc - undefined reference to `errno'
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-28 08:54 UTC by Honza
Modified: 2004-07-01 19:59 UTC (History)
1 user (show)

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


Attachments
zlib-1.2.1-configure.patch (zlib-1.2.1-configure.patch,3.08 KB, patch)
2004-06-29 15:59 UTC, SpanKY
Details | Diff
zlib-1.2.1-r2.ebuild.patch (zlib-1.2.1-r2.ebuild.patch,448 bytes, patch)
2004-06-29 16:00 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Honza 2004-06-28 08:54:54 UTC
Cannot emerge (compile) libz (sys-libs/zlib-1.2.1-r2) with distcc (sys-devel/distcc-2.13-r1) - undefined reference to `errno'

Reproducible: Always
Steps to Reproduce:
1. forget to run distccd at first computer in list
2. emerge libz


Actual Results:  
>>> Source unpacked.
Checking for shared library support...
No shared library support; try without defining CC and CFLAGS
Building static library libz.a version 1.2.1 with gcc.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()
Checking for snprintf() in stdio.h... Yes.
Checking for return value of snprintf()... No.
  WARNING: apparently snprintf() does not return a value. zlib
  can build but will be open to possible string-format security
  vulnerabilities.
Checking for errno.h... No.
Checking for mmap support... No.
...
gcc -O2 -mcpu=athlon -march=i686 -fomit-frame-pointer -pipe -DHAS_snprintf_void
-DNO_ERRNO_H -o minigzip minigzip.o -L. libz.a
libz.a(gzio.o)(.text+0x1cb): In function `gz_open':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x4b4): In function `get_byte':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x550): In function `check_header':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x92c): In function `gzread':
: undefined reference to `errno'
collect2: ld returned 1 exit status
distcc[25309] ERROR: compile on localhost failed
make: *** [minigzip] Error 1
make: *** Waiting for unfinished jobs....
libz.a(gzio.o)(.text+0x1cb): In function `gz_open':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x4b4): In function `get_byte':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x550): In function `check_header':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x92c): In function `gzread':
: undefined reference to `errno'
collect2: ld returned 1 exit status
distcc[25308] ERROR: compile on localhost failed
make: *** [example] Error 1

!!! ERROR: sys-libs/zlib-1.2.1-r2 failed.
!!! Function src_compile, Line 32, Exitcode 2
!!! (no error message)


Expected Results:  
Install zlib of course.

In fact, problem is with distcc - distcc report some error about Connection
refused and running locally in configure and zlib thinks it means test failed.

After executing distccd at first computer in list, zlib emerged without problem.

Portage 2.0.50-r8 (default-x86-2004.0, gcc-3.3.2, glibc-2.3.2-r9, 2.4.26)
=================================================================
System uname: 2.4.26 i686 AMD Duron(tm) Processor
Gentoo Base System version 1.4.16
distcc 2.13 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=athlon -march=i686 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config /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/bind
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -mcpu=athlon -march=i686 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distcc sandbox"
GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/
http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/mnt/hda04/gentoo-var-tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aalib apache2 apm arts avi berkdb caps cdr crypt cups curl
dga doc dvd encode esd flac foomaticdb gd gdbm gif gpm gtk gtk2 imagemagick
imlib innodb ipv6 java jpeg lcms lesstif libg++ libwww mad mbox mcal memlimit
mikmod mmx mng motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam
pdflib perl png python qt quicktime readline samba sdl slang snmp spell sqlite
sse ssl svga tcltk tcpd tetex theora tiff truetype unicode usb vhosts videos wmf
x86 xml xml2 xmms xosd xv zlib"
Comment 1 Lisa Seelye (RETIRED) gentoo-dev 2004-06-28 13:20:46 UTC
Do you have the same version of GCC on all of the machines being used to compile?
Comment 2 Honza 2004-06-29 04:17:01 UTC
Yes, I have. Only localhost was used to compile, because, as I already said, I forget to run distccd on all computers in /etc/distcc/hosts. Problem is, when distcc can't connect to first computer, it write error message to stdout. And configure script from zlib take this as proof that compile failed and therefore tested feature is not available. And finnaly, when errno.h is misdetected, zlib cannot be linked.

In fact, I don't know if there is some resolution possible, because all component behaves right and only combination is problem. Maybee some warning in documentation or test with warning on begin of emerge, to shorten problem-searching time. Or some -Wno-connect-problem flag for distcc.
Comment 3 Lisa Seelye (RETIRED) gentoo-dev 2004-06-29 07:47:20 UTC
Can you post the config.log as an attachment?
Comment 4 Honza 2004-06-29 09:10:38 UTC
No, I can't. But I have a very good excuse. Zlib's configure did NOT create config.log or any other log file. It's not autoconf's configure, it's their own script.

I already post what is reason for bug. Problem is in following lines in configure script (it's line 391 and later):

if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
  echo "Checking for errno.h... Yes."
else
  echo "Checking for errno.h... No."
  CFLAGS="$CFLAGS -DNO_ERRNO_H"
fi                                                                                                                                            
Comment 5 Lisa Seelye (RETIRED) gentoo-dev 2004-06-29 13:35:35 UTC
Excellent.

I'll send this over to base-system for patching.  For now I suggest removing the "dead" hosts and compiling again (you probably have, but yeah...).
Comment 6 SpanKY gentoo-dev 2004-06-29 15:57:40 UTC
seems to be a bunch of these bad tests in the configure script ...
Comment 7 SpanKY gentoo-dev 2004-06-29 15:59:07 UTC
Created attachment 34452 [details, diff]
zlib-1.2.1-configure.patch
Comment 8 SpanKY gentoo-dev 2004-06-29 16:00:19 UTC
Created attachment 34453 [details, diff]
zlib-1.2.1-r2.ebuild.patch

please try out these two patches and see if they fix your problem
Comment 9 Honza 2004-07-01 05:19:17 UTC
Lisa Seelye: no. I simply resurrect that dead host :-).

So testing stderr IS bug ...
Comment 10 Honza 2004-07-01 05:41:51 UTC
I tested provided patches. It emerges and I didn't notice any sign of other problem.
But all replies is "Yes", so "if true" would have same effect ...

BTW, is there any possible package name between zlib-1.2.1-r2.ebuild and zlib-1.2.1-r3.ebuild ?
Comment 11 SpanKY gentoo-dev 2004-07-01 19:59:51 UTC
added to cvs

i dont see a 1.2.1-r3 anywhere so i dont know what you're refering to ;)