>>> Compiling source in /var/tmp/portage/sys-apps/hwsetup-1.2/work/hwsetup-1.2 ... i686-pc-linux-gnu-gcc -I/usr/include/kudzu -DBLACKLIST -Wall -fPIC -O2 -march=pentium4 -fomit-frame-pointer -pipe -s -o hwsetup hwsetup.c -lkudzu -lpci /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libpci.a(names.o): In function `pci_load_name_list': (.text+0x4a0): undefined reference to `gzopen' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libpci.a(names.o): In function `pci_load_name_list': (.text+0x529): undefined reference to `gzgets' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libpci.a(names.o): In function `.L154': (.text+0x618): undefined reference to `gzclose' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libpci.a(names.o): In function `.L154': (.text+0x635): undefined reference to `gzeof' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libpci.a(names.o): In function `.L154': (.text+0x6bc): undefined reference to `gzclose' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libpci.a(names.o): In function `.L154': (.text+0xa98): undefined reference to `gzopen' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libpci.a(names.o): In function `.L155': (.text+0xc03): undefined reference to `gzerror' /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../libpci.a(names.o): In function `.L155': (.text+0xc25): undefined reference to `gzclose' collect2: ld returned 1 exit status distcc[26691] ERROR: compile hwsetup.c on localhost failed make: *** [hwsetup] Error 1 [ebuild R ] sys-apps/pciutils-2.2.4 0 kB
Adding -lz to the LDFLAGS in src_compile resolves this bug.
It fails also on normal systems: >>> Emerging (1 of 72) sys-apps/hwsetup-1.2 to / * hwsetup_1.2-3.tar.gz MD5 ;-) ... [ ok ] * hwsetup_1.2-3.tar.gz RMD160 ;-) ... [ ok ] * hwsetup_1.2-3.tar.gz SHA1 ;-) ... [ ok ] * hwsetup_1.2-3.tar.gz SHA256 ;-) ... [ ok ] * hwsetup_1.2-3.tar.gz size ;-) ... [ ok ] * checking ebuild checksums ;-) ... [ ok ] * checking auxfile checksums ;-) ... [ ok ] * checking miscfile checksums ;-) ... [ ok ] * checking hwsetup_1.2-3.tar.gz ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking hwsetup_1.2-3.tar.gz to /var/tmp/portage/sys-apps/hwsetup-1.2/work * Applying hwsetup-1.2-dyn_blacklist.patch ... [ ok ] * Applying hwsetup-1.2-fastprobe.patch ... [ ok ] * Applying hwsetup-1.2-gentoo.patch ... [ ok ] >>> Source unpacked. >>> Compiling source in /var/tmp/portage/sys-apps/hwsetup-1.2/work/hwsetup-1.2 ... x86_64-pc-linux-gnu-gcc -I/usr/include/kudzu -DBLACKLIST -Wall -fPIC -march=athlon64 -O2 -pipe -s -o hwsetup hwsetup.c -lkudzu -lpci /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libpci.a(names.o): In function `pci_load_name_list': (.text+0x4e6): undefined reference to `gzopen' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libpci.a(names.o): In function `pci_load_name_list': (.text+0x55f): undefined reference to `gzgets' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libpci.a(names.o): In function `pci_load_name_list': (.text+0x693): undefined reference to `gzclose' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libpci.a(names.o): In function `pci_load_name_list': (.text+0x82f): undefined reference to `gzclose' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libpci.a(names.o): In function `pci_load_name_list': (.text+0x8f3): undefined reference to `gzeof' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libpci.a(names.o): In function `pci_load_name_list': (.text+0xc2a): undefined reference to `gzopen' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libpci.a(names.o): In function `pci_load_name_list': (.text+0xc51): undefined reference to `gzerror' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libpci.a(names.o): In function `pci_load_name_list': (.text+0xc72): undefined reference to `gzclose' collect2: ld returned 1 exit status make: *** [hwsetup] Error 1
# emerge --info Portage 2.1.2_rc4-r7 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.5-r0, 2.6.19-gentoo-r3 x86_64) ================================================================= System uname: 2.6.19-gentoo-r3 x86_64 AMD Athlon(tm) 64 Processor 3500+ Gentoo Base System version 1.12.8 Last Sync: Wed, 10 Jan 2007 17:20:01 +0000 distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [enabled] dev-java/java-config: 1.3.7, 2.0.31 dev-lang/python: 2.4.4 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r6 sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.61 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10 sys-devel/binutils: 2.17 sys-devel/gcc-config: 1.3.14 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.19 ACCEPT_KEYWORDS="amd64 ~amd64" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CFLAGS=" -march=athlon64 -O2 -pipe " CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /opt/jetty/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c" CXXFLAGS=" -march=athlon64 -O2 -pipe " DISTDIR="/home/ftp/distfiles" EMERGE_DEFAULT_OPTS="--with-bdeps y" FEATURES="autoconfig ccache collision-protect cvs distlocks elog java-strict metadata-transfer multilib-strict sandbox sfperms sign strict stricter test userfetch userpriv" GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/ " LANG="it_IT.utf8" LINGUAS="it" PKGDIR="/home/ftp/packages" PORTAGE_RSYNC_EXTRA_OPTS=" --timeout=400 --progress " PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/overlays/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="7zip X a52 aac acl acpi alsa amd64 amr aoss apache2 arts asf audiofile avahi bash-completion berkdb bitmap-fonts bl bzip2 cairo caps ccache cdb cddb cdparanoia cdr chroot cli cpudetection cracklib crypt css cups curl dba dbus devhelp dga directfb djvu dlloader dmi dovecot-sasl dri dts dv dvd dvdr dvdread dynagraph encode epydoc erandom esd exif expat extrafilters fame ffmpeg firefox flac fltk foomaticdb gd gdbm ggi gif gimp gimpprint glibc-omitfp glut gmp gnokii gnome gnutls gphoto2 gpm graphviz gtk gtkhtml guile hal howl-compat iconv idn ieee1394 imagemagick imlib ipv6 isdnlog ithreads java javacomm jbig jikes jpeg jpeg2k justify kde kdeenablefinal kdehiddenvisibility lcms ldap libcaca libg++ libnotify linuxthreads-tls lm_sensors logitech-mouse logrotate lzo mad mailwrapper matroska mbox mdb mhash mikmod mjpeg mmap mng motif mozdevelop mozsvg mp3 mpeg mpm-worker msn musepack musicbrainz mysql ncurses nfs nls nptl nptlonly nsplugin numeric nvidia odbc offensive ogg on-the-fly-crypt openexr opengl oss pam pcre pdf perl php png povray ppds pppd pulseaudio python qa qt3 qt3support qt4 quicktime rdesktop readline reflection restrict-javascript rtc samba scanner sdl session slang smime smp sndfile snmp speex spell spl ssl startup-notification subversion svg sysfs syslog tcltk tcpd test tetex tga theora threads tidy tiff timidity tk truetype truetype-fonts type1-fonts udev unicode usb userlocales utempter v4l v4l2 vcd vda vorbis vorbis-psy wma wmf wmp xcomposite xforms xine xinerama xml xorg xpm xscreensaver xv xvid xvmc yv12 zeroconf zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse evdev keyboard" KERNEL="linux" LINGUAS="it" USERLAND="GNU" VIDEO_CARDS="nvidia nv" Unset: CTARGET, INSTALL_MASK, LC_ALL, LDFLAGS, MAKEOPTS
Looking at that output again, it looks like it's not actually hwsetup that has the problem. It looks like it's libpci's names.o that needs -lz.
Just to be sure, add -lz anyway to LDFLAGS. If it's already linked, it's not a problem. The problem is if it's not linked.
hwsetup sucks ... libpci.a is only a static archive so anything that uses it will need to pull in the libs for pciutils that means you need to add -lz also, hwsetup uses -s in compiling ... you should fix that too
Fixing this is trivial, if you've too much work to do I can commit the changes by myself: --- hwsetup-1.2.ebuild.orig 2007-01-22 11:30:27.000000000 +0100 +++ hwsetup-1.2.ebuild 2007-01-22 11:34:49.000000000 +0100 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-apps/hwsetup/hwsetup-1.2.ebuild,v 1.1 2007/01/05 19:44:46 wolf31o2 Exp $ -inherit eutils toolchain-funcs +inherit eutils toolchain-funcs flag-o-matic MY_PV=${PV}-3 DESCRIPTION="Hardware setup program from Knoppix - used only on LiveCD" @@ -29,7 +29,8 @@ } src_compile() { - emake LDFLAGS="-s ${LDFLAGS}" OPT="${CFLAGS}" CC="$(tc-getCC)" || die "emake failed" + append-ldflags -lz + emake LDFLAGS="${LDFLAGS}" OPT="${CFLAGS}" CC="$(tc-getCC)" || die "emake failed" } src_install() {
I'll try to get to this tomorrow.
Why use append-ldflags for that?
OK... this is FIXED now in CVS... Thanks everyone...