Cygwin CWD vs. Win32 CWD (was Re: [ANNOUNCEMENT] Updated: vim-7.3.003-1)

Corinna Vinschen corinna-cygwin@cygwin.com
Sun Aug 29 09:25:00 GMT 2010


Hi Chris,

On Aug 27 18:37, Corinna Vinschen wrote:
> On Aug 27 09:39, Christopher Faylor wrote:
> >   I'm still going to check in some of what I've done
> > though since it makes -lbinmode work.
> 
> Cool.  I'm very curious how you solved this problem.

Just for the records, I had a crazy idea tonight.

Index: crt0.c
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/crt0.c,v
retrieving revision 1.4
diff -u -p -r1.4 crt0.c
--- crt0.c	29 Sep 2005 14:28:22 -0000	1.4
+++ crt0.c	29 Aug 2010 09:13:23 -0000
@@ -51,5 +51,17 @@ mainCRTStartup ()
   cygwin_crt0 (main);
 }
 
+void ___dummy_premain_caller ()
+{
+  extern void cygwin_premain0 ();
+  extern void cygwin_premain1 ();
+  extern void cygwin_premain2 ();
+  extern void cygwin_premain3 ();
+  cygwin_premain0 ();
+  cygwin_premain1 ();
+  cygwin_premain2 ();
+  cygwin_premain3 ();
+}
+
 void WinMainCRTStartup(void) __attribute__ ((alias("mainCRTStartup")));
 
Of course it fails for -nostartfiles or -nostdlib builds, so it's
lacking some elegance.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat



More information about the Cygwin-developers mailing list