Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3AAAA33F.6EAAA325@ece.gatech.edu> Date: Sat, 10 Mar 2001 16:57:19 -0500 From: Charles Wilson X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin AT sources DOT redhat DOT com Subject: Re: windows showstopper re: cannot find entry symbol _WinMainCRTStartup References: <3AAA1EB2 DOT 14C8F61 AT 666 DOT com> <3AAA9FDF DOT 579DC5 AT ece DOT gatech DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ben Wing wrote: > > I do see the crt0 is the very first thing linked, and > > /lib 540$ nm crt0.o > 00000000 b .bss > 00000000 d .data > 00000000 t .text > 00000000 D ___cygwin_crt0_bp > 00000000 t ___gnu_compiled_c > U _cygwin_crt0 > U _main > 00000000 T _mainCRTStartup > 00000000 t gcc2_compiled. > > so this *may* be harmless, but I think it needs to be fixed, perhaps just with a > flag that sets the entry point. > > BUT .... then again, maybe not. There's also a crt1.0, like this: > > /lib 542$ nm crt1.o > 00000000 b .bss > 00000000 d .data > 00000000 t .text > U _ExitProcess AT 4 > U _SetUnhandledExceptionFilter AT 4 > 00000230 T _WinMainCRTStartup > U __CRT_fmode > U __CRT_glob > U ___GetMainArgs > 00000000 t ___gnu_compiled_c > 000001b0 t ___mingw_CRTStartup > 00000000 D __argc > 00000004 D __argv > U __cexit > U __fileno > U __fpreset > 000000d0 t __gnu_exception_handler AT 4 > U __imp___environ_dll > U __imp___fmode_dll > U __imp___iob > 00000030 t __mingw32_init_fmode > 00000000 t __mingw32_init_mainargs > U __setmode > U _main > 00000210 T _mainCRTStartup > U _signal > 00000000 t gcc2_compiled. > > Notice that this also has mainCRTStartup in it, as well as WinMainCRTStartup. > My strong suspicion is that crt1.o is the correct CRT to be using for a > windowed-subsystem XEmacs; crt0.o, with no references to WinMain, has to be for > a console-subsystem XEmacs. So, by using the wrong CRT initialization, we could > easily be fucking ourselves in all sorts of ways. Hmmm...I think that crt0.o is for cygwin builds, crt1.o is for builds which use "cygwin-gcc -mno-cygwin" with a crt.dll runtime target, and crt2.o is for builds which use "cygwin-gcc -mno-cygwin" with an msvcrt.dll runtime target. > > So once again, what changed to produce this? If I'm right, cygwin's gcc recently changed so that the msvcrt runtime was the default target for -mno-cygwin builds; but that would just mean that crt1.o was replaced by crt2.o. Since cygwin builds (-mwindows notwithstanding) use crt0.o, this change would have no effect on cygwin builds. Hmm... I've copied this message to the cygwin list, in case the gurus there have any comment, or can confirm/deny my statement abouve about crtX.o. --Chuck -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple