unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: "Peder O. Klingenberg" <peder@klingenberg.no>, 42095@debbugs.gnu.org
Subject: bug#42095: 28.0.50; Build fails on Windows/MinGW64
Date: Sun, 28 Jun 2020 18:48:42 +0300	[thread overview]
Message-ID: <83bll32ntx.fsf@gnu.org> (raw)
In-Reply-To: <878sg819n2.fsf@klingenberg.no> (peder@klingenberg.no)

> From: "Peder O. Klingenberg" <peder@klingenberg.no>
> Date: Sat, 27 Jun 2020 23:28:17 +0200
> 
> I wanted to refresh my Windows Emacs build tonight, for the first time
> in some months.  I pulled up to
> 5ce5cf643840cd6efd25d987bc5b6f12478c50a6 by Paul Eggert and ran make -j4
> as usual.  The build failed.  Likewise make bootstrap.  The error:
> 
>   CC       open.o
> open.c: In function 'sys_open':
> open.c:127:48: error: 'O_CLOEXEC' undeclared (first use in this function)
>   127 |                   flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode);
>       |                                                ^~~~~~~~~
> open.c:127:48: note: each undeclared identifier is reported only once for each function it appears in
> 
> That line was changed a few hours ago, in commit
> 118c07e02e939c9f52688091509d4bff2a897032, also by Paul.

Thanks for reporting this.  lib/open.c should not be compiled in the
MinGW build.

Paul, this problem should be solved in Gnulib, because its open.m4
unconditionally forces lib/open.c to be compiled in the MinGW build:

  case "$host_os" in
    mingw* | pw*)
      REPLACE_OPEN=1
      ;;

The latest changes made this code run even in the MinGW build, not
sure why (perhaps because 'getrandom' uses 'open'?).  Emacs cannot use
Gnulib's 'open' (or any other function that takes file names and
operates on files), because Gnulib on Windows doesn't support UTF-8
encoded file names, which Emacs needs.  We have our own replacements
for 'open' and its ilk.  That is why nt/gnulib-cfg.mk says

  OMIT_GNULIB_MODULE_open = true

But this is no longer enough, since these latest changes.

Please provide a way to reliably avoid compiling lib/open.c on
Windows.  I needed to hack configure to make it build here.

Thanks.

P.S.  The 'getrandom' module had other MinGW-related problems, some of
which I fixed in master, and others were reported to the Gnulib
mailing list:

  https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00059.html





  reply	other threads:[~2020-06-28 15:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-27 21:28 bug#42095: 28.0.50; Build fails on Windows/MinGW64 Peder O. Klingenberg
2020-06-28 15:48 ` Eli Zaretskii [this message]
2020-06-28 19:36   ` Eli Zaretskii
2020-06-28 20:35     ` Paul Eggert
2020-06-29  2:28       ` Eli Zaretskii
2020-06-29  6:56         ` Paul Eggert
2020-06-29 14:52           ` Eli Zaretskii
2020-06-29 16:56             ` Paul Eggert
2020-06-29 18:45               ` Eli Zaretskii
2020-06-28 20:34   ` Paul Eggert
     [not found]   ` <e51b4ec2-2763-8d48-9724-2e26fe405373@cs.ucla.edu>
2020-06-29 14:13     ` Eli Zaretskii
     [not found]     ` <83r1ty0xk3.fsf@gnu.org>
2020-06-29 16:59       ` Paul Eggert
2020-06-28 22:20 ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83bll32ntx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=42095@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=peder@klingenberg.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).