Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 310307 - sys-libs/zlib has broken CHOST=mingw32 support
Summary: sys-libs/zlib has broken CHOST=mingw32 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-20 02:00 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2010-07-08 04:53 UTC (History)
2 users (show)

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


Attachments
zlib-1.2.4.ebuild-mingw32-pkgconfig.patch (zlib-1.2.4.ebuild-mingw32-pkgconfig.patch,1.64 KB, patch)
2010-03-20 02:04 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details | Diff
zlib-1.2.5.ebuild.diff (zlib-1.2.5.ebuild.diff,1.45 KB, patch)
2010-04-20 20:48 UTC, Alon Bar-Lev
Details | Diff
zlib-1.2.5.ebuild.diff (zlib-1.2.5.ebuild.diff,1.71 KB, patch)
2010-04-20 21:47 UTC, Alon Bar-Lev
Details | Diff
zlib-1.2.5.ebuild.diff (zlib-1.2.5.ebuild.diff,1.42 KB, text/plain)
2010-04-20 22:09 UTC, Alon Bar-Lev
Details
zlib-1.2.5.ebuild.diff (zlib-1.2.5.ebuild.diff,1.77 KB, patch)
2010-04-20 22:30 UTC, Alon Bar-Lev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-03-20 02:00:20 UTC
Breakage can be prevented by setting STRIP=true and by only calling ``emake install'' if the CHOST isn't mingw32. I'll attach a patch that gives me working mingw32 support.
Comment 1 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-03-20 02:04:09 UTC
Created attachment 224305 [details, diff]
zlib-1.2.4.ebuild-mingw32-pkgconfig.patch

