delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/11/04/23:39:22

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Subject: Re: dll initialization
4 Nov 1998 23:39:22 -0800 :
Message-ID: <9811050659.AA06482.cygnus.cygwin32.developers@modi.xraylith.wisc.edu>
References: <01BE081F DOT 77F584E0 AT sos>
To: Sergey Okhapkin <sos AT prospect DOT com DOT ru>
Cc: "'cygwin32-developers AT cygnus DOT com'" <cygwin32-developers AT cygnus DOT com>

Sergey Okhapkin <sos AT prospect DOT com DOT ru> writes:
> Hi!
> 
> Wed Oct 28 17:57:53 1998  Geoffrey Noer  <noer AT cygnus DOT com>
> 
> 	patch from Mumit Khan <khan AT xraylith DOT wisc DOT edu>:
> 	* dll_init.cc (exceptions.h): Include.
> 	(dll_dllcrt0_1): New function to initialize Cygwin DLL guts
> 	properly when a non-Cygwin app uses the Cygwin DLL.
> 	(dll_dllcrt0): Call dll_dllcrt0_1 when user_data is NULL.
> 
> Most X11 applications fails to run with this patch... If the application is 
> linked with cygwin-compiled dlls, DllMain function of these dlls is called 
> _before_ user_data is initialized by cygwin1.dll! This case the 
> initialization of cygwin1.dll performed twice with unpredictable results. I 
> had to remove this patch to run xterm, rxvt and Xemacs.

Sergey,

I'm confused as to the circumstances when this is happening. Are the
applications non-cygwin? 

These changes only affect (in theory of course) user DLLs that are 
*not* cygwin DLLs, but something else (mingw crtdll/msvc or VC++
msvc).

Cygwin user DLLs should be specifying __cygwin_entry_dll AT 12 as the
entry point which will initialize user_data properly and call user
_DllMain AT 12 if any.

Could you tell me exactly how the X11 DLLs are being initialized so I
can fix any problems that there might be?

Regards,
Mumit

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019