Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 32140 - zlib-1.1.4-r2 compile fails
Summary: zlib-1.1.4-r2 compile fails
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: Everything (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Robert Coie (RETIRED)
URL:
Whiteboard:
Keywords:
: 32580 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-27 16:04 UTC by Andy Hunne
Modified: 2005-03-25 11:24 UTC (History)
7 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 Andy Hunne 2003-10-27 16:04:55 UTC
Found during a bootstrap of new install - zlib-1.1.4-r2 fails to compile, stopping any further attempts at bootstrapping.  Apologies for not having the actual error on compile fail.

Reproducible: Always
Steps to Reproduce:
1.Run bootstrap.sh as per install docs 2. 3.
Actual Results:  
zlib compile fails

Expected Results:  
should have compile fine

the differenc between zlib-1.1.4-r1.ebuild and zlib-1.1.4-r2.ebuild seems to be on line 29 only - r1 has "emake CFLAGS="${CFLAGS} ||  die", wheras r2 only has "emake || die".  No idea if this is related to the actual problem or not.
Comment 1 Andy Hunne 2003-10-27 20:34:32 UTC
I am sorry to say I think I have given the wrong info for this bug.  The
problem appears to be perhaps with the bootstrap.sh script itself, not zlib.
 I think there is an issue with bootstrap.sh compiling gcc with CFLAGS incompatible
with those in make.conf - binutils and other packages are using the flags
from make.conf but the original build of gcc in my case was built with i486
- I have it set to i686 in my make.conf.  Compiling gcc with emerge -o gcc
before bootstrapping seems to have solved the problem of further packages
not compiling.
Comment 2 Simon Cooper 2003-10-28 06:52:43 UTC
I have problems upgrading it on a normal system, non-bootstrapped:

gcc -march=athlon-xp -O3 -pipe -fomit-frame-pointer -ffast-math -fforce-addr
-fprefetch-loop-arrays -ftracer -fnew-ra -falign-functions=16 -falign-labels=1
-falign-loops=16 -falign-jumps=16 -fstack-protector -maccumulate-outgoing-args
-mfpmath=sse,387 -fPIC -DHAVE_UNISTD_H -DHAS_vsnprintf -DHAS_vsnprintf_return
-DUSE_MMAP   -c -o inftrees.o inftrees.c
inftrees.c: In function `huft_build':
inftrees.c:108: internal compiler error: in reloads_to_loads, at ra-rewrite.c:1068
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
gcc -march=athlon-xp -O3 -pipe -fomit-frame-pointer -ffast-math -fforce-addr
-fprefetch-loop-arrays -ftracer -fnew-ra -falign-functions=16 -falign-labels=1
-falign-loops=16 -falign-jumps=16 -fstack-protector -maccumulate-outgoing-args
-mfpmath=sse,387 -fPIC -DHAVE_UNISTD_H -DHAS_vsnprintf -DHAS_vsnprintf_return
-DUSE_MMAP   -c -o infcodes.o infcodes.c
gcc -march=athlon-xp -O3 -pipe -fomit-frame-pointer -ffast-math -fforce-addr
-fprefetch-loop-arrays -ftracer -fnew-ra -falign-functions=16 -falign-labels=1
-falign-loops=16 -falign-jumps=16 -fstack-protector -maccumulate-outgoing-args
-mfpmath=sse,387 -fPIC -DHAVE_UNISTD_H -DHAS_vsnprintf -DHAS_vsnprintf_return
-DUSE_MMAP   -c -o infutil.o infutil.c
Preprocessed source stored into /var/tmp/portage/zlib-1.1.4-r2/temp/ccrVdeEw.out
file, please attach this to your bugreport
make: *** [inftrees.o] Error 1
make: *** Waiting for unfinished jobs....

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


emerge info:
Portage 2.0.49-r15 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r8, 2.6.0-test9)
=================================================================
System uname: 2.6.0-test9 i686 AMD Athlon(tm) XP 2800+
Gentoo Base System version 1.4.3.11
distcc 2.11.2 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -ffast-math -fforce-addr
-fprefetch-loop-arrays -ftracer -fnew-ra -falign-functions=16 -falign-labels=1
-falign-loops=16 -falign-jumps=16 -fstack-protector -maccumulate-outgoing-args
-mfpmath=sse,387"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
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"
CXXFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer -ffast-math -fforce-addr
-fprefetch-loop-arrays -ftracer -fnew-ra -falign-functions=16 -falign-labels=1
-falign-loops=16 -falign-jumps=16 -fstack-protector -maccumulate-outgoing-args
-mfpmath=sse,387"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo
http://ftp.easynet.nl/mirror/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage.local"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 oss apm avi crypt cups encode foomaticdb gif jpeg libg++ libwww
mad mikmod mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms
xv zlib gdbm berkdb slang readline aalib svga java X sdl gpm tcpd pam ssl
python esd imlib oggvorbis gtk qt motif opengl 3dnow acpi alsa -arts cdr
directfb dvd fbcon -gnome imap -kde mozilla perl samba sse tcltk usb"
Comment 3 eric sammer 2003-10-28 16:42:52 UTC
I can confirm this problem on a stage1 install from the newest LiveCD with
the stage1 tarball from the cd itself. The problem is the zlib compilation
error (relocation error / undefined symbol xmalloc_set_program_name from
the assembler. The hardware is a IBM eServer x205 / P4 2Gh / 256m ram with
Intel chipsets (IIRC). The following is the CFLAGS and USE flags. This is
during the boostrap process of the install:

CHOST="i686-pc-linux-gnu"
USE="acpi curl imap jikes junit objc sasl sse -oss -arts -avi -foomaticdb
-gtk -imlib -kde -gnome -mad -mikmod -motif -mpeg -oggvorbis -opengl -qt
-quicktime -sdl -truetype -X -xmms -xv -gpm"
CFLAGS="-O3 -mcpu=pentium3 -pipe"
CXXFLAGS="${CFLAGS}"

(-mcpu=pentium3 set to P3 instead of P4 due to invalid instruction set bug)

Here's the output of emerge info:

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.21-gss)
=================================================================
System uname: 2.4.21-gss i686 Intel(R) Pentium(R) 4 CPU 2.00GHz
Gentoo Base System version 1.4.3.8p1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -mcpu=pentium3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
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"
CXXFLAGS="-O3 -mcpu=pentium3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo ftp://gentoo.mirrors.pair.com/
http://adelie.polymtl.ca/ ftp://ftp.ussg.iu.edu/pub/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 apm berkdb crypt cups encode gdbm gif jpeg libg++ libwww ncurses
nls pam pdflib png python readline slang spell ssl svga tcpd xml2 zlib acpi
curl imap jikes junit objc sasl sse -oss -arts -avi -foomaticdb -gtk -imlib
-kde -gnome -mad -mikmod -motif -mpeg -oggvorbis -opengl -qt -quicktime -sdl
-truetype -X -xmms -xv -gpm"

Sorry for the long comment and wrapping issues.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-29 12:07:05 UTC
Bootstrap seems ok when gcc was compiled for i586 (not livecd, but stage1
tarball).

As for the later errors in running systems - what version gcc are you using
(version and revision please) ?
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-29 13:02:54 UTC
Please try -r3.
Comment 6 Anders Kallander 2003-10-29 15:10:16 UTC
If you try to restart the bootstrap process after zlib-1.1.4-r2 fails, you
will
get the broken pipe error on portage-2.0.49-r15 to:

  cc1: Broken pipe: error writing to -
  make: *** [libsandbox.o] Error 1

  !!! ERROR: sys-apps/portage-2.0.49-r15 failed.
  !!! Function src_compile, Line 32, Exitcode 2
  !!! (no error message)

I'm using the x86-basic-1.4-20030911 install cd. I used it last week and
it went fine, today (with the same USE, CHOST, CFLAGS and the same computer)
it fails.
Comment 7 David Ripton 2003-10-29 18:45:11 UTC
sys-libs/zlib-1.1.4-r3 fails for me, just like -r2.

I get:

./libz.a(gzio.o)(.text+0x1e4): In function `check_header':
: undefined reference to `errno'

Trivial fix:

--- gzio.c.orig 2003-10-29 21:41:10.306186790 -0500
+++ gzio.c      2003-10-29 21:41:19.312411820 -0500
@@ -8,6 +8,7 @@
 /* @(#) $Id$ */

 #include <stdio.h>
+#include <errno.h>

 #include "zutil.h"
Comment 8 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-29 20:34:17 UTC
David, your problem is another matter I am afraid, but Ill add the fix later
on.
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2003-10-31 21:30:36 UTC
-- Comments Rac added to bootstrap.sh --

# We used to call emerge once, but now we call it twice. Why? Because gcc
may
# have been built to use a different LDPATH. We want subsequent packages
merged
# to pick up any new gcc libraries. Breaking the emerge after gcc should
allow
# this to happen. This *should* allow issues like the following to be fixed
(as
# of 30 Oct 2003, whether this fixes the issue in this forums post is
# unconfirmed):
#
# http://forums.gentoo.org/viewtopic.php?t=100263
#
# If you have questions or information about this change, like whether this
# fixed or didn't fix the "zlib undefined symbol: xmalloc_set_program_name"
# issue, please email rac@gentoo.org, drobbins@gentoo.org and
# azarah@gentoo.org.
                                                                        
                                                    
# rac 2003.10.31
# addendum - now it's three times, with a clean in the middle.
# failure to do this was causing two sets of binutils to hang around,
# and if they had different targets, the /usr/bin symlinks get
# confused.
--
Ok, Rac sorda hit the nail for the problem, but not the real reason.  If
you look at the following:

--
nosferatu root # gcc -print-search-dirs
install: /usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/
programs:
=/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/:/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/:/usr/lib/gcc-lib/i486-pc-linux-gnu/:/usr/lib/gcc/i486-pc-linux-gnu/3.2.3/:/usr/lib/gcc/i486-pc-linux-gnu/:/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../../i486-pc-linux-gnu/bin/i486-pc-linux-gnu/3.2.3/:/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../../i486-pc-linux-gnu/bin/
libraries:
=/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/:/usr/lib/gcc/i486-pc-linux-gnu/3.2.3/:/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../../i486-pc-linux-gnu/lib/i486-pc-linux-gnu/3.2.3/:/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../../i486-pc-linux-gnu/lib/:/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../i486-pc-linux-gnu/3.2.3/:/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../:/lib/i486-pc-linux-gnu/3.2.3/:/lib/:/usr/lib/i486-pc-linux-gnu/3.2.3/:/usr/lib/
--

You will realise that even with the new binutils merged, and the symlinks
proper:

--
nosferatu root # ls /usr/bin/{ld,as} -l
lrwxrwxrwx    1 root     root           27 Oct 31 23:59 /usr/bin/as -> ../i686-pc-linux-gnu/bin/as
lrwxrwxrwx    1 root     root           27 Oct 31 23:59 /usr/bin/ld -> ../i686-pc-linux-gnu/bin/ld
nosferatu root #
--

you will still get:

--
nosferatu root # gcc -o test test.c
/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../../i486-pc-linux-gnu/bin/as:
relocation error:
/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../../i486-pc-linux-gnu/bin/as:
undefined symbol: xmalloc_set_program_name
nosferatu root #
--

as gcc looks in
/usr/lib/gcc-lib/i486-pc-linux-gnu/3.2.3/../../../../i486-pc-linux-gnu/bin/
before it does so in /usr/bin ....

If we now have both the i486 and i686 versions exactly the same release version
(say 2.14.90.0.6), but different revisions (-r2 vs -r6 for instance), both
installs exactly same libraries to /usr/lib, and because the revisions differ,
it is not auto unmerged, and the i486 version now use libbfd that was installed
by the i686 version, causing it to break as above:

--
nosferatu root # ldd /usr/i486-pc-linux-gnu/bin/as
        libbfd-2.14.90.0.6.so => /usr/lib/libbfd-2.14.90.0.6.so (0x40015000)
        libc.so.6 => /lib/libc.so.6 (0x400b4000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
nosferatu root # ldd /usr/i686-pc-linux-gnu/bin/as
        libbfd-2.14.90.0.6.so => /usr/lib/libbfd-2.14.90.0.6.so (0x40015000)
        libc.so.6 => /lib/libc.so.6 (0x400b4000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
nosferatu root #
--

Thus the fix is fine, we just need to update the comment ...
Comment 10 Clemens Schwaighofer 2003-10-31 23:47:36 UTC
okay, I stumbeld in exactly the same problem, except that I used the same
live CD to install Gentoo on the exactly same PC around 3 weeks ago. but
at that time everything worked fine. so perhaps just the changes in the basic
bootstrap script and/or other problems in zlib might be the reason.
I will try to build with i586 and see if I get the same error
Comment 11 SpanKY gentoo-dev 2003-11-03 11:31:58 UTC
*** Bug 32580 has been marked as a duplicate of this bug. ***
Comment 12 George Plymale 2003-11-14 21:51:29 UTC
Not sure if this is connected, but it seems that it may be.  I have just installed from stage3 successfully and ran `CONFIG_PROTECT="-*" emerge -u system` to update my system.  Once the build gets to zlib-1.1.4-r4, I receive the following error:

gcc -O3 -mcpu=i686 -funroll-loops -pipe -DNO_ERRNO_H -o minigzip minigzip.o -L. -lz
./libz.so: undefined reference to `errno'
collect2: ld returned 1 exit status
Comment 13 George Plymale 2003-11-15 07:10:01 UTC
A continuation of my previous report:

I changed optimizations from `-mcpu=i686' to `-march=i686' and it compiles fine now.  So now my make.conf reads:

CFLAGS="-O3 -march=i686 -funroll-loops -pipe"

What is causing the original to fail?

(Leaving i686 as I must transplant the hard drive later from an Intel to an AMD system.)
Comment 14 tommy_fila 2004-01-05 11:34:38 UTC
While trying to do an "emerge -u portage" I ran into the same error. Here is all the information I have:

This is an exact replica of my error message:

ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
gcc -O3 -march=pentium2 -fprefetch-loop-arrays -funroll-loops -pipe -fPIC -DNO_ERRNO_H -o example example.o -L. -lz
gcc -O3 -march=pentium2 -fprefetch-loop-arrays -funroll-loops -pipe -fPIC -DNO_ERRNO_H -o minigzip minigzip.o -L. -lz
../libz.a(gzio.o)(.text+0x34e): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x3b2): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x41c): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x488): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x4f4): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x560): more undefined references to `errno' follow
collect2: ld returned 1 exit status
/libz.a(gzio.o)(.text+0x34e): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x3b2): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x41c): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x488): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x4f4): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x560): more undefined references to `errno' follow
collect2: ld returned 1 exit status
make: *** [minigzip] Error 1
make: *** Waiting for unfinished jobs....
make: *** [example] Error 1

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

