Subject: bug#70914: 29.3; Crashes often on Windows

From: Eli Zaretskii <[email-masked]>
Date: Thu, 16 May 2024 22:28:58 +0300

> From: Simen Endsjø <[email-masked]>
> Date: Thu, 16 May 2024 20:40:07 +0200
> Cc: Eli Zaretskii <[email-masked]>, [email-masked]
> 
> > But I guess is not an option here if one can't recompile.
> 
> I'm not blocked from compiling code on the machine, but I guess there's
> something wrong with my setup, because the instructions in nt/INSTALL.W64
> doesn't seem to work out of the box.
> 
> Tried to start with a baseline by looking at
> system-configuration-options of the stock install and configured with:
>     ./configure
> --prefix=/d/tmp/emacs-bug-70914/emacs-29.3-stock-options
> --with-modules --without-dbus --with-native-compilation=aot
> --without-compress-install --with-sqlite3 --with-tree-sitter
> CFLAGS=-O2
> 
> But when building, I get an error:
>     make -C src BIN_DESTDIR=''/mingw64/bin/'' \
>              ELN_DESTDIR='/mingw64/lib/emacs/29.3/' all
>     make[2]: Entering directory '/d/tmp/emacs-bug-70914/emacs-git/src'
>       CC       sysdep.o
>     sysdep.c: In function 'get_child_status':
>     sysdep.c:472:13: error: implicit declaration of function 'waitpid'
> [-Wimplicit-function-declaration]
>       472 |       pid = waitpid (child, status, options);
>       |             ^~~~~~~
>     sysdep.c:472:13: warning: nested extern declaration of 'waitpid'
> [-Wnested-externs]
>     sysdep.c: In function 'child_status_changed':
>     sysdep.c:518:43: error: 'WNOHANG' undeclared (first use in this function)
>       518 |   return get_child_status (child, status, WNOHANG | options, 0);
>       |                                           ^~~~~~~
>     sysdep.c:518:43: note: each undeclared identifier is reported only
> once for each function it appears in
>     sysdep.c:519:1: warning: control reaches end of non-void function
> [-Wreturn-type]
>       519 | }
>       | ^
>     make[2]: *** [Makefile:424: sysdep.o] Error 1
>     make[2]: Leaving directory '/d/tmp/emacs-bug-70914/emacs-git/src'
>     make[1]: *** [Makefile:544: src] Error 2

I guess you are using GCC 14, in which case see bug#70889 for the
reasons and the workaround.

It would be interesting to know whether Emacs without native
compilation crashes in the same way.