Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 316841 - sys-libs/zlib-1.2.5 doesn't understand CHOST="*-*-freebsdX.Y"
Summary: sys-libs/zlib-1.2.5 doesn't understand CHOST="*-*-freebsdX.Y"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://mail.madler.net/pipermail/zlib...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-23 16:59 UTC by Johan Hattne
Modified: 2010-07-14 08:24 UTC (History)
4 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 Johan Hattne 2010-04-23 16:59:18 UTC
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.
Comment 1 Fabian Groffen gentoo-dev 2010-04-23 18:29:25 UTC
I hit the same on Solaris and Darwin.  I'm not sure why they did this.
Comment 2 Johan Hattne 2010-04-23 19:01:08 UTC
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?
Comment 3 Enrico 'nekrad' Weigelt 2010-04-23 20:31:25 UTC
(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 ...
Comment 4 Johan Hattne 2010-04-23 20:58:48 UTC
(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.
Comment 5 Fabian Groffen gentoo-dev 2010-04-24 11:31:55 UTC
I requested for the freebsd* thing to be added as well
Comment 6 SpanKY gentoo-dev 2010-07-07 20:03:39 UTC
btw, i'm not doing any work on this.  it's up to the bsd/prefix guys to propose the patch they need added.
Comment 7 SpanKY gentoo-dev 2010-07-07 20:09:20 UTC
apparently someone already committed something but didnt close this

http://sources.gentoo.org/sys-libs/zlib/files/zlib-1.2.5-fbsd_chosts.patch
Comment 8 Johan Hattne 2010-07-12 19:43:29 UTC
(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.
Comment 9 Enrico 'nekrad' Weigelt 2010-07-14 07:54:53 UTC
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 ;-)
Comment 10 Fabian Groffen gentoo-dev 2010-07-14 08:24:25 UTC
upstream is cooperative and already applied necessary patches