I'm trying to compile Cygwin on my latest setup. For me, it hangs in
menubar-items.el -- i.e. well before auto-autoloads.el. I attempted to run
under GDB and get a seg fault, but the stack is all trashed.
HOWEVER, I notice this warning, which looks very bad:
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/../../../../i686-pc-cygwin/bin/ld: warn
ing: cannot find entry symbol _WinMainCRTStartup; defaulting to 00401000
I am configuring with
../../$1/configure --verbose --extra-verbose --srcdir=../../$1 \
--site-includes=/usr/local/include --cflags=v \
--site-libraries=/usr/local/lib \
--package-path=/src/xemacs/xemacs-packages --without-database $muleopts
i.e. not PDUMP.
I definitely did not used to get that warning, a few months ago when I last
compiled Cygwin. That warning could well be the source of all these hangings --
if the CRT startup is not properly invoked, all sorts of nasty problems can
happen.
When did this warning start occurring? When did these hangings start
occurring? Did it start occurring to anyone right after they upgraded to a more
recent Cygwin? Has anyone been messing around with the way arguments are passed
to the loader? [maybe in s/cygwin32.h?]
I poked around a bit, and it seems that we really ought to be entering using
mainCRTStartup, which will call main(); WinMainCRTStartup calls the normal
WinMain() used to start a normal Windows program, and under the native build, we
explicitly set the entry point to mainCRTStartup since we have no WinMain.
for some more info, here's the lines outputted by -v:
gcc -v -mwindows -L/usr/local/lib -L/usr/X11R6/lib -o temacs abbrev.o alloc.
o blocktype.o buffer.o bytecode.o callint.o callproc.o casefiddle.o casetab.o ch
artab.o cmdloop.o cmds.o console.o console-stream.o data.o device.o dired.o doc.
o doprnt.o dynarr.o editfns.o elhash.o emacs.o eval.o events.o debug.o tests.o f
ilelock.o ntplay.o unexcw.o scrollbar-msw.o menubar-msw.o toolbar-msw.o dialog-m
sw.o console-msw.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw
.o redisplay-msw.o glyphs-msw.o gui-msw.o balloon_help.o balloon-x.o dgif_lib.o
gif_io.o menubar.o scrollbar.o dialog.o toolbar.o menubar-x.o scrollbar-x.o dial
og-x.o toolbar-x.o gui-x.o file-coding.o realpath.o getloadavg.o inline.o consol
e-tty.o device-tty.o event-tty.o frame-tty.o objects-tty.o redisplay-tty.o cm.o
terminfo.o event-unixoid.o process-unix.o event-stream.o extents.o faces.o filei
o.o filemode.o floatfns.o fns.o font-lock.o frame.o general.o glyphs.o glyphs-e
image.o glyphs-widget.o gui.o gutter.o hash.o imgproc.o indent.o insdel.o intl.
o keymap.o line-number.o lread.o lstream.o macros.o marker.o md5.o minibuf.o ob
jects.o opaque.o print.o process.o profile.o rangetab.o redisplay.o redisplay-ou
tput.o regex.o search.o select.o sheap.o signal.o sound.o specifier.o strftime.o
symbols.o syntax.o sysdep.o undo.o console-x.o device-x.o event-Xt.o frame-x.o
glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o widget.o window.o win
32.o xemacs_res.o lastfile.o gmalloc.o free-hook.o vm-limit.o ralloc.o EmacsFram
e.o EmacsShell.o TopLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o ..
/lwlib/liblw.a -lXaw -ltiff -lpng -ljpeg -lz -lXpm -lXmu -lXt -lXext -lX11 -lSM
-lICE -lncurses -lwinmm -lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwins
pool
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/specs
gcc version 2.95.2-6 19991024 (cygwin experimental)
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/collect2.exe --subsystem windows -Bdyn
amic -o temacs.exe /usr/lib/crt0.o -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/
gcc-lib/i686-pc-cygwin/2.95.2-6 -L/usr/lib/mingw abbrev.o alloc.o blocktype.o bu
ffer.o bytecode.o callint.o callproc.o casefiddle.o casetab.o chartab.o cmdloop.
o cmds.o console.o console-stream.o data.o device.o dired.o doc.o doprnt.o dynar
r.o editfns.o elhash.o emacs.o eval.o events.o debug.o tests.o filelock.o ntplay
.o unexcw.o scrollbar-msw.o menubar-msw.o toolbar-msw.o dialog-msw.o console-msw
.o device-msw.o event-msw.o frame-msw.o objects-msw.o select-msw.o redisplay-msw
.o glyphs-msw.o gui-msw.o balloon_help.o balloon-x.o dgif_lib.o gif_io.o menubar
.o scrollbar.o dialog.o toolbar.o menubar-x.o scrollbar-x.o dialog-x.o toolbar-x
.o gui-x.o file-coding.o realpath.o getloadavg.o inline.o console-tty.o device-t
ty.o event-tty.o frame-tty.o objects-tty.o redisplay-tty.o cm.o terminfo.o event
-unixoid.o process-unix.o event-stream.o extents.o faces.o fileio.o filemode.o f
loatfns.o fns.o font-lock.o frame.o general.o glyphs.o glyphs-eimage.o glyphs-wi
dget.o gui.o gutter.o hash.o imgproc.o indent.o insdel.o intl.o keymap.o line-nu
mber.o lread.o lstream.o macros.o marker.o md5.o minibuf.o objects.o opaque.o pr
int.o process.o profile.o rangetab.o redisplay.o redisplay-output.o regex.o sear
ch.o select.o sheap.o signal.o sound.o specifier.o strftime.o symbols.o syntax.o
sysdep.o undo.o console-x.o device-x.o event-Xt.o frame-x.o glyphs-x.o objects-
x.o redisplay-x.o select-x.o xgccache.o widget.o window.o win32.o xemacs_res.o l
astfile.o gmalloc.o free-hook.o vm-limit.o ralloc.o EmacsFrame.o EmacsShell.o To
pLevelEmacsShell.o TransientEmacsShell.o EmacsManager.o ../lwlib/liblw.a -lXaw -
ltiff -lpng -ljpeg -lz -lXpm -lXmu -lXt -lXext -lX11 -lSM -lICE -lncurses -lwinm
m -lshell32 -lgdi32 -luser32 -lcomdlg32 -lcomctl32 -lwinspool -lgcc -lcygwin -lg
di32 -lcomdlg32 -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc
/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/../../../../i686-pc-cygwin/bin/ld: warn
ing: cannot find entry symbol _WinMainCRTStartup; defaulting to 00401000
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@4
U _SetUnhandledExceptionFilter@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@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.
So once again, what changed to produce this?
Andy, Kirill, please comment. Andy, can you investigate, since you know more
about Cygwin than I do and you've been more on top of the Cygwin changes?
BTW I am leaving Sunday for a week for vacation, so I'll be unreachable during
that period.
--
ben
I'm sometimes slow in getting around to reading my mail, so if you
want to reach me faster, call 520-661-6661.
See
http://www.666.com/ben/chronic-pain/ for the hell I've been
through.