Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 494404 - media-libs/libpng-1.6.7 - /usr/lib/libpng16.so.16: undefined reference to `inflateReset2@ZLIB_1.2.3.4'
Summary: media-libs/libpng-1.6.7 - /usr/lib/libpng16.so.16: undefined reference to `in...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 559176 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-16 00:20 UTC by Kroz
Modified: 2015-09-10 00:48 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,190.22 KB, text/plain)
2013-12-16 00:20 UTC, Kroz
Details
Output of `emerge -pqv '=net-p2p/transmission-2.82-r3::gentoo'` (emerge-pqv.txt,100 bytes, text/plain)
2013-12-16 00:21 UTC, Kroz
Details
Output of `emerge --info '=net-p2p/transmission-2.82-r3::gentoo'` (emerge_info.txt,5.40 KB, text/plain)
2013-12-16 00:22 UTC, Kroz
Details
Content of '/var/tmp/portage/net-p2p/transmission-2.82-r3/temp/environment' (environment,131.88 KB, text/plain)
2013-12-16 00:23 UTC, Kroz
Details
Build log of zlib-1.2.8-r1 (buildlog_zlib-1.2.8-r1.txt,22.21 KB, text/plain)
2014-01-10 00:27 UTC, Kroz
Details
Output of `readelf -Ws /lib*/libz.so.1` (realelf_libz.so.1.txt,7.64 KB, text/plain)
2014-01-10 00:28 UTC, Kroz
Details
Build log of libpng-1.5.17-r1 (1.5_buildlog_libpng-1.5.17-r1.txt,21.90 KB, text/plain)
2014-01-10 00:29 UTC, Kroz
Details
Build log of libpng-1.6.8 (1.6_buildlog_libpng-1.6.8.txt,27.84 KB, text/plain)
2014-01-10 00:30 UTC, Kroz
Details
Output of `readelf libpng15.so.15.17.0` (1.5_readelf_libpng15.so.15.17.0.txt,22.41 KB, text/plain)
2014-01-10 00:32 UTC, Kroz
Details
Output of `readelf libpng16.so.16.8.0` (1.6_readelf_libpng16.so.16.8.0.txt,23.65 KB, text/plain)
2014-01-10 00:33 UTC, Kroz
Details
Output of `readelf -d /usr/lib/libpng16.so.16.8.0` (realelf-d_libpng16.so.16.8.0.txt,3.89 KB, text/plain)
2014-01-11 17:20 UTC, Kroz
Details
Output of ` echo 'main(){}' | gcc -x c - -o a.out -lz -Wl,--verbose ' (gcc.txt,10.92 KB, text/plain)
2014-01-11 17:21 UTC, Kroz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kroz 2013-12-16 00:20:54 UTC
Created attachment 365444 [details]
build.log

Cannot install net-p2p/transmission-2.82-r3 :

Error message:

i686-pc-linux-gnu-g++ -Wl,-O1 -Wl,--as-needed -o transmission-qt about.o add-data.o app.o dbus-adaptor.o details.o favicon.o file-tree.o filterbar.o filters.o freespace-label.o formatter.o hig.o license.o mainwin.o make-dialog.o options.o prefs.o prefs-dialog.o relocate.o session.o session-dialog.o squeezelabel.o stats-dialog.o torrent.o torrent-delegate.o torrent-delegate-min.o torrent-filter.o torrent-model.o tracker-delegate.o tracker-model.o tracker-model-filter.o triconpushbutton.o utils.o watchdir.o moc_about.o moc_app.o moc_dbus-adaptor.o moc_details.o moc_favicon.o moc_file-tree.o moc_filterbar.o moc_freespace-label.o moc_formatter.o moc_hig.o moc_license.o moc_mainwin.o moc_make-dialog.o moc_options.o moc_prefs.o moc_prefs-dialog.o moc_relocate.o moc_session.o moc_session-dialog.o moc_squeezelabel.o moc_stats-dialog.o moc_torrent.o moc_torrent-delegate.o moc_torrent-delegate-min.o moc_torrent-filter.o moc_torrent-model.o moc_tracker-delegate.o moc_tracker-model.o moc_tracker-model-filter.o moc_triconpushbutton.o moc_utils.o moc_watchdir.o qrc_application.o    -L/usr/lib/qt4 ../libtransmission/libtransmission.a ../third-party/libutp/libutp.a ../third-party/dht/libdht.a -lminiupnpc -lnatpmp -L/lib -lz -lrt -lfontconfig -lfreetype -lcurl -lssl -lcrypto -levent -lQtDBus -L/usr/lib/qt4 -lQtXml -lQtGui -L/usr/X11R6/lib -lQtNetwork -lQtCore -lgthread-2.0 -lglib-2.0 -lpthread 
/usr/lib/libpng16.so.16: undefined reference to `inflateReset2@ZLIB_1.2.3.4'
collect2: error: ld returned 1 exit status
Makefile:239: recipe for target 'transmission-qt' failed
make: *** [transmission-qt] Error 1
 * ERROR: net-p2p/transmission-2.82-r3::gentoo failed (compile phase):
 *   emake failed
