From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#42095: 28.0.50; Build fails on Windows/MinGW64 Date: Sun, 28 Jun 2020 13:34:36 -0700 Organization: UCLA Computer Science Department Message-ID: References: <878sg819n2.fsf@klingenberg.no> <83bll32ntx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------9A99DC4FB46282629675EDB1" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="8480"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: Gnulib bugs , "Peder O. Klingenberg" , 42095@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 28 22:35:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpe1B-0002AR-Is for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jun 2020 22:35:13 +0200 Original-Received: from localhost ([::1]:44482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jpe1A-0003DD-IR for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Jun 2020 16:35:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jpe10-0003D4-Cp for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2020 16:35:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jpe0z-00060F-SV for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2020 16:35:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jpe0z-0001N4-Px for bug-gnu-emacs@gnu.org; Sun, 28 Jun 2020 16:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Jun 2020 20:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42095 X-GNU-PR-Package: emacs Original-Received: via spool by 42095-submit@debbugs.gnu.org id=B42095.15933764875243 (code B ref 42095); Sun, 28 Jun 2020 20:35:01 +0000 Original-Received: (at 42095) by debbugs.gnu.org; 28 Jun 2020 20:34:47 +0000 Original-Received: from localhost ([127.0.0.1]:47057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpe0l-0001MV-34 for submit@debbugs.gnu.org; Sun, 28 Jun 2020 16:34:47 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:54644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jpe0j-0001MI-Bz for 42095@debbugs.gnu.org; Sun, 28 Jun 2020 16:34:46 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id DA01C160093; Sun, 28 Jun 2020 13:34:39 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id m9OsrvB-pHn4; Sun, 28 Jun 2020 13:34:38 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id ED8811600B5; Sun, 28 Jun 2020 13:34:37 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id E1wgw9meFUaX; Sun, 28 Jun 2020 13:34:37 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-75-82-69-226.socal.res.rr.com [75.82.69.226]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 6F86E160093; Sun, 28 Jun 2020 13:34:37 -0700 (PDT) Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkV5QWNtUUJFQURB QXlIMnhvVHU3cHBHNUQzYThGTVpFb243NGRDdmM0K3ExWEEySjJ0QnkycHdhVHFmCmhweHhk R0E5Smo1MFVKM1BENGJTVUVnTjh0TFowc2FuNDdsNVhUQUZMaTI0NTZjaVNsNW04c0thSGxH ZHQ5WG0KQUF0bVhxZVpWSVlYL1VGUzk2ZkR6ZjR4aEVtbS95N0xiWUVQUWRVZHh1NDd4QTVL aFRZcDVibHRGM1dZRHoxWQpnZDdneDA3QXV3cDdpdzdlTnZub0RUQWxLQWw4S1lEWnpiRE5D UUdFYnBZM2VmWkl2UGRlSStGV1FONFcra2doCnkrUDZhdTZQcklJaFlyYWV1YTdYRGRiMkxT MWVuM1NzbUUzUWpxZlJxSS9BMnVlOEpNd3N2WGUvV0szOEV6czYKeDc0aVRhcUkzQUZINmls QWhEcXBNbmQvbXNTRVNORnQ3NkRpTzFaS1FNcjlhbVZQa25qZlBtSklTcWRoZ0IxRApsRWR3 MzRzUk9mNlY4bVp3MHhmcVQ2UEtFNDZMY0ZlZnpzMGtiZzRHT1JmOHZqRzJTZjF0azVlVThN Qml5Ti9iClowM2JLTmpOWU1wT0REUVF3dVA4NGtZTGtYMndCeHhNQWhCeHdiRFZadWR6eERa SjFDMlZYdWpDT0pWeHEya2wKakJNOUVUWXVVR3FkNzVBVzJMWHJMdzYrTXVJc0hGQVlBZ1Jy NytLY3dEZ0JBZndoU In-Reply-To: <83bll32ntx.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:182487 Archived-At: This is a multi-part message in MIME format. --------------9A99DC4FB46282629675EDB1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit [ccing bug-gnulib; this is about .] > The latest changes made this code run even in the MinGW build, not > sure why (perhaps because 'getrandom' uses 'open'?). That's part of it. It's also needed for recent changes to the getloadavg module. And I see that the at-internal module also depends on the 'open' module, I presume because lib/openat-proc.c opens /proc/self/fd/NNN/, but this surely won't work in mingw. As I understand it the basic issue here is that we want O_CLOEXEC support even on platforms that lack it, and we don't want all the calling software to play games with "#ifdef O_CLOEXEC" and the like. I attempted to work around this particular problem by installing the attached workaround into Gnulib and updating Emacs accordingly. Please give it a try. Perhaps this should be fixed more systematically in Gnulib instead of worked around, but I suppose that might entail some merging between Emacs's and Gnulib's ways of dealing with file names under MS-Windows and I'll leave it to the MS-Windows experts to figure out how to do that, or whether they want to do it at all. --------------9A99DC4FB46282629675EDB1 Content-Type: text/x-patch; charset=UTF-8; name="0001-getrandom-do-not-depend-on-open-on-mingw.patch" Content-Disposition: attachment; filename="0001-getrandom-do-not-depend-on-open-on-mingw.patch" Content-Transfer-Encoding: quoted-printable >From a01be1645717a029e571fd0dbb42245f05aff88c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 28 Jun 2020 13:18:11 -0700 Subject: [PATCH] =3D?UTF-8?q?getrandom:=3D20do=3D20not=3D20depend=3D20on=3D= 20=3DE2=3D80=3D98?=3D =3D?UTF-8?q?open=3DE2=3D80=3D99=3D20on=3D20mingw?=3D MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Similarly for at-internal, getloadavg. These modules do not call the =E2=80=98open=E2=80=99 function when they are compiled on mingw. On = mingw, this avoids having to compile open.c when building Emacs, which does its own thing with =E2=80=98open=E2=80=99. * modules/at-internal, modules/getloadavg, modules/getrandom: (Depends-on): Don=E2=80=99t depend on =E2=80=98open=E2=80=99 on mingw. (Depends-on): Require AC_CANONICAL_HOST, for host_os. * modules/getloadavg (Depends-on): Depend on intprops, open, stdbool, stdlib only if compiling getloadavg.c. --- ChangeLog | 14 ++++++++++++++ modules/at-internal | 3 ++- modules/getloadavg | 9 +++++---- modules/getrandom | 3 ++- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84a1bd472..c6e26120e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2020-06-28 Paul Eggert + + getrandom: do not depend on =E2=80=98open=E2=80=99 on mingw + Similarly for at-internal, getloadavg. These modules do not call + the =E2=80=98open=E2=80=99 function when they are compiled on mingw. O= n mingw, + this avoids having to compile open.c when building Emacs, which + does its own thing with =E2=80=98open=E2=80=99. + * modules/at-internal, modules/getloadavg, modules/getrandom: + (Depends-on): Don=E2=80=99t depend on =E2=80=98open=E2=80=99 on mingw. + (Depends-on): Require AC_CANONICAL_HOST, for host_os. + * modules/getloadavg (Depends-on): + Depend on intprops, open, stdbool, stdlib only if compiling + getloadavg.c. + 2020-06-28 Bruno Haible =20 doc: Add a note about sigprocmask vs. pthread_sigmask. diff --git a/modules/at-internal b/modules/at-internal index d58c9b0b4..2a37779f7 100644 --- a/modules/at-internal +++ b/modules/at-internal @@ -9,11 +9,12 @@ Depends-on: errno fcntl-h intprops -open +open [case $host_os in mingw*) false;; *) :;; esac] sys_stat unistd =20 configure.ac: +AC_REQUIRE([AC_CANONICAL_HOST]) =20 Makefile.am: lib_SOURCES +=3D openat-priv.h openat-proc.c diff --git a/modules/getloadavg b/modules/getloadavg index 8adb9a784..21955b782 100644 --- a/modules/getloadavg +++ b/modules/getloadavg @@ -7,12 +7,13 @@ m4/getloadavg.m4 =20 Depends-on: extensions -intprops -open -stdbool -stdlib +intprops [test $HAVE_GETLOADAVG =3D 0] +open [case $host_os in mingw*) false;; *) test $HAVE_GETLOADAVG =3D= 0;; esac] +stdbool [test $HAVE_GETLOADAVG =3D 0] +stdlib [test $HAVE_GETLOADAVG =3D 0] =20 configure.ac: +AC_REQUIRE([AC_CANONICAL_HOST]) gl_GETLOADAVG if test $HAVE_GETLOADAVG =3D 0; then AC_LIBOBJ([getloadavg]) diff --git a/modules/getrandom b/modules/getrandom index 76437eb5a..f1c359706 100644 --- a/modules/getrandom +++ b/modules/getrandom @@ -9,9 +9,10 @@ Depends-on: sys_random fcntl-h [test $HAVE_GETRANDOM =3D 0 || test $REPLACE_GETRAND= OM =3D 1] minmax [test $HAVE_GETRANDOM =3D 0 || test $REPLACE_GETRAND= OM =3D 1] -open [test $HAVE_GETRANDOM =3D 0 || test $REPLACE_GETRAND= OM =3D 1] +open [case $host_os in mingw*) false;; *) test $HAVE_GETR= ANDOM =3D 0 || test $REPLACE_GETRANDOM =3D 1;; esac] =20 configure.ac: +AC_REQUIRE([AC_CANONICAL_HOST]) gl_FUNC_GETRANDOM if test $HAVE_GETRANDOM =3D 0 || test $REPLACE_GETRANDOM =3D 1; then AC_LIBOBJ([getrandom]) --=20 2.17.1 --------------9A99DC4FB46282629675EDB1--