Damjan Jovanovic | 22 Jul 18:39 2011
Picon

Wine port and upstream feedback

Hi

I am very new to Haiku so I hope this is the right mailing list to
post this to? It seems kind of dead.

Since the disaster of Ubuntu 11.04 (and worse coming), I've been
looking at alternatives to Ubuntu mainstream (Xubuntu, Lubuntu), then
alternatives to the entire Ubuntu family (Mint), and now even at
alternative operating systems. Haiku struck me as interesting because
of its non-copyleft licensing, loyal user base, good API stability and
binary compatibility, and what seems like a promising future - there's
an OpenJDK Haiku port and there've been discussions around Haiku in
several open-source communities I am in.

One of the open-source projects I've been very active in is Wine, and
for the past few days I've been trying to port it to Haiku. Here are
the showstopping problems so far, and what I've done to work around
them:

1. configure can't find libpthread
I patched configure.ac: http://source.winehq.org/patches/data/76781

2. configure can't find X11
run it with --without-x

3. configure can't find freetype
run it with --without-freetype too

4. "make" dies very quickly because isinf() and isnan() are defined twice
This happens because configure wrongly believes those functions are
absent. This is because the test for them, which uses "-lm", fails.
I patched configure.ac to use LIBM instead of "-lm":
http://source.winehq.org/patches/data/76782

5. "make" now completes the first phase ("make depend"), but dies due
to another "-lm" problem when trying to call winegcc
I patched winegcc not to use "-lm": http://source.winehq.org/patches/data/76783

6. as above, but winegcc uses "-lc"
not fixed yet

Anyway those 3 patches were submitted for inclusion into the official
version of Wine, but rejected a little later by Alexandre Julliard
(Wine's maintainer) with this comment (in reply to
http://source.winehq.org/patches/data/76781):

"I'd suggest to file bugs with Haiku, they should provide
compatibility libraries, that stuff is very much standard."

I then went on IRC to get further details:

dacha = me
julliard = Alexandre Julliard

---BEGIN IRC SNIP---
<dacha> julliard: libpthread/libm/libc aren't mandated in ANSI or
POSIX, do you mean they're just de-facto *nix standards?
<julliard> yes
<dacha> julliard: haiku's policy seems to be that's an upstream bug
<ohsix> that must save haiku a lot of work, that policy
<julliard> i don't think it's unreasonable to ask that minority
platforms conform to what the rest of the world is doing, instead of
asking everybody else to change their ways
<dacha> ok thank you
<julliard> considering all the changes they are going to have to do to
make wine run, if they don't even want to support -lm there isn't much
hope...
<dacha> what are all the changes they have to do?
<julliard> address space layout, gdt/ldt support, kernel threading
<julliard> probably a lot more
<julliard> it took a lot of work for the freebsd guys to fix their
kernel to support wine properly
<julliard> i expect haiku will be even more work
---END IRC SNIP---

Ouch!

So I guess my first question is: can Haiku provide empty stub
libraries called libc / libm / libpthread, just to fool "configure"
and "gcc" into passing tests and finding libraries?

Hopefully I'll have more news later, when I compile Wine a bit further.

Regards
Damjan

Gmane