Fixes cross-compiling for mingw32, including some fixes I mentioned above. Also provides pkgconfig support for mingw32 target. Also adds multilib to the list of inherited classes because it is used by non-mingw32 code and it is assumed that toolchain-funcs will inherit multilib for the ebuild (IMO, it's best to systematically avoid this assumption as much as possible).

If anybody has any direction or knowledge of ways to support w32 crosscompiling (I'm thinking a profile and maybe ARCH=w32, KEYWORDS=~w32), I'd be interested in being directed there :-)
Comment 2 Alon Bar-Lev 2010-04-20 20:48:08 UTC
Created attachment 228553 [details, diff]
zlib-1.2.5.ebuild.diff

mingw fixups.

I don't truly understand why mingw-implib.patch is needed.
And why we need pkg-config file, what/who uses it in mingw environment?
Comment 3 SpanKY gentoo-dev 2010-04-20 20:50:05 UTC
pkg-config doesnt care about the target.  it'd work fine in any cross-compiling environment.
Comment 4 Alon Bar-Lev 2010-04-20 20:58:32 UTC
(In reply to comment #3)
> pkg-config doesnt care about the target.  it'd work fine in any cross-compiling
> environment.

But pkg-config must have wrapper or something, and libtool does not use it anyway...
Is it actually required for something?

If we start making mingw cross compile for packages, there is a lot of work out there...
Comment 5 SpanKY gentoo-dev 2010-04-20 21:13:21 UTC
libtool and pkg-config have nothing to do with each other.  you dont need a wrapper for pkg-config any more than you need a wrapper for any other target -- a wrapper simply automates the library lookup process when cross-compiling.

the only reason there is mingw logic in the zlib ebuild is because its build system sucks and has dedicated makefiles for certain targets.  that is all.  this is no different from adding bsd handling when a package has dedicated bsd build files.  really the zlib build system should be shot and moved to autotools so that things "just work" for mingw targets.
Comment 6 Alon Bar-Lev 2010-04-20 21:20:05 UTC
I tried to discuss the autotools stuff when I sent latest cross and mingw patches to zlib. This was rejected as they support cmake now. Tried to tell them that core component like zlib should have minimum dependencies, and that they have circular dependency (cmake requires zlib), but they all reject autotools.

For pkg-config, you know better than I... if prefix is /usr then you have issues with cross compile ROOT is different, need wrapper to fix this in most cases.

Anyway, it is missing only in mingw no problem to add it if something actually requires it.
Comment 7 SpanKY gentoo-dev 2010-04-20 21:36:50 UTC
if the stock zlib installs a .pc, then it should for all targets

the pkg-config wrapper isnt to mung the output, it's to quickly set up the relevant env vars.  pkg-config itself has support for sysroots and will change standard -I/usr/... and -I/usr/... paths to look in the specified sysroot.
Comment 8 Alon Bar-Lev 2010-04-20 21:47:06 UTC
Created attachment 228555 [details, diff]
zlib-1.2.5.ebuild.diff

OK.
Had I know this I would have pushed this too into 1.2.5.
Comment 9 Alon Bar-Lev 2010-04-20 22:09:58 UTC
Created attachment 228559 [details]
zlib-1.2.5.ebuild.diff

Sorry, leave the implib patch. I will try to push this too.
Comment 10 Alon Bar-Lev 2010-04-20 22:30:44 UTC
Created attachment 228565 [details, diff]
zlib-1.2.5.ebuild.diff

So sorry!
They added a new sharedlibdir in last version, so the pc creation is updated.
Comment 11 Enrico 'nekrad' Weigelt 2010-04-24 01:53:38 UTC
> the only reason there is mingw logic in the zlib ebuild is because its build
> system sucks and has dedicated makefiles for certain targets.  that is all. 

Did you already try ./configure && make on mingw ?
(didnt have time to check it yet)

Perhaps we should fix from the start.
The changes could be made in the oss-qm branch, until
Mark has catched up w/ next release:

http://repo.or.cz/w/oss-qm-packages.git/shortlog/refs/heads/METUX.zlib.master

> really the zlib build system should be shot and moved to
> autotools so that things "just work" for mingw targets.

No, we definitivly dont want autotools, because it does _NOT_
work properly. (see the discussions frequently popping up again
@zlib-devel).

If you have something to fix, please come up w/ a patch or at least
enough information for us to fix it.
Comment 12 Enrico 'nekrad' Weigelt 2010-04-24 02:01:53 UTC
(In reply to comment #6)
> I tried to discuss the autotools stuff when I sent latest cross and mingw
> patches to zlib. This was rejected as they support cmake now. Tried to tell
> them that core component like zlib should have minimum dependencies, and that
> they have circular dependency (cmake requires zlib), 
> but they all reject autotools.

cmake is not needed at all for zlib. The cmake buildfile is as optional 
as the treebuild.xml.

autotools would conflict w/ the current carefully handwritten configure
script and introduce a hell of other problems.

> For pkg-config, you know better than I... if prefix is /usr then you have
> issues with cross compile ROOT is different, need wrapper to fix this in most
> cases.

Thats not necessary anymore, for several years now.
Just pass the right PKG_CONFIG_SYSROOT_DIR env variable.

Comment 13 Enrico 'nekrad' Weigelt 2010-07-05 15:11:43 UTC
(In reply to comment #3)
> pkg-config doesnt care about the target.  it'd work fine in any cross-compiling
> environment.
> 

Actually, pkg-config is *very* useful for crosscompiling.
Comment 14 SpanKY gentoo-dev 2010-07-08 04:27:57 UTC
i really have no idea what Enrico is talking about, so i'll skip that

i dont like extending the mingw cruft so much, but since i'm not inclined to dig into the zlib source for a proper fix, i've merged Alon's latest patch

http://sources.gentoo.org/sys-libs/zlib/zlib-1.2.5-r2.ebuild?r1=1.3&r2=1.4
Comment 15 Enrico 'nekrad' Weigelt 2010-07-08 04:53:31 UTC
(In reply to comment #14)
> i really have no idea what Enrico is talking about, so i'll skip that
> 
> i dont like extending the mingw cruft so much, but since i'm not inclined to
> dig into the zlib source for a proper fix, i've merged Alon's latest patch
> 
> http://sources.gentoo.org/sys-libs/zlib/zlib-1.2.5-r2.ebuild?r1=1.3&r2=1.4
> 

My primary point is fixing the configure script, so it supports mingw builds, instead of driving the buiild manually.