Comment 1 Kroz 2013-12-16 00:21:57 UTC
Created attachment 365446 [details]
Output of `emerge -pqv '=net-p2p/transmission-2.82-r3::gentoo'`
Comment 2 Kroz 2013-12-16 00:22:28 UTC
Created attachment 365448 [details]
Output of `emerge --info '=net-p2p/transmission-2.82-r3::gentoo'`
Comment 3 Kroz 2013-12-16 00:23:09 UTC
Created attachment 365450 [details]
Content of '/var/tmp/portage/net-p2p/transmission-2.82-r3/temp/environment'
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-16 12:34:54 UTC
You probably just need to re-emerge media-libs/libpng.
Comment 5 Kroz 2013-12-16 20:05:50 UTC
Re-emerging media-libs/libpng does not help. 

$ emerge -pqv media-libs/libpng
[ebuild   R   ] media-libs/libpng-1.6.7  USE="apng (-neon) -static-libs"

This does not help either:
$ USE="-apng" emerge -1 libpng
$ emerge -1 "<media-libs/libpng-1.6.7"
$ USE="static-libs" emerge -1 libpng
$ emerge -1 zlib libpng

P. S. Just some thoughts... I looked for 'inflateReset2' in source code of libpng. It seems that libpng tries to take this function from zlib. And this line seems strange for me:

/usr/lib/libpng16.so.16: undefined reference to `inflateReset2@ZLIB_1.2.3.4'

I have zlib version 1.2.8-r1, not 1.2.3.4.

$ emerge -pqv zlib
[ebuild   R   ] sys-libs/zlib-1.2.8-r1  USE="minizip -static-libs"

I do not know whether it helps.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-16 20:08:39 UTC
(In reply to Kroz from comment #5)
> Re-emerging media-libs/libpng does not help. 

All right.

> /usr/lib/libpng16.so.16: undefined reference to `inflateReset2@ZLIB_1.2.3.4'
> 
> I have zlib version 1.2.8-r1, not 1.2.3.4.

The release version has nothing to do with "ZLIB_1.2.3.4".
Comment 7 SpanKY gentoo-dev 2013-12-17 16:04:12 UTC
post as attachments:
 - the build log of `emerge zlib`
 - the output of `readelf -Ws /lib*/libz.so.1`
