http://bugs.winehq.org/show_bug.cgi?id=20314
Summary: wine loader doesn't work on Debian/kFreeBSD Product: Wine Version: 1.1.31 Platform: PC URL: http://www.debian.org/ports/kfreebsd-gnu/ OS/Version: FreeBSD Status: NEW Keywords: download, source Severity: critical Priority: P2 Component: loader AssignedTo: wine-bugs@winehq.org ReportedBy: austinenglish@gmail.com
Found out about the debian/FreeBSD port, so I gave it a spin. Wine mostly compiles, with a couple warnings (I'll send a patch in a bit), but the killer is loader/preloader.c. It's disabled on FreeBSD normally, by configure.ac: case $host_cpu in *i[[3456789]]86*) case $host_os in linux* | k*bsd*-gnu) AC_SUBST(EXTRA_BINARIES,"wine-preloader") ;; esac ;; esac
but the k*bsd*-gnu enables it here. The problem is, preloader.c has some linux specific stuff: static inline int wld_prctl( int code, int arg ) { int ret; __asm__ __volatile__( "pushl %%ebx; movl %2,%%ebx; int $0x80; popl %%ebx" : "=a" (ret) : "0" (SYS_prctl), "r" (code), "c" (arg) ); return SYSCALL_RET(ret); }
The SYS_prctl is Linux specific, see: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550435
I tried removing the k*bsd*-gnu from configure.ac, but the loader still doesn't work: wine: failed to initialize: /usr/local/lib/wine/ntdll.dll.so: failed to map segment from shared object: Cannot allocate memory
http://bugs.winehq.org/show_bug.cgi?id=20314
Ove Kaaven ovek@arcticnet.no changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ovek@arcticnet.no
--- Comment #1 from Ove Kaaven ovek@arcticnet.no 2009-10-12 17:33:31 --- Hi Austin. My guess is that you'll have to fix it yourself, since probably very few developers use GNU/kFreeBSD at this time.
You can look to dlls/kernel32/process.c (set_process_name) for inspiration about what the prctl's function (and BSD equivalent?) is. However, you can't just copy that code into the preloader, since the preloader may not depend on *any* userspace library, not even libc or ldso. It has to do direct kernel syscalls for anything it needs to do. Probably only someone with experience with FreeBSD would know how to add such syscalls.
(Though perhaps it's fine to just ifdef out the whole prctl thing? Its purpose looks quite cosmetic.)
http://bugs.winehq.org/show_bug.cgi?id=20314
--- Comment #2 from Austin English austinenglish@gmail.com 2009-10-12 17:36:30 --- (In reply to comment #1)
Hi Austin. My guess is that you'll have to fix it yourself, since probably very few developers use GNU/kFreeBSD at this time.
I don't think I'll have time to do so either, especially since I'm not terribly familiar with the FreeBSD kernel. I wanted to get a bug filed so it's not forgotten about. Besides, maybe someone will get bored and fix it :-).
You can look to dlls/kernel32/process.c (set_process_name) for inspiration about what the prctl's function (and BSD equivalent?) is. However, you can't just copy that code into the preloader, since the preloader may not depend on *any* userspace library, not even libc or ldso. It has to do direct kernel syscalls for anything it needs to do. Probably only someone with experience with FreeBSD would know how to add such syscalls.
Right. As time permits, I'll play around with it a bit, but don't expect anything fruitful to come out of it.
(Though perhaps it's fine to just ifdef out the whole prctl thing? Its purpose looks quite cosmetic.)
I tried that, still failed. Perhaps with a few more ifdef/elseif's it may be easy to get a working loader...
http://bugs.winehq.org/show_bug.cgi?id=20314
--- Comment #3 from Austin English austinenglish@gmail.com 2010-07-17 15:07:45 --- Still present in 1.2.
http://bugs.winehq.org/show_bug.cgi?id=20314
--- Comment #4 from tuco.xyz@gmail.com 2010-08-13 13:38:40 --- Created an attachment (id=30128) --> (http://bugs.winehq.org/attachment.cgi?id=30128) fix
I fixed it. It's the same problem, just in a different place.
http://bugs.winehq.org/show_bug.cgi?id=20314
--- Comment #5 from Dmitry Timoshkov dmitry@codeweavers.com 2010-08-13 23:08:24 --- (In reply to comment #4)
Created an attachment (id=30128)
--> (http://bugs.winehq.org/attachment.cgi?id=30128) [details]
fix
I fixed it. It's the same problem, just in a different place.
http://wiki.winehq.org/SubmittingPatches
Please create a patch using git and send it to wine-patches.
http://bugs.winehq.org/show_bug.cgi?id=20314
--- Comment #6 from Austin English austinenglish@gmail.com 2010-10-05 22:21:09 CDT --- (In reply to comment #4)
Created an attachment (id=30128)
--> (http://bugs.winehq.org/attachment.cgi?id=30128) [details]
fix
I fixed it. It's the same problem, just in a different place.
Still fails for me with that patch.
http://bugs.winehq.org/show_bug.cgi?id=20314
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #7 from Austin English austinenglish@gmail.com 2011-01-17 16:40:51 CST --- Fixed by: http://source.winehq.org/git/wine.git/?a=commitdiff;h=534196fba934c0cf362f73... http://source.winehq.org/git/wine.git/?a=commitdiff;h=9832bd6c546b880bb55da4... http://source.winehq.org/git/wine.git/?a=commitdiff;h=599afa06b7cb83d406fdb1... http://source.winehq.org/git/wine.git/?a=commitdiff;h=b21319231e321f38f6dad3...
http://bugs.winehq.org/show_bug.cgi?id=20314
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #8 from Alexandre Julliard julliard@winehq.org 2011-01-21 13:44:10 CST --- Closing bugs fixed in 1.3.12.