Solaris compatibility - libs/wine/loader.c

Robert Lunnon bobl at optushome.com.au
Sat May 7 16:50:34 CDT 2005


On Sat, 7 May 2005 11:47 pm, Alexandre Julliard wrote:
> Robert Lunnon <bobl at optushome.com.au> writes:
> > Notes about patch:
> > Solaris requires RTLD_FIRST flag to dlopen calls to resolve multiple path
> > expansions properly
>
> This doesn't seem to be what RTLD_FIRST does. Could you explain a bit
> more exactly what the problem is?


Originally the problem manifested itself on Solaris 10 with ld.so.1  emitting 
a diagnostic:
 "potential multiple path expansion requires RTLD_FIRST"

 when this happens, ld.so.1 fails the dlopen and wine usually falls over.

RTLD_FIRST: The way I understand it (and I don't very well) the Solaris linker 
has an internal macro like capability, where the path to  a group of 
libraries can be represented by a single symbol.  The RTLD_FIRST flag makes 
ld.so.1 select the FIRST library which resolves a dependency when there are 
multiple possibilities as a result of such an expansion. According to 
docs.sun.com the flag seems to have the side-effect of hiding subsequent 
dependencies from a parent object, So for example wine, can't rely on say 
winmm.dll.so.1 importing the symbols from the driver so the wine executable 
can use them directly. In practise the limitation doesn't seem to be a 
problem, wine does import directly all the DSOs it needs correctly for this 
flag to work.


I pondered this problem for quite a while, but this problem apparently doesn't 
come up much and even the sun engineers couldn't help much with how to 
identify the collision or how to resolve the problem. After a while 
investigating I decided I'd just do what the diagnostic said, which in fact 
did resolve the problem and doesn't have any undesirable side-effects that I 
have identified.






More information about the wine-devel mailing list