This is my emerge --info:

Portage 2.0.49-r4 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.20-gentoo-r6)
=================================================================
System uname: 2.4.20-gentoo-r6 i686 Celeron (Coppermine)
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=pentium2 -fprefetch-loop-arrays -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/share/config /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -march=pentium2 -fprefetch-loop-arrays -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="sandbox ccache autoaddcvs"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 oss apm avi crypt cups encode foomaticdb gif gpm gtk2 jpeg libg++ libwww mad mikmod mpeg ncurses nls pdflib png quicktime slang spell truetype xml2 xmms xv zlib directfb gdbm berkdb readline arts bonobo svga java mysql postgres X sdl tcpd pam ssl perl python esd imlib oggvorbis motif opengl mozilla cdr qt kde -gnome -gtk"

I have tried all the possible solutions mentioned here and at the Gentoo Forums. I would be very grateful if this bug is finally resolved as it seems to be bothering many other people.
Comment 15 Andre Hinrichs 2004-02-13 05:59:20 UTC
Now ran into same problem with latest unmasked version 1.1.4-r2
Couldn't compile 1.1.4-r3 or 1.1.4-r4 either.
Here is the compile log...

ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
gcc -O3 -march=i686 -funroll-loops -pipe -fPIC -DNO_ERRNO_H -o example example.o -L. -lz
./libz.a(gzio.o)(.text+0x34e): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x3b2): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x41c): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x488): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x4f4): In function `check_header':
: undefined reference to `errno'
./libz.a(gzio.o)(.text+0x560): more undefined references to `errno' follow
collect2: ld returned 1 exit status
distcc[8368] ERROR: compile on localhost failed
make: *** [example] Error 1
make: *** Waiting for unfinished jobs....

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


Portage 2.0.50-r1 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r9, 2.4.20-xfs_pre6)
=================================================================
System uname: 2.4.20-xfs_pre6 i686
Gentoo Base System version 1.4.3.13
distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
Autoconf: sys-devel/autoconf-2.58
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -march=i686 -funroll-loops -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -march=i686 -funroll-loops -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distcc sandbox"
GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://192.168.68.1/gentoo-portage"
USE="X Xaw3d aalib alsa apache2 apm arts avi berkdb bonobo cdr crypt cups curl dvd emacs encode esd flash foomaticdb gd gdbm ggi gif gnome gpm gtk gtk2 gtkhtml guile imlib java jpeg kde lcms ldap libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd tetex tiff truetype usb wmf x86 xml xml2 xmms xv zlib"
Comment 16 Robert Coie (RETIRED) gentoo-dev 2004-02-18 00:26:26 UTC
People with the errno problems, you all have -DNO_ERRNO_H in your compile lines.
The test for the presence of errno.h is failing.  Look in config.log to try to
find out why.
Comment 17 Gerard Korsten 2004-03-01 14:55:33 UTC
Getting the same issue with a emerge -update system....

What I find interesting is the following, is when Emerge does a configure it give the following warnings/errors...
---->>>>
Checking for shared library support...
Building shared library libz.so.1.1.4 with gcc.
Checking for unistd.h... No.
Checking whether to use vsnprintf() or snprintf()... using snprintf()
Checking for snprintf() in stdio.h... No.
  WARNING: snprintf() not found, falling back to sprintf().  zlib
  can build but will be open to possible buffer-overflow security
  vulnerabilities.  See README.vsnprintf for more info.

Checking for return value of sprintf()... No.
  WARNING: apparently sprintf() does not return a value.  zlib
  can build but will be open to possible string-format security
  vulnerabilities.  See README.vsnprintf for more info.
---->>>>

But, when I do the ./configure on the same directory work directory of zlib, then it gives me the following.
--->>>
Building static library libz.a version 1.1.4 with gcc.
Checking for unistd.h... Yes.
Checking whether to use vsnprintf() or snprintf()... using vsnprintf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h...  Yes.
Checking for mmap support... Yes.
--->>>

Nice and clean... I'm also then able to do a make && make test on this, without it bombing.... 

What this is telling me is that there is some enviroment setting that configure is using that I just can't figure out, and it's unable to include <errno.h>... I've tried forcing the libdir and includedir in the ebuild file, but my knowledge on the ebuild system isn't sufficient....

Any Ideas what the cause for the different ./configure outputs could be...
Comment 18 Gerard Korsten 2004-03-02 00:56:41 UTC
Still don't know what the underlying cause is, but...

I emerged glibc and it updated from glibc 2.3.2-r1 to glibc 2-3.2-r9, and now I'm able to do a emege zlib-1.1.4-r2 without a problem...

Just a bit of history: I installed my machine from stage-3, and this was the first time I did a emeger -update world... So, it looks like the glibc coming with stage-3 might be inconsistent/buggy, and needs updating right after the machine has been built... (Well, in my case at least)
Comment 19 Meder Bakirov 2004-03-03 03:57:05 UTC
My bootstrap-2.6 also failed emerging sys-libs/zlib-1.2.1-r2 with the following error messages:

>>> md5 src_uri ;-) zlib-1.2.1.tar.bz2
>>> Unpacking source...
>>> Unpacking zlib-1.2.1.tar.bz2 to /var/tmp/portage/zlib-1.2.1-r2/work
 * Applying zlib-1.2.1-glibc.patch...                                                                                [ ok ]
 * Applying zlib-1.2.1-build-fPIC.patch...                                                                           [ ok ]
 * Applying zlib-1.2.1-mapfile.patch...                                                                              [ ok ]
>>> 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... No.
  WARNING: snprintf() not found, falling back to sprintf(). zlib
  can build but will be open to possible buffer-overflow security
  vulnerabilities.
Checking for return value of sprintf()... No.
  WARNING: apparently sprintf() 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 -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o example.o example.c
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o adler32.o adler32.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o compress.o compress.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o crc32.o crc32.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o gzio.o gzio.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o uncompr.o uncompr.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o deflate.o deflate.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o trees.o trees.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o zutil.o zutil.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o inflate.o inflate.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o infback.o infback.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o inftrees.o inftrees.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o inffast.o inffast.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H   -c -o minigzip.o minigzip.c
cc1: warning: SSE instruction set disabled, using 387 arithmetics
ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
gcc -march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -o example example.o -L. libz.a
libz.a(gzio.o)(.text+0x3b): In function `check_header':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x2e9): In function `check_header':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x34b): In function `check_header':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x3b5): In function `check_header':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x422): In function `check_header':
: undefined reference to `errno'
libz.a(gzio.o)(.text+0x48f): more undefined references to `errno' follow
collect2: ld returned 1 exit status
make: *** [example] Error 1
make: *** Waiting for unfinished jobs....

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

