Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 291987 - media-libs/netpbm-10.46.00-r1 fails to correctly link against zlib with "undefined reference to `zlibVersion'"
Summary: media-libs/netpbm-10.46.00-r1 fails to correctly link against zlib with "unde...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo Graphics Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-05 15:26 UTC by Marcin Marszalek
Modified: 2009-12-12 15:58 UTC (History)
0 users

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


Attachments
build.log (build.log,178.96 KB, text/plain)
2009-11-09 20:30 UTC, Marcin Marszalek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Marszalek 2009-11-05 15:26:42 UTC
I experience a similar problem to already reported in closed http://bugs.gentoo.org/161813  This time the problem concerns media-libs/netpbm-10.46.00-r1. Emerging netpbm fails with a linking error, probably due to missing -lz. Reemerging libpng did not help.


Reproducible: Always

Steps to Reproduce:
1. emerge netpbm
Actual Results:  
x86_64-pc-linux-gnu-gcc -Wall -o pnmtopng pnmtopng.o pngtxt.o -L/var/tmp/portage/media-libs/netpbm-10.46.00-r1/work/netpbm-10.46.00/lib -lnetpbm -L/usr/lib64 -lpng12 -lm -Wl,-O1
pnmtopng.o: In function `main':
pnmtopng.c:(.text+0x4719): undefined reference to `zlibVersion'


Expected Results:  
netpbm should build.

marcin@marcade ~ $ gcc -print-file-name=libpng12.so
/projects/metapkg/arch/x86_64/lib/gcc/x86_64-unknown-linux-gnu/4.4.1/../../../../lib64/libpng12.so
marcin@marcade ~ $ readelf -d /projects/metapkg/arch/x86_64/lib/gcc/x86_64-unknown-linux-gnu/4.4.1/../../../../lib64/libpng12.so

Dynamic section at offset 0x244d0 contains 25 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x000000000000000e (SONAME)             Library soname: [libpng12.so.0]
 0x000000000000000c (INIT)               0x3f70
 0x000000000000000d (FINI)               0x1e2b8
 0x0000000000000004 (HASH)               0x158
 0x0000000000000005 (STRTAB)             0x1eb8
 0x0000000000000006 (SYMTAB)             0x838
 0x000000000000000a (STRSZ)              4221 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x2247c8
 0x0000000000000002 (PLTRELSZ)           2640 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x3520
 0x0000000000000007 (RELA)               0x3190
 0x0000000000000008 (RELASZ)             912 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffffc (VERDEF)             0x3118
 0x000000006ffffffd (VERDEFNUM)          2
 0x000000006ffffffe (VERNEED)            0x3150
 0x000000006fffffff (VERNEEDNUM)         2
 0x000000006ffffff0 (VERSYM)             0x2f36
 0x000000006ffffff9 (RELACOUNT)          27
 0x0000000000000000 (NULL)               0x0
Comment 1 Marcin Marszalek 2009-11-05 15:26:59 UTC
marcade ~ # emerge --info                                                                                      
Portage 2.1.6.13 (default/linux/amd64/10.0, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.30.4 x86_64)                
=================================================================                                              
System uname: Linux-2.6.30.4-x86_64-Intel-R-_Xeon-R-_CPU_E5430_@_2.66GHz-with-gentoo-1.12.13                   
Timestamp of tree: Thu, 05 Nov 2009 14:30:01 +0000                                                             
app-shells/bash:     4.0_p28                                                                                   
dev-java/java-config: 2.1.9-r1                                                                                 
dev-lang/python:     2.5.4-r3, 2.6.2-r1                                                                        
dev-util/cmake:      2.6.4                                                                                     
sys-apps/baselayout: 1.12.13                                                                                   
sys-apps/sandbox:    1.6-r2                                                                                    
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl alsa amd64 apache2 arts audiofile bash-completion bcmath berkdb blas bzip2 cairo cdr clamav cli cracklib crypt css cups curl cvs cxx dbus dga directfb djvu doc dri dts dv dvb dvd dvdr encode expat fam ffmpeg firefox flac fortran ftp gd gdbm geoip gif gimp ginac glut gmp gnuplot gnutls gphoto2 gpm gps graphviz gsl gstreamer gtk gzip hdf5 iconv imagemagick imap imlib ipv6 jpeg jpeg2k kde lame lapack latex lcms lm_sensors lzo mad matroska mhash mmap mmx mng modules mp3 mpeg mpi mplayer mudflap multilib ncurses nls nptl nptlonly ogg openal openexr opengl openmp pam pcntl pcre pdf perl php plotutils png pppd python qt3 qt3support qt4 raw readline recode reflection rss sdl session sharedmem simplexml slang smp sndfile snmp sockets sox spell spl sse sse2 ssl subversion svg sysfs syslog sysvipc tcpd theora threads tiff truetype unicode usb vorbis wxwindows x264 xml xorg xpm xsl xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 2 Rafał Mużyło 2009-11-06 01:37:12 UTC
Attach build.log (probably config.log too).
Comment 3 Marcin Marszalek 2009-11-09 20:30:42 UTC
Created attachment 209768 [details]
build.log
Comment 4 Marcin Marszalek 2009-11-09 20:33:45 UTC
I attached the build.log. There seems to be no config.log. At least the following returns nothing:

find /var/tmp/portage/media-libs/netpbm-10.46.00-r1 -name config.log

Did I miss something?
Comment 5 Marcin Marszalek 2009-11-10 13:14:00 UTC
The problem seems to be the following:

1) In the Makefile:

ifeq ($(shell libpng-config --version),)
  PNGLIB_LIBOPTS = $(shell $(LIBOPT) $(LIBOPTR) $(PNGLIB) $(ZLIB))
else
  PNGLIB_LIBOPTS = $(shell libpng-config --ldflags)
endif

which means that ZLIB is only used when the flags cannot be obtained using "libpng-config --ldflags".

2) At the same time on my machine:

marcade other # libpng-config --ldflags
-L/usr/lib64 -lpng12
marcade other # ldd /usr/lib64/libpng12.so
        linux-vdso.so.1 =>  (0x00007fff1c1ff000)
        libm.so.6 => /lib/libm.so.6 (0x00007fe534169000)
        libc.so.6 => /lib/libc.so.6 (0x00007fe533e14000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe534658000)

which means that libpng does not really need zlib by itself.

3) The linker error comes from pnmtopng.c itself:

pnmtopng.c:(.text+0x4719): undefined reference to `zlibVersion'

4) So it really seems to be an upstream problem, do you confirm?