What todo with stubs in Winlib

Vincent Béron vberon at mecano.gme.usherb.ca
Mon Sep 22 09:52:51 CDT 2003


Le lun 22/09/2003 à 10:30, Boaz Harrosh a écrit :
> Winebuild would not recognize stubs for linking. So an app that runs 
> under wine will not compile under winelib. ( stubbed functions are 
> linked to but are not actually used).

If it's a "real" stub (ie, one in the spec file), then the app won't
correctly run under Wine, since when it'll call that stub it'll crash
with a SIGSEGV (0xdeadbeef et al). Not sure if allowing them to link
under winelib is correct here.

For the other type (one labeled stub in the C files, which just print
some TRACES), it's a real function, so nothing needs to be done.

> 
> [Q] What should one do with all these stub functions? redefine them in a 
> separate file? would it make any logic to tell winebuild - with a 
> special switch - to link also to stubs?
> ( how hard is that hack?)

Make a program (winebuild called) which checks for functions ld can't
find, and create a corresponding stub in an additional source file.
Problem is, you need the prototype for that, and since the prototypes
are in the spec files, and for stubs the prototype is absent, you have a
nice round problem.

If implementing the real stubs to return error codes can make the app
work under Wine, then you've just solved your problem.

Vincent




More information about the wine-devel mailing list