GNU bug report logs - #70889
29.3; GCC14.1 MinGW compilation error

Previous Next

Package: emacs;

Reported by: Cyril Arnould <2006parcy <at> gmail.com>

Date: Sun, 12 May 2024 09:35:01 UTC

Severity: normal

Merged with 70890, 71036

Found in version 29.3

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#71036: closed (build failure on Windows with MinGW-w64 GCC 14.1)
Date: Sun, 19 May 2024 10:25:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 19 May 2024 13:24:29 +0300
with message-id <86cypiayle.fsf <at> gnu.org>
and subject line Re: bug#70889: 29.3; GCC14.1 MinGW compilation error
has caused the debbugs.gnu.org bug report #70889,
regarding build failure on Windows with MinGW-w64 GCC 14.1
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
70889: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70889
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Richard Copley <rcopley <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: build failure on Windows with MinGW-w64 GCC 14.1
Date: Sat, 18 May 2024 12:55:02 +0100
Emacs fails to build on Windows with the current MSYS2 GCC 14.1 toolchain.

TL;DR: -Werror=implicit-function-declaration is now the default.
Please see <https://gcc.gnu.org/gcc-14/porting_to.html>. This breaks
the test for "sys/wait.h" in "./configure".

The error is:
  CC       sysdep.o
sysdep.c: In function 'get_child_status':
sysdep.c:479:13: error: implicit declaration of function 'waitpid'
[-Wimplicit-function-declaration]
  479 |       pid = waitpid (child, status, options);
      |             ^~~~~~~
sysdep.c:479:13: warning: nested extern declaration of 'waitpid'
[-Wnested-externs]
sysdep.c: In function 'child_status_changed':
sysdep.c:525:43: error: 'WNOHANG' undeclared (first use in this function)
  525 |   return get_child_status (child, status, WNOHANG | options, 0);
      |                                           ^~~~~~~
sysdep.c:525:43: note: each undeclared identifier is reported only
once for each function it appears in
sysdep.c:526:1: warning: control reaches end of non-void function
[-Wreturn-type]
  526 | }
      | ^
make[2]: *** [Makefile:452: sysdep.o] Error 1

With the previous GCC 13.2 toolchain the build succeeds. The relevant
parts of the two builds' config.log are below, followed by a diff of
the output of "./configure".
Note that -Werror=implicit-function-declaration is now the default.
Please see <https://gcc.gnu.org/gcc-14/porting_to.html>.

==== GCC 13.2 ====

configure:14931: checking for sys/wait.h that is POSIX.1 compatible
configure:14958: gcc -I ./nt/inc -c -g3 -O2 -gdwarf-2 -mtune=generic
conftest.c >&5
conftest.c: In function 'main':

conftest.c:68:3: warning: implicit declaration of function 'wait'
[-Wimplicit-function-declaration]

   68 |   wait (&s);

      |   ^~~~

configure:14958: $? = 0
configure:14968: result: yes

==== GCC 14.1 ====

configure:14931: checking for sys/wait.h that is POSIX.1 compatible
configure:14958: gcc -I ./nt/inc -c -g3 -O2 -gdwarf-2 -mtune=generic
conftest.c >&5
conftest.c: In function 'main':

conftest.c:69:3: error: implicit declaration of function 'wait'
[-Wimplicit-function-declaration]

   69 |   wait (&s);

      |   ^~~~