Comment 8 Kroz 2014-01-10 00:27:45 UTC
Created attachment 367520 [details]
Build log of zlib-1.2.8-r1
Comment 9 Kroz 2014-01-10 00:28:22 UTC
Created attachment 367522 [details]
Output of `readelf -Ws /lib*/libz.so.1`
Comment 10 Kroz 2014-01-10 00:29:26 UTC
Created attachment 367524 [details]
Build log of libpng-1.5.17-r1
Comment 11 Kroz 2014-01-10 00:30:22 UTC
Created attachment 367526 [details]
Build log of libpng-1.6.8
Comment 12 Kroz 2014-01-10 00:32:33 UTC
Created attachment 367528 [details]
Output of `readelf libpng15.so.15.17.0`
Comment 13 Kroz 2014-01-10 00:33:51 UTC
Created attachment 367530 [details]
Output of `readelf libpng16.so.16.8.0`
Comment 14 Kroz 2014-01-10 00:37:38 UTC
Good day

  I have found another Gentoo with transmission installed and made some experiments. Conclustion: the problem is in libpng 1.6. If downgrade libpng to libpng-1.5.17-r1 (qtgui rebuild required as well, otherwise transmission will not build), transmission can be installed. zlib is the same, even no rebuild required.

  Here is a log of an experiment:
# Remove 'png' USE flag media-libs/freetype, otherwise we will have to rebuild freetype each time
# Mask '>media-libs/libpng-1.5.17-r1'
$ emerge -1 --nodeps libpng # So, version 1.5.17-r1 will be unstalled
$ rm /usr/lib/libpng16.so # if it is downgrade from 1.6 to 1.5
$ emerge -1 --nodeps qtgui # version of qtgui is the same
$ emerge transmission
# Success

Attaching log of emerge of zlib and readelf libz.so.1 (required) as well as some other information.

Hope this helps
Comment 15 SpanKY gentoo-dev 2014-01-10 17:08:44 UTC
the link line looks correct:
/bin/sh ./libtool  --tag=CC   --mode=link i686-pc-linux-gnu-gcc  -O2 -march=core2 -pipe -no-undefined -export-dynamic -version-number 16:8:0  -Wl,--version-script=libpng.vers  -Wl,-O1 -Wl,--as-needed -o libpng16.la -rpath /usr/lib png.lo pngerror.lo pngget.lo pngmem.lo pngpread.lo pngread.lo pngrio.lo pngrtran.lo pngrutil.lo pngset.lo pngtrans.lo pngwio.lo pngwrite.lo pngwtran.lo pngwutil.lo    -lm -lz -lm 
libtool: link: i686-pc-linux-gnu-gcc -shared  -fPIC -DPIC  .libs/png.o .libs/pngerror.o .libs/pngget.o .libs/pngmem.o .libs/pngpread.o .libs/pngread.o .libs/pngrio.o .libs/pngrtran.o .libs/pngrutil.o .libs/pngset.o .libs/pngtrans.o .libs/pngwio.o .libs/pngwrite.o .libs/pngwtran.o .libs/pngwutil.o   -Wl,--as-needed -lz -lm  -O2 -march=core2 -Wl,--version-script=libpng.vers -Wl,-O1   -Wl,-soname -Wl,libpng16.so.16 -o .libs/libpng16.so.16.8.0

post the output of:
  readelf -d libpng16.so.16.8.0
  echo 'main(){}' | gcc -x c - -o a.out -lz -Wl,--verbose
