public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf
@ 2021-11-17 16:07 tnfchris at gcc dot gnu.org
  2021-11-17 16:34 ` [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf aldyh at gcc dot gnu.org
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-17 16:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

            Bug ID: 103305
           Summary: [12 Regression] Cannot build aarch64-none-elf
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: build, wrong-code
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---
              Host: aarch64-none-linux-gnu
            Target: aarch64-none-elf
             Build: aarch64-none-elf

aarch64-none-elf stage2 cross builds which use newlib fail with:

/build-agent/temp/buildTmp/gcc-2/aarch64-none-elf/libstdc++-v3/include/aarch64-none-elf/bits/ctype_base.h:44:35:
error: '_U' was not declared in this scope
   44 |     static const mask upper     = _U;
      |                                   ^~
/build-agent/temp/buildTmp/gcc-2/aarch64-none-elf/libstdc++-v3/include/aarch64-none-elf/bits/ctype_base.h:45:35:
error: '_L' was not declared in this scope
   45 |     static const mask lower     = _L;
      |                                   ^~
/build-agent/temp/buildTmp/gcc-2/aarch64-none-elf/libstdc++-v3/include/aarch64-none-elf/bits/ctype_base.h:46:35:
error: '_U' was not declared in this scope
   46 |     static const mask alpha     = _U | _L;

and so on.

This looks like the exact same bug as PR103226 but have been asked to make a
new ticket.

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

* [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
@ 2021-11-17 16:34 ` aldyh at gcc dot gnu.org
  2021-11-17 17:19 ` redi at gcc dot gnu.org
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: aldyh at gcc dot gnu.org @ 2021-11-17 16:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|aarch64-none-elf            |aarch64-none-elf, bfin-elf
                 CC|                            |aldyh at gcc dot gnu.org
           See Also|https://gcc.gnu.org/bugzill |
                   |a/show_bug.cgi?id=103226    |
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-11-17
             Status|UNCONFIRMED                 |NEW
            Summary|[12 Regression] Cannot      |[12 Regression] Cannot
                   |build aarch64-none-elf      |build C++ with newlib on
                   |                            |aarch64-none-elf or
                   |                            |bfin-elf

--- Comment #1 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
Confirmed on a bfin-elf cross.  C++ does not build on a cross --with-newlib.

However, this is not the same problem in PR103226.

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

* [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
  2021-11-17 16:34 ` [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf aldyh at gcc dot gnu.org
@ 2021-11-17 17:19 ` redi at gcc dot gnu.org
  2021-11-17 18:01 ` tnfchris at gcc dot gnu.org
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-17 17:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |redi at gcc dot gnu.org

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
config/os/newlib/ctype_base.h hasn't changed in years, what changed?

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

* [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
  2021-11-17 16:34 ` [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf aldyh at gcc dot gnu.org
  2021-11-17 17:19 ` redi at gcc dot gnu.org
@ 2021-11-17 18:01 ` tnfchris at gcc dot gnu.org
  2021-11-17 18:05 ` tnfchris at gcc dot gnu.org
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-17 18:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #3 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
logs indicate that this started happening between 
3ba1bd0d9dbc..2ec453b566ac on Nov 12. However that range contains a suspicious
newlib commit
https://github.com/bminor/newlib/commit/3ba1bd0d9dbc015c14a0aaafcef042f706d1249a
which changed ctype_.h.  So that is likely the culprid.

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

* [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-11-17 18:01 ` tnfchris at gcc dot gnu.org
@ 2021-11-17 18:05 ` tnfchris at gcc dot gnu.org
  2021-11-17 18:26 ` redi at gcc dot gnu.org
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-17 18:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #4 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Looks like that commit moved the short named to ctype_.h instead of ctype.h.

I'm however unsure if this is something GCC needs to adapt to or if newlib
needs to fix this.  They claim it now matches glibc.

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

* [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-11-17 18:05 ` tnfchris at gcc dot gnu.org
@ 2021-11-17 18:26 ` redi at gcc dot gnu.org
  2021-11-17 18:31 ` redi at gcc dot gnu.org
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-17 18:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This should work:

--- a/libstdc++-v3/config/os/newlib/ctype_base.h
+++ b/libstdc++-v3/config/os/newlib/ctype_base.h
@@ -41,6 +41,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     // NB: Offsets into ctype<char>::_M_table force a particular size
     // on the mask type. Because of this, we don't use an enum.
     typedef char               mask;
+#if defined _U && defined _L && defined _N && defined _S
     static const mask upper            = _U;
     static const mask lower    = _L;
     static const mask alpha    = _U | _L;
@@ -52,6 +53,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     static const mask cntrl    = _C;
     static const mask punct    = _P;
     static const mask alnum    = _U | _L | _N;
+#else
+    static const mask upper            = _ISupper;
+    static const mask lower    = _ISlower;
+    static const mask alpha    = _ISupper | _ISlower;
+    static const mask digit    = _ISdigit;
+    static const mask xdigit   = _ISxdigit | _ISdigit;
+    static const mask space    = _ISspace;
+    static const mask print    = _ISpunct | _ISupper | _ISlower | _ISdigit |
_ISblank;
+    static const mask graph    = _ISpunct | _ISupper | _ISlower | _ISdigit;
+    static const mask cntrl    = _IScntrl;
+    static const mask punct    = _ISpunct;
+    static const mask alnum    = _ISupper | _ISlower | _ISdigit;
+#endif
 #if __cplusplus >= 201103L
     static const mask blank    = space;
 #endif


But of course we can't fix already-released versions.

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

* [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-11-17 18:26 ` redi at gcc dot gnu.org
@ 2021-11-17 18:31 ` redi at gcc dot gnu.org
  2021-11-18  8:36 ` [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib tnfchris at gcc dot gnu.org
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-17 18:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #5)
>      static const mask blank    = space;

We might want to use blank = _ISspace | _ISblank for this last one, but I don't
really understand what newlib defines those categories as:


#define isblank(__c) \
  __extension__ ({ __typeof__ (__c) __x = (__c);                \
        (__ctype_lookup(__x)&_B) || (int) (__x) == '\t';})
        (__ctype_lookup(__x)&_ISblank) || (int) (__x) == '\t';})

This definition is weird ... why is '\t' not already handled by _ISblank?

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-11-17 18:31 ` redi at gcc dot gnu.org
@ 2021-11-18  8:36 ` tnfchris at gcc dot gnu.org
  2021-11-18 15:02 ` tnfchris at gcc dot gnu.org
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-18  8:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #7 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Thanks Jakub! I'll apply the changes and do a regtest.

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-11-18  8:36 ` [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib tnfchris at gcc dot gnu.org
@ 2021-11-18 15:02 ` tnfchris at gcc dot gnu.org
  2021-11-18 15:51 ` redi at gcc dot gnu.org
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-18 15:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #8 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
This seems to work, would you like me to submit the patch or will you do it
Jakup?

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-11-18 15:02 ` tnfchris at gcc dot gnu.org
@ 2021-11-18 15:51 ` redi at gcc dot gnu.org
  2021-11-18 15:53 ` tnfchris at gcc dot gnu.org
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-18 15:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Assuming you mean me, I can't test it easily so please go ahead and push it
yourself. I hereby approve it for trunk.

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-11-18 15:51 ` redi at gcc dot gnu.org
@ 2021-11-18 15:53 ` tnfchris at gcc dot gnu.org
  2021-11-19  8:48 ` cvs-commit at gcc dot gnu.org
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-18 15:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #10 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Oh yes, sorry, I kept saying the wrong name :)

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2021-11-18 15:53 ` tnfchris at gcc dot gnu.org
@ 2021-11-19  8:48 ` cvs-commit at gcc dot gnu.org
  2021-11-19  8:52 ` tnfchris at gcc dot gnu.org
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-19  8:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tamar Christina <tnfchris@gcc.gnu.org>:

https://gcc.gnu.org/g:0e510ab53414430e93c6f5b64841e2f40031cda7

commit r12-5396-g0e510ab53414430e93c6f5b64841e2f40031cda7
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Fri Nov 19 08:48:11 2021 +0000

    libstdc++: Fix ctype changed after newlib update.

    Newlib changed ctype.h recently[1] by moving the short labels from ctype.h
intro
    the private namespace in ctype_.h.  This broke embedded builds due to them
no
    longer being found.  Instead they now expose the long names to match glibc.

    This patch now uses the short or long names depending on is the short ones
are
    defined or not.

    [1]
https://github.com/bminor/newlib/commit/3ba1bd0d9dbc015c14a0aaafcef042f706d1249a

    libstdc++-v3/ChangeLog:

            PR libstdc++/103305
            * config/os/newlib/ctype_base.h (upper, lower, alpha, digit,
xdigit,
            space, print, graph, cntrl, punct, alnum, blank): Use short or long
            names depending on if short ones are defined.

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2021-11-19  8:48 ` cvs-commit at gcc dot gnu.org
@ 2021-11-19  8:52 ` tnfchris at gcc dot gnu.org
  2021-11-19  9:02 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-19  8:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #12 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Fixed on master, is this something we'd want to backport to active branches?

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2021-11-19  8:52 ` tnfchris at gcc dot gnu.org
@ 2021-11-19  9:02 ` redi at gcc dot gnu.org
  2021-11-20 14:55 ` pexu@gcc-bugzilla.mail.kapsi.fi
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-19  9:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes, I think so, otherwise you can only use GCC trunk with the latest newlib.
Maybe give it a week to see if anybody notices problems with the new code, then
backport. Thanks!

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2021-11-19  9:02 ` redi at gcc dot gnu.org
@ 2021-11-20 14:55 ` pexu@gcc-bugzilla.mail.kapsi.fi
  2021-11-20 15:52 ` redi at gcc dot gnu.org
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pexu@gcc-bugzilla.mail.kapsi.fi @ 2021-11-20 14:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

Pekka S <pexu@gcc-bugzilla.mail.kapsi.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pexu@gcc-bugzilla.mail.kaps
                   |                            |i.fi

--- Comment #14 from Pekka S <pexu@gcc-bugzilla.mail.kapsi.fi> ---
(In reply to Jonathan Wakely from comment #6)
> (In reply to Jonathan Wakely from comment #5)
> >      static const mask blank    = space;
> 
> We might want to use blank = _ISspace | _ISblank for this last one, but I
> don't really understand what newlib defines those categories as:
> 
> 
> #define isblank(__c) \
>   __extension__ ({ __typeof__ (__c) __x = (__c);		\
>         (__ctype_lookup(__x)&_B) || (int) (__x) == '\t';})
>         (__ctype_lookup(__x)&_ISblank) || (int) (__x) == '\t';})
> 
> This definition is weird ... why is '\t' not already handled by _ISblank?

It has been attempted in the past:

https://sourceware.org/legacy-ml/newlib/2009/threads.html#00342

The used 8-bit mask is simply not wide enough to disambiguate all POSIX
character classes;  Namely space, blank and print classes are the problematic
ones to distinguish properly.  The naming of newlib character classes does not
fully align with POSIX, and this has to do with the restrictions that come from
space concerns and limitations.

Also, libstdc++-v3/config/locale/newlib/ctype_members.cc does not handle blank
class even though newlib supports wctype("blank").  As explained above, in this
case it really doesn't matter, since matching a character to a (true POSIX)
class using a mask bit alone is not possible.

Anyway, I made a similar patch but never got around submitting it.  I also used
_ISblank | _ISspace since IMHO it is "less wrong" than _ISspace (or equal to
space) alone and added a note explaining the issue.

(Yes, I was about to repeat the history.)

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2021-11-20 14:55 ` pexu@gcc-bugzilla.mail.kapsi.fi
@ 2021-11-20 15:52 ` redi at gcc dot gnu.org
  2021-11-23 10:57 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-20 15:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #15 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks for the explanation! If you have other suggestions to make things less
wrong they'll be welcome.

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2021-11-20 15:52 ` redi at gcc dot gnu.org
@ 2021-11-23 10:57 ` redi at gcc dot gnu.org
  2021-11-23 10:59 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-23 10:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vapier at gcc dot gnu.org

--- Comment #16 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Mike F, is it really necessary to break C++ in every GCC release to work around
a bug you introduced to sim/mips/interp.c a few months ago? _P is a reserved
name, why is it used in that code at all?

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2021-11-23 10:57 ` redi at gcc dot gnu.org
@ 2021-11-23 10:59 ` redi at gcc dot gnu.org
  2021-11-23 11:01 ` redi at gcc dot gnu.org
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-23 10:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The sim code should be fixed, period. It currently has undefined behaviour.

If the newlib change is still desirable, it would be nice if it was conditional
on the __GNUC__ version, so old versions of GCC can still be built. Maybe just
do this in <ctype.h>:

#if __GNUC__ < 12
#include <ctype_.h>
#endif

So the old macros are still defined.

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2021-11-23 10:59 ` redi at gcc dot gnu.org
@ 2021-11-23 11:01 ` redi at gcc dot gnu.org
  2021-11-23 11:07 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-23 11:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> ---

--- a/sim/mips/interp.c
+++ b/sim/mips/interp.c
@@ -1472,14 +1472,14 @@ sim_monitor (SIM_DESC sd,
                          sim_io_printf(sd,"<binary not supported>");
                        else
                          {
-#define _P(c, fmt64, fmt32) \
+#define P2(c, fmt64, fmt32) \
   case c: \
     if (longlong) \
       sim_io_printf (sd, "%" fmt64, lv); \
     else \
       sim_io_printf (sd, "%" fmt32, (int)lv); \
     break;
-#define P(c, fmtc) _P(c, PRI##fmtc##64, PRI##fmtc##32)
+#define P(c, fmtc) P2(c, PRI##fmtc##64, PRI##fmtc##32)
                            switch (c)
                              {
                              P('d', d)
@@ -1490,7 +1490,7 @@ sim_monitor (SIM_DESC sd,
                              }
                          }
 #undef P
-#undef _P
+#undef P2
                      }
                    else if (strchr ("eEfgG", c))
                      {

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2021-11-23 11:01 ` redi at gcc dot gnu.org
@ 2021-11-23 11:07 ` redi at gcc dot gnu.org
  2021-11-30 11:24 ` tnfchris at gcc dot gnu.org
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-23 11:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #19 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #17)
> If the newlib change is still desirable, it would be nice if it was
> conditional on the __GNUC__ version, so old versions of GCC can still be
> built. Maybe just do this in <ctype.h>:

Or this, to limit it to just C++:


--- a/newlib/libc/include/ctype.h
+++ b/newlib/libc/include/ctype.h
@@ -181,6 +181,13 @@ __locale_ctype_ptr_l(locale_t _l)

 #endif /* !__cplusplus */

+#if defined(__GNUC__) && defined(__cplusplus)
+# if __GNUC__ < 12
+/* Libstdc++ uses _U, _L etc. */
+#  include <ctype_.h>
+# endif
+#endif
+
 _END_STD_C

 #endif /* _CTYPE_H_ */

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2021-11-23 11:07 ` redi at gcc dot gnu.org
@ 2021-11-30 11:24 ` tnfchris at gcc dot gnu.org
  2021-12-03 11:55 ` rearnsha at gcc dot gnu.org
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-11-30 11:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #20 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Newlib ML thread https://sourceware.org/pipermail/newlib/2021/018706.html

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2021-11-30 11:24 ` tnfchris at gcc dot gnu.org
@ 2021-12-03 11:55 ` rearnsha at gcc dot gnu.org
  2021-12-06  9:28 ` tnfchris at gcc dot gnu.org
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2021-12-03 11:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #21 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
The newlib change that caused this has now been reverted:

https://sourceware.org/pipermail/newlib/2021/018747.html

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2021-12-03 11:55 ` rearnsha at gcc dot gnu.org
@ 2021-12-06  9:28 ` tnfchris at gcc dot gnu.org
  2021-12-06 10:45 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-06  9:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #22 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Ok, great, Jonathan what do you want to do, do we need to revert the commit or
just close this?

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2021-12-06  9:28 ` tnfchris at gcc dot gnu.org
@ 2021-12-06 10:45 ` redi at gcc dot gnu.org
  2021-12-07 10:46 ` cvs-commit at gcc dot gnu.org
  2021-12-07 10:47 ` tnfchris at gcc dot gnu.org
  24 siblings, 0 replies; 26+ messages in thread
From: redi at gcc dot gnu.org @ 2021-12-06 10:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #23 from Jonathan Wakely <redi at gcc dot gnu.org> ---
We should revert it. Could you do that (after checking the reverted libstdc++
code works with the latest newlib code) please?

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2021-12-06 10:45 ` redi at gcc dot gnu.org
@ 2021-12-07 10:46 ` cvs-commit at gcc dot gnu.org
  2021-12-07 10:47 ` tnfchris at gcc dot gnu.org
  24 siblings, 0 replies; 26+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-07 10:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

--- Comment #24 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tamar Christina <tnfchris@gcc.gnu.org>:

https://gcc.gnu.org/g:ba6bb287f03d42ab6c4f39ce99dcf94ec5113655

commit r12-5819-gba6bb287f03d42ab6c4f39ce99dcf94ec5113655
Author: Tamar Christina <tamar.christina@arm.com>
Date:   Tue Dec 7 10:37:30 2021 +0000

    Revert "libstdc++: Fix ctype changed after newlib update."

    Newlib has reverted the commit that caused us to require a
    workaround.  As such we can now revert the workaround.

    This reverts commit 0e510ab53414430e93c6f5b64841e2f40031cda7.

    libstdc++-v3/ChangeLog:

            PR libstdc++/103305
            * config/os/newlib/ctype_base.h (upper, lower, alpha, digit,
xdigit,
            space, print, graph, cntrl, punct, alnum, blank): Revert.

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

* [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib
  2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
                   ` (23 preceding siblings ...)
  2021-12-07 10:46 ` cvs-commit at gcc dot gnu.org
@ 2021-12-07 10:47 ` tnfchris at gcc dot gnu.org
  24 siblings, 0 replies; 26+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2021-12-07 10:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103305

Tamar Christina <tnfchris at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #25 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Confirmed that it builds again without needing the patch so reverted it.

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

end of thread, other threads:[~2021-12-07 10:47 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 16:07 [Bug bootstrap/103305] New: [12 Regression] Cannot build aarch64-none-elf tnfchris at gcc dot gnu.org
2021-11-17 16:34 ` [Bug bootstrap/103305] [12 Regression] Cannot build C++ with newlib on aarch64-none-elf or bfin-elf aldyh at gcc dot gnu.org
2021-11-17 17:19 ` redi at gcc dot gnu.org
2021-11-17 18:01 ` tnfchris at gcc dot gnu.org
2021-11-17 18:05 ` tnfchris at gcc dot gnu.org
2021-11-17 18:26 ` redi at gcc dot gnu.org
2021-11-17 18:31 ` redi at gcc dot gnu.org
2021-11-18  8:36 ` [Bug libstdc++/103305] Cannot build libstdc++ with newlib on aarch64-none-elf or bfin-elf with new version of newlib tnfchris at gcc dot gnu.org
2021-11-18 15:02 ` tnfchris at gcc dot gnu.org
2021-11-18 15:51 ` redi at gcc dot gnu.org
2021-11-18 15:53 ` tnfchris at gcc dot gnu.org
2021-11-19  8:48 ` cvs-commit at gcc dot gnu.org
2021-11-19  8:52 ` tnfchris at gcc dot gnu.org
2021-11-19  9:02 ` redi at gcc dot gnu.org
2021-11-20 14:55 ` pexu@gcc-bugzilla.mail.kapsi.fi
2021-11-20 15:52 ` redi at gcc dot gnu.org
2021-11-23 10:57 ` redi at gcc dot gnu.org
2021-11-23 10:59 ` redi at gcc dot gnu.org
2021-11-23 11:01 ` redi at gcc dot gnu.org
2021-11-23 11:07 ` redi at gcc dot gnu.org
2021-11-30 11:24 ` tnfchris at gcc dot gnu.org
2021-12-03 11:55 ` rearnsha at gcc dot gnu.org
2021-12-06  9:28 ` tnfchris at gcc dot gnu.org
2021-12-06 10:45 ` redi at gcc dot gnu.org
2021-12-07 10:46 ` cvs-commit at gcc dot gnu.org
2021-12-07 10:47 ` tnfchris at gcc dot gnu.org

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