How to run program without wine ?

Mike Hearn mike at theoretic.com
Thu Sep 25 17:54:46 CDT 2003


On Thu, 2003-09-25 at 23:16, Dimitrie O. Paun wrote:
> On Fri, 26 Sep 2003, Shachar Shemesh wrote:
> 
> > A Win32 program needs Win32 environment. Be that a registry, the Win32 
> > APIs, or a forest directory structure and "My Documents" and "Program 
> > Files". While you may theoretically get the APIs by statically linking 
> > the DLLs into the executable, all of the rest are only available if Wine 
> > is installed on the machine. As such, I don't think a Winelib app will 
> > be able to ever live without a wine environment.

I don't agree with this - there are shades of Win32ness. An app that is
slowly being ported to be "native" may well need to be done in chunks.
You can remove the registry requirements, teach it the FHS and so on,
while still using HeapAlloc.

It's true there's little point just recompiling the app and saying
"that's it", but obviously the value of winelib is not in allowing us to
use ld.so instead of wine, it's in the ability to take a port slowly but
surely, maybe never being completed but along the way getting sufficient
integration for it not to matter.

> Of course, you will need wine installed. I wasn't clear in my response,
> but I thought he refered to the fact that now we have to start Winelib
> apps as:
>    wine myapp.so
> 
> Ideally, we can just link it to a real executable, without all the
> wrappers that we have now. Not that it would change much, you will
> still need the DLLs, etc. but it would be a bit cleaner. Meanwhile,
> if you use winegcc you are isolated from all these ugly details...

Yes, it'd be nice to get it documented somewhere why this is needed
(maybe it already is). 

As I understand it, the problem is that the libc linker would invoke
static initializers which might rely on winelib being initialized
(especially in c++ code) leading to badness if it isn't? Maybe the
threading stuff gets involved too.

If it's just static initializers which are the problem, the obvious
solution would be to make winelib initialize on demand - of course I say
that, but I'm not going to do the work ;) I don't even know how hard
it's be.

If it's because we need to override pthreads too, then I suppose magic
tricks with the ELF GOT might help there. Deep voodoo beyond my skill at
present though.

thanks -mike




More information about the wine-devel mailing list