cdimage portage # emerge --info
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.4.21-gss)
=================================================================
System uname: 2.4.21-gss i686 AMD Athlon(tm)
Gentoo Base System version 1.4.3.8p1
Autoconf:
Automake:
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon -O3 -mfpmath=sse -fforce-addr -fomit-frame-pointer -funroll-loops -funroll-all-loops -fprefetch-loop-arrays -maccumulate-outgoing-args -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://81.88.192.4/pub/gentoo/portage ftp://gentoo.linux.no/pub/gentoo/ http://gentoo.linux.no/ http://mirror.gentoo.ru/pub/mirror/gentoo/ rsync://mirror.gentoo.ru/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://81.88.192.4/gentoo-portage"
USE="3dnow acpi alsa arts avi berkdb crypt cups dga fbcon gd gdbm gif gpm imap java jpeg kde ldap lesstif maildir mmx mpeg ncurses nls nptl oggvorbis opengl pam png qt quicktime readline samba slang snmp spell sse ssl svga tiff truetype unicode x86 xml xml2 xmms zlib"

cdimage portage #
Comment 20 Meder Bakirov 2004-03-11 07:39:17 UTC
Hmm, I don't know, what was the cause, but bootstrap and emerge system completed without any errors (except iputils (it needs autoconf and flex)) in zlib after I removed "-mfpmath=sse" from my CFLAGS.
Comment 21 Andrew Cooks 2004-08-08 01:20:09 UTC
This bug has been inactive for more than 90 days.

It doesn't look like this bug is still reproduceable and/or relevant to me, in fact, it looks like it's been fixed. Can it be closed as FIXED?
Comment 22 SpanKY gentoo-dev 2004-08-08 13:52:50 UTC
1.2.1-r2 is our stable zlib now

re-open if that one still has issues (and include updated information about your system in that case)
Comment 23 Chris Gianelloni (RETIRED) gentoo-dev 2005-03-25 11:24:33 UTC
Moving these so we can remove the "Install CD" component from "Gentoo Linux".

I apologize to everyone for this spam, but according to the bugzilla developers,
this is the only reasonable way to do this.