configure:14958: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU Emacs"
| #define PACKAGE_TARNAME "emacs"
| #define PACKAGE_VERSION "30.0.50"
| #define PACKAGE_STRING "GNU Emacs 30.0.50"
| #define PACKAGE_BUGREPORT "bug-gnu-emacs <at> gnu.org"
| #define PACKAGE_URL "https://www.gnu.org/software/emacs/"
| #define MAIL_USE_POP 1
| #define HAVE_PDUMPER 1
| #define HAVE_STDIO_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_WCHAR_H 1
| #define HAVE_MALLOC_H 1
| #define HAVE_SYS_RESOURCE_H 1
| #define HAVE_PWD_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_DIRENT_H 1
| #define HAVE_SYS_CDEFS_H 1
| #define HAVE_SYS_TIME_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_STDBOOL_H 1
| #define HAVE_STDCKDINT_H 1
| #define STDC_HEADERS 1
| #define _ALL_SOURCE 1
| #define _DARWIN_C_SOURCE 1
| #define _GNU_SOURCE 1
| #define _HPUX_ALT_XOPEN_SOCKET_API 1
| #define _NETBSD_SOURCE 1
| #define _OPENBSD_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
| #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
| #define __STDC_WANT_IEC_60559_DFP_EXT__ 1
| #define __STDC_WANT_IEC_60559_EXT__ 1
| #define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
| #define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
| #define __STDC_WANT_LIB_EXT2__ 1
| #define __STDC_WANT_MATH_SPEC_FUNCS__ 1
| #define _TANDEM_SOURCE 1
| #define __EXTENSIONS__ 1
| #define _FILE_OFFSET_BITS 64
| #define __USE_MINGW_ANSI_STDIO 1
| #define GCC_LINT 1
| #define SYSTEM_TYPE "windows-nt"
| #define HAVE_MMSYSTEM_H 1
| #define HAVE_SOUND 1
| /* end confdefs.h.  */
| #include <sys/types.h>
| #include <sys/wait.h>
| #ifndef WEXITSTATUS
| # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
| #endif
| #ifndef WIFEXITED
| # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
| #endif
|
| int
| main (void)
| {
|   int s;
|   wait (&s);
|   s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
|   ;
|   return 0;
| }
configure:14968: result: no

==== "./configure" output diff ====

--- build.log
+++ build-14.1.0-3.log
@@ -62,7 +62,7 @@
 checking for limits.h... yes
 checking for sys/select.h... no
 checking for stdbool.h... yes
-checking for stdckdint.h... no
+checking for stdckdint.h... yes
 checking for sys/random.h... no
 checking whether it is safe to define __EXTENSIONS__... yes
 checking whether _XOPEN_SOURCE should be defined... no
@@ -87,14 +87,14 @@
 checking whether C compiler handles -Wduplicated-cond... yes
 checking whether C compiler handles -Wextra... yes
 checking whether C compiler handles -Wformat-signedness... yes
-checking whether C compiler handles -Wflex-array-member-not-at-end... no
+checking whether C compiler handles -Wflex-array-member-not-at-end... yes
 checking whether C compiler handles -Winit-self... yes
 checking whether C compiler handles -Winvalid-pch... yes
 checking whether C compiler handles -Wlogical-op... yes
 checking whether C compiler handles -Wmissing-declarations... yes
 checking whether C compiler handles -Wmissing-include-dirs... yes
 checking whether C compiler handles -Wmissing-prototypes... yes
-checking whether C compiler handles -Wmissing-variable-declarations... no
+checking whether C compiler handles -Wmissing-variable-declarations... yes
 checking whether C compiler handles -Wnested-externs... yes
 checking whether C compiler handles -Wnull-dereference... yes
 checking whether C compiler handles -Wold-style-definition... yes
@@ -148,7 +148,7 @@
 checking for _oss_ioctl in -lossaudio... no
 checking for alsa >= 1.0.0... no
 checking for ADDR_NO_RANDOMIZE... no
-checking for sys/wait.h that is POSIX.1 compatible... yes
+checking for sys/wait.h that is POSIX.1 compatible... no
 checking for net/if.h... no
 checking for ifaddrs.h... no
 checking for net/if_dl.h... no


[Message part 3 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Cyril Arnould <cyril.arnould <at> outlook.com>
Cc: eggert <at> cs.ucla.edu, 70889-done <at> debbugs.gnu.org
Subject: Re: bug#70889: 29.3; GCC14.1 MinGW compilation error
Date: Sun, 19 May 2024 13:24:29 +0300
> Date: Sun, 19 May 2024 12:06:19 +0200
> Cc: eggert <at> cs.ucla.edu, 70889 <at> debbugs.gnu.org
> From: Cyril Arnould <cyril.arnould <at> outlook.com>
> 
>  > Now done on the master branch.  People who use GCC 14 on Windows
>  > please test and report any problems you see.
> 
> Just updated, the following builds with no issues:
> 
> ./autogen.sh
> ./configure
> make

Thanks for testing, I'm therefore closing this bug.


This bug report was last modified 1 year and 60 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.