Comment 16 Kroz 2014-01-11 17:20:29 UTC
Created attachment 367650 [details]
Output of `readelf -d /usr/lib/libpng16.so.16.8.0`
Comment 17 Kroz 2014-01-11 17:21:08 UTC
Created attachment 367652 [details]
Output of ` echo 'main(){}' | gcc -x c - -o a.out -lz -Wl,--verbose '
Comment 18 Kroz 2014-02-16 23:13:46 UTC
(In reply to SpanKY from comment #15)
> the link line looks correct:
> /bin/sh ./libtool  --tag=CC   --mode=link i686-pc-linux-gnu-gcc  -O2
> -march=core2 -pipe -no-undefined -export-dynamic -version-number 16:8:0 
> -Wl,--version-script=libpng.vers  -Wl,-O1 -Wl,--as-needed -o libpng16.la
> -rpath /usr/lib png.lo pngerror.lo pngget.lo pngmem.lo pngpread.lo
> pngread.lo pngrio.lo pngrtran.lo pngrutil.lo pngset.lo pngtrans.lo pngwio.lo
> pngwrite.lo pngwtran.lo pngwutil.lo    -lm -lz -lm 
> libtool: link: i686-pc-linux-gnu-gcc -shared  -fPIC -DPIC  .libs/png.o
> .libs/pngerror.o .libs/pngget.o .libs/pngmem.o .libs/pngpread.o
> .libs/pngread.o .libs/pngrio.o .libs/pngrtran.o .libs/pngrutil.o
> .libs/pngset.o .libs/pngtrans.o .libs/pngwio.o .libs/pngwrite.o
> .libs/pngwtran.o .libs/pngwutil.o   -Wl,--as-needed -lz -lm  -O2
> -march=core2 -Wl,--version-script=libpng.vers -Wl,-O1   -Wl,-soname
> -Wl,libpng16.so.16 -o .libs/libpng16.so.16.8.0
> 
> post the output of:
>   readelf -d libpng16.so.16.8.0
>   echo 'main(){}' | gcc -x c - -o a.out -lz -Wl,--verbose

Attached. Any ideas?
Comment 19 Samuli Suominen (RETIRED) gentoo-dev 2014-02-17 00:19:06 UTC
(In reply to Kroz from comment #17)
> Created attachment 367652 [details]
> Output of ` echo 'main(){}' | gcc -x c - -o a.out -lz -Wl,--verbose '

Looks like different system from where the bug was originally reported, binutils changed from 2.23.2 to 2.24, and the linker is part of binutils
I don't know if that's important
Comment 20 Kroz 2014-02-17 00:28:46 UTC
I update my system quite often.

Just now I have checked: I still cannot install net-p2p/transmission . 

If the version of binutils is important, please, specify which information/logs I should update.

Thanks.
Comment 21 Kroz 2014-07-10 14:29:21 UTC
The reason was located: symlink /lib/libz.so was pointing to libz.so.1.2.3 , not libz.so.1.2.8 . Adjusting symlink solved the problem.

But:

Why did it happen?

$ equery f zlib
 * Searching for zlib ...
 * Contents of sys-libs/zlib-1.2.8-r1:
/lib
/lib/libz.so.1 -> libz.so.1.2.8
/lib/libz.so.1.2.8
/usr
/usr/include
...

More: 

$ mv /lib/libz.so /lib/libz.so.old
$ emerge -1 zlib
...
$ ls -1 /lib/libz*
/lib/libz.so.1
/lib/libz.so.1.2.8
/lib/libz.so.old

So, no /lib/libz.so was created.

More: 

$ ls -1 /usr/lib/libz*
...
/usr/lib/libz.so
...

Concern: What I the correct location of zlib libraries: /lib or /usr/lib. If /lib , then why libz.so is in /usr/lib ? If correct location is /usr/lib , then why /lib/libz.so.1.2.8 and symlink /lib/libz.so.1 is in /lib ? Why there is no libz.so in /lib ?

Thanks.
Comment 22 Samuli Suominen (RETIRED) gentoo-dev 2014-07-10 15:50:10 UTC
(In reply to Kroz from comment #21)
> The reason was located: symlink /lib/libz.so was pointing to libz.so.1.2.3 ,
> not libz.so.1.2.8 . Adjusting symlink solved the problem.

The plain .so symlink is only used for building, therefore it's always installed to /usr/lib, not /lib
Only, for example, .so.1.2.8 is used during runtime, and is thus, put in /lib for early boot

Correct location of files:

/usr/lib/libz.so (for building)
/lib/libz.so.1 (for runtime)
/lib/libz.so.1.2.8 (for runtime)

> Why did it happen?

Perhaps you installed some package that came with it's own copy of zlib, like with `make install` at some point in history, as in, you tell us :)

> So, no /lib/libz.so was created.

Correct.

> /usr/lib/libz.so

Correct.

So, there was no bug in Portage, and the source of /lib/libz.so you had is unknown. Since it's unknown, there is nothing we can do about that.
Comment 23 Ryan Hill (RETIRED) gentoo-dev 2015-09-10 00:48:01 UTC
*** Bug 559176 has been marked as a duplicate of this bug. ***