public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)
@ 2021-02-03 16:43 Mikael Pettersson
  2021-02-05  8:35 ` Arnaud Charlet
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Pettersson @ 2021-02-03 16:43 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

This fixes the bootstrap failure with Ada on Cygwin since the switch
to C++11. The configure checks detect that fileno_unlocked () is
present, but when Ada's cstreams.c is compiled in C++11 mode,
<stdio.h> does not declare it, causing a hard error.

Fixed by defining _GNU_SOURCE before including <stdio.h>.

Ok for the master branch?

gcc/ada/

2021-02-03  Mikael Pettersson  <mikpelinux@gmail.com>

        PR bootstrap/98590
        * cstreams.c: Ensure fileno_unlocked() is visible on Cygwin.

diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index 4e00dedbbd6..9d2f41c5269 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -37,6 +37,11 @@
 #define _FILE_OFFSET_BITS 64
 /* the define above will make off_t a 64bit type on GNU/Linux */

+/* tell Cygwin's <stdio.h> to expose fileno_unlocked() to work around
PR98590 */
+#if defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(_GNU_SOURCE)
+#define _GNU_SOURCE
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>

[-- Attachment #2: 0001-Ensure-fileno_unlocked-is-visible-on-Cygwin.patch --]
[-- Type: text/x-patch, Size: 814 bytes --]

From 7a277d8c2a6c1d4ccfbb0ca350e4b1f35a3e575c Mon Sep 17 00:00:00 2001
From: Mikael Pettersson <mikpelinux@gmail.com>
Date: Wed, 3 Feb 2021 17:25:42 +0100
Subject: [PATCH] Ensure fileno_unlocked() is visible on Cygwin.

---
 gcc/ada/cstreams.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index 4e00dedbbd6..9d2f41c5269 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -37,6 +37,11 @@
 #define _FILE_OFFSET_BITS 64
 /* the define above will make off_t a 64bit type on GNU/Linux */
 
+/* tell Cygwin's <stdio.h> to expose fileno_unlocked() to work around PR98590 */
+#if defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(_GNU_SOURCE)
+#define _GNU_SOURCE
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-- 
2.26.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)
  2021-02-03 16:43 [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590) Mikael Pettersson
@ 2021-02-05  8:35 ` Arnaud Charlet
  2021-02-05 13:49   ` Mikael Pettersson
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaud Charlet @ 2021-02-05  8:35 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: GCC Patches, Arnaud Charlet

> This fixes the bootstrap failure with Ada on Cygwin since the switch
> to C++11. The configure checks detect that fileno_unlocked () is
> present, but when Ada's cstreams.c is compiled in C++11 mode,
> <stdio.h> does not declare it, causing a hard error.
> 
> Fixed by defining _GNU_SOURCE before including <stdio.h>.
> 
> Ok for the master branch?
> 
> gcc/ada/
> 
> 2021-02-03  Mikael Pettersson  <mikpelinux@gmail.com>
> 
>         PR bootstrap/98590
>         * cstreams.c: Ensure fileno_unlocked() is visible on Cygwin.

We'd rather not have PR references in the source files, so please remove it 
(it will be there as part of the commit log and git annotate).

OK with the comment updated.

> diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
> index 4e00dedbbd6..9d2f41c5269 100644
> --- a/gcc/ada/cstreams.c
> +++ b/gcc/ada/cstreams.c
> @@ -37,6 +37,11 @@
>  #define _FILE_OFFSET_BITS 64
>  /* the define above will make off_t a 64bit type on GNU/Linux */
> 
> +/* tell Cygwin's <stdio.h> to expose fileno_unlocked() to work around
> PR98590 */
> +#if defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(_GNU_SOURCE)
> +#define _GNU_SOURCE
> +#endif
> +
>  #include <stdio.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)
  2021-02-05  8:35 ` Arnaud Charlet
@ 2021-02-05 13:49   ` Mikael Pettersson
  2021-02-05 13:59     ` Arnaud Charlet
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Pettersson @ 2021-02-05 13:49 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 1495 bytes --]

On Fri, Feb 5, 2021 at 9:35 AM Arnaud Charlet <charlet@adacore.com> wrote:
>
> > This fixes the bootstrap failure with Ada on Cygwin since the switch
> > to C++11. The configure checks detect that fileno_unlocked () is
> > present, but when Ada's cstreams.c is compiled in C++11 mode,
> > <stdio.h> does not declare it, causing a hard error.
> >
> > Fixed by defining _GNU_SOURCE before including <stdio.h>.
> >
> > Ok for the master branch?
> >
> > gcc/ada/
> >
> > 2021-02-03  Mikael Pettersson  <mikpelinux@gmail.com>
> >
> >         PR bootstrap/98590
> >         * cstreams.c: Ensure fileno_unlocked() is visible on Cygwin.
>
> We'd rather not have PR references in the source files, so please remove it
> (it will be there as part of the commit log and git annotate).
>
> OK with the comment updated.

Thanks, here's the revised patch.

gcc/ada/

2021-02-05  Mikael Pettersson  <mikpelinux@gmail.com>

        PR bootstrap/98590
        * cstreams.c: Ensure fileno_unlocked() is visible on Cygwin.

diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index 4e00dedbbd6..7d64277110b 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -37,6 +37,11 @@
 #define _FILE_OFFSET_BITS 64
 /* the define above will make off_t a 64bit type on GNU/Linux */

+/* tell Cygwin's <stdio.h> to expose fileno_unlocked() */
+#if defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(_GNU_SOURCE)
+#define _GNU_SOURCE
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>

[-- Attachment #2: 0001-Ensure-fileno_unlocked-is-visible-on-Cygwin.patch --]
[-- Type: text/x-patch, Size: 791 bytes --]

From f9b9b44f5341b0d8df7b1bb00de6f7231258891b Mon Sep 17 00:00:00 2001
From: Mikael Pettersson <mikpelinux@gmail.com>
Date: Fri, 5 Feb 2021 14:43:52 +0100
Subject: [PATCH] Ensure fileno_unlocked() is visible on Cygwin.

---
 gcc/ada/cstreams.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index 4e00dedbbd6..7d64277110b 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -37,6 +37,11 @@
 #define _FILE_OFFSET_BITS 64
 /* the define above will make off_t a 64bit type on GNU/Linux */
 
+/* tell Cygwin's <stdio.h> to expose fileno_unlocked() */
+#if defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(_GNU_SOURCE)
+#define _GNU_SOURCE
+#endif
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-- 
2.26.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)
  2021-02-05 13:49   ` Mikael Pettersson
@ 2021-02-05 13:59     ` Arnaud Charlet
  2021-02-26 15:24       ` Mikael Pettersson
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaud Charlet @ 2021-02-05 13:59 UTC (permalink / raw)
  To: Mikael Pettersson; +Cc: GCC Patches, Arnaud Charlet

> > We'd rather not have PR references in the source files, so please remove it
> > (it will be there as part of the commit log and git annotate).
> >
> > OK with the comment updated.
> 
> Thanks, here's the revised patch.

OK, thanks.

> gcc/ada/
> 
> 2021-02-05  Mikael Pettersson  <mikpelinux@gmail.com>
> 
>         PR bootstrap/98590
>         * cstreams.c: Ensure fileno_unlocked() is visible on Cygwin.
> 
> diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
> index 4e00dedbbd6..7d64277110b 100644
> --- a/gcc/ada/cstreams.c
> +++ b/gcc/ada/cstreams.c
> @@ -37,6 +37,11 @@
>  #define _FILE_OFFSET_BITS 64
>  /* the define above will make off_t a 64bit type on GNU/Linux */
> 
> +/* tell Cygwin's <stdio.h> to expose fileno_unlocked() */
> +#if defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(_GNU_SOURCE)
> +#define _GNU_SOURCE
> +#endif
> +
>  #include <stdio.h>
>  #include <sys/types.h>
>  #include <sys/stat.h>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)
  2021-02-05 13:59     ` Arnaud Charlet
@ 2021-02-26 15:24       ` Mikael Pettersson
  2021-03-02 22:20         ` Jeff Law
  0 siblings, 1 reply; 6+ messages in thread
From: Mikael Pettersson @ 2021-02-26 15:24 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: GCC Patches

On Fri, Feb 5, 2021 at 2:59 PM Arnaud Charlet <charlet@adacore.com> wrote:
>
> > > We'd rather not have PR references in the source files, so please remove it
> > > (it will be there as part of the commit log and git annotate).
> > >
> > > OK with the comment updated.
> >
> > Thanks, here's the revised patch.
>
> OK, thanks.

I forgot to mention that I don't have commit rights to gcc, so can
someone please commit this for me? Thanks.

>
> > gcc/ada/
> >
> > 2021-02-05  Mikael Pettersson  <mikpelinux@gmail.com>
> >
> >         PR bootstrap/98590
> >         * cstreams.c: Ensure fileno_unlocked() is visible on Cygwin.
> >
> > diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
> > index 4e00dedbbd6..7d64277110b 100644
> > --- a/gcc/ada/cstreams.c
> > +++ b/gcc/ada/cstreams.c
> > @@ -37,6 +37,11 @@
> >  #define _FILE_OFFSET_BITS 64
> >  /* the define above will make off_t a 64bit type on GNU/Linux */
> >
> > +/* tell Cygwin's <stdio.h> to expose fileno_unlocked() */
> > +#if defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(_GNU_SOURCE)
> > +#define _GNU_SOURCE
> > +#endif
> > +
> >  #include <stdio.h>
> >  #include <sys/types.h>
> >  #include <sys/stat.h>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590)
  2021-02-26 15:24       ` Mikael Pettersson
@ 2021-03-02 22:20         ` Jeff Law
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Law @ 2021-03-02 22:20 UTC (permalink / raw)
  To: Mikael Pettersson, Arnaud Charlet; +Cc: GCC Patches



On 2/26/21 8:24 AM, Mikael Pettersson via Gcc-patches wrote:
> On Fri, Feb 5, 2021 at 2:59 PM Arnaud Charlet <charlet@adacore.com> wrote:
>>>> We'd rather not have PR references in the source files, so please remove it
>>>> (it will be there as part of the commit log and git annotate).
>>>>
>>>> OK with the comment updated.
>>> Thanks, here's the revised patch.
>> OK, thanks.
> I forgot to mention that I don't have commit rights to gcc, so can
> someone please commit this for me? Thanks.
Thanks.  Pushed to the trunk.

jeff


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-02 22:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 16:43 [PATCH] Fix Ada bootstrap failure on Cygwin since switch to C++11 (PR98590) Mikael Pettersson
2021-02-05  8:35 ` Arnaud Charlet
2021-02-05 13:49   ` Mikael Pettersson
2021-02-05 13:59     ` Arnaud Charlet
2021-02-26 15:24       ` Mikael Pettersson
2021-03-02 22:20         ` Jeff Law

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).