The configure script in sys-libs/zlib-1.2.5 sets a variable called uname from CHOST. The CHOST is transformed with a sed, and in my case $uname has the value "freebsd7.2". $uname is subsequently matched against a set of strings, and depending on the outcome compilation/linker options are set. In my case, $uname doesn't match (the configure script would expect *BSD), and hence some linker flags will be missing from LDSHARED, notably -Wl,-soname,libz.so.1. Reproducible: Always Steps to Reproduce: 1. emerge "=zlib-1.2.5" Actual Results: ERROR: sys-libs/zlib-1.2.5 failed: unable to read SONAME from libz.so Expected Results: sys-libs/zlib-1.2.5 merges. I guess my CHOST is correct--at least according to Gentoo/FreeBSD installation guide. sys-libs/zlib-1.2.4 used `uname -s` to set the uname variable. One imaginable fix would be to append --uname=`uname -s` to the configure in the ebuild.
I hit the same on Solaris and Darwin. I'm not sure why they did this.
Sort of off topic: I have a vague idea that I've seen an explanation somewhere, but why do we have those CHOSTS? Why don't I use i686-gentoo-FreeBSD?
(In reply to comment #0) > In my case, $uname doesn't match (the configure script would expect *BSD), > and hence some linker flags will be missing from LDSHARED, notably > -Wl,-soname,libz.so.1. How does your uname exactly look like ? > sys-libs/zlib-1.2.4 used `uname -s` to set the uname variable. You can specify your own uname by --uname option. (yes, it's a dirty hack ;-o) Actually, we really should get around w/o looking at the uname at all. But that's a topic for the zlib-devel list ...
(In reply to comment #3) > How does your uname exactly look like ? shell$ portageq envvar CHOST | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/' freebsd8.0 shell$ uname FreeBSD shell$ uname -s FreeBSD > Actually, we really should get around w/o looking at the uname at all. > > But that's a topic for the zlib-devel list ... Well, I guess an option that wouldn't break cross compilation is to case on ${CHOST} similar to what is now done for mingw, e.g. *-freebsd*) and similar for Darwin and Solaris as per comment #1.
I requested for the freebsd* thing to be added as well
btw, i'm not doing any work on this. it's up to the bsd/prefix guys to propose the patch they need added.
apparently someone already committed something but didnt close this http://sources.gentoo.org/sys-libs/zlib/files/zlib-1.2.5-fbsd_chosts.patch
(In reply to comment #5) > I requested for the freebsd* thing to be added as well According to private communication with Mark Adler, the next version of zlib adds *bsd* to the identifiers for BSD. I haven't checked for the other platforms mentioned in this bug.
I've reworked the toolchain handling in my branch (oss-qm project) git://pubgit.metux.de/oss-qm/zlib Maybe you could have a look at it and check if my changes make it better ;-)
upstream is cooperative and already applied necessary patches