public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti
@ 2021-02-11 23:39 redi at gcc dot gnu.org
  2021-02-11 23:39 ` [Bug libstdc++/99077] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2021-02-11 23:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99077
           Summary: [9/10/11 Regression] Cannot build libstdc++ with
                    -fno-rtti
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

In file included from
/home/jwakely/src/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/iosfwd:38,
                 from
/home/jwakely/src/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/ios:38,
                 from
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:30:
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc: In
function ‘void std::__throw_ios_failure(const char*, int)’:
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:174:54:
error: no matching function for call to ‘std::ios_base::failure::failure(char*,
int&)’
  174 |   { _GLIBCXX_THROW_OR_ABORT(__ios_failure(_(str), err)); }
      |                                                      ^
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:93:3:
note: candidate: ‘std::ios_base::failure::failure(const char*, const
std::error_code&)’
   93 |   ios_base::failure::failure(const char* __str, const error_code& __ec)
      |   ^~~~~~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:93:67:
note:   no known conversion for argument 2 from ‘int’ to ‘const
std::error_code&’
   93 |   ios_base::failure::failure(const char* __str, const error_code& __ec)
      |                                                 ~~~~~~~~~~~~~~~~~~^~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:90:3:
note: candidate: ‘std::ios_base::failure::failure(const string&, const
std::error_code&)’
   90 |   ios_base::failure::failure(const string& __str, const error_code&
__ec)
      |   ^~~~~~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:90:69:
note:   no known conversion for argument 2 from ‘int’ to ‘const
std::error_code&’
   90 |   ios_base::failure::failure(const string& __str, const error_code&
__ec)
      |                                                  
~~~~~~~~~~~~~~~~~~^~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:87:3:
note: candidate: ‘std::ios_base::failure::failure(const string&)’
   87 |   ios_base::failure::failure(const string& __str)
      |   ^~~~~~~~
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:87:3:
note:   candidate expects 1 argument, 2 provided
In file included from
/home/jwakely/src/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/ios:42,
                 from
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:30:
/home/jwakely/src/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ios_base.h:255:34:
note: candidate: ‘std::ios_base::failure::failure(const
std::ios_base::failure&)’
  255 |     class _GLIBCXX_ABI_TAG_CXX11 failure : public system_error
      |                                  ^~~~~~~
/home/jwakely/src/gcc/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ios_base.h:255:34:
note:   candidate expects 1 argument, 2 provided
/home/jwakely/src/gcc/gcc/libstdc++-v3/src/c++11/cxx11-ios_failure.cc:174:58:
warning: ‘noreturn’ function does return
  174 |   { _GLIBCXX_THROW_OR_ABORT(__ios_failure(_(str), err)); }
      |                                                          ^
make[3]: *** [Makefile:855: cxx11-ios_failure-lt.s] Error 1

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

* [Bug libstdc++/99077] [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti
  2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
@ 2021-02-11 23:39 ` redi at gcc dot gnu.org
  2021-02-11 23:42 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2021-02-11 23:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
      Known to fail|                            |10.2.0, 11.0, 9.3.0
   Last reconfirmed|                            |2021-02-11
   Target Milestone|---                         |9.4
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
      Known to work|                            |8.4.0

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I have a patch

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

* [Bug libstdc++/99077] [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti
  2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
  2021-02-11 23:39 ` [Bug libstdc++/99077] " redi at gcc dot gnu.org
@ 2021-02-11 23:42 ` redi at gcc dot gnu.org
  2021-02-12 14:43 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2021-02-11 23:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
--- a/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
+++ b/libstdc++-v3/src/c++11/cxx11-ios_failure.cc
@@ -114,7 +114,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __ios_failure(const char* s) : failure(s)
     { __construct_ios_failure(buf, runtime_error::what()); }

-    __ios_failure(const char* s, int e) : failure(s, to_error_code(e))
+    __ios_failure(const char* s, const error_code& e) : failure(s, e)
     { __construct_ios_failure(buf, runtime_error::what()); }

     ~__ios_failure()
@@ -125,10 +125,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     // There are assertions in src/c++98/ios_failure.cc to ensure the size
     // and alignment assumptions are valid.
     alignas(runtime_error) unsigned char buf[sizeof(runtime_error)];
-
-    static error_code
-    to_error_code(int e)
-    { return e ? error_code(e, system_category()) : io_errc::stream; }
   };

   // Custom type info for __ios_failure.
@@ -171,7 +167,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   void
   __throw_ios_failure(const char* str __attribute__((unused)),
                      int err __attribute__((unused)))
-  { _GLIBCXX_THROW_OR_ABORT(__ios_failure(_(str), err)); }
+  {
+    _GLIBCXX_THROW_OR_ABORT(__ios_failure(_(str),
+         err ? error_code(err, generic_category()) : io_errc::stream));
+  }

 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace

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

* [Bug libstdc++/99077] [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti
  2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
  2021-02-11 23:39 ` [Bug libstdc++/99077] " redi at gcc dot gnu.org
  2021-02-11 23:42 ` redi at gcc dot gnu.org
@ 2021-02-12 14:43 ` cvs-commit at gcc dot gnu.org
  2021-02-12 14:50 ` [Bug libstdc++/99077] [9/10 " redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-12 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:4591f7e5329dcc6ee9af2f314a050936d470ab5b

commit r11-7212-g4591f7e5329dcc6ee9af2f314a050936d470ab5b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Feb 12 10:37:56 2021 +0000

    libstdc++: Fix bootstrap with -fno-rtti [PR 99077]

    When libstdc++ is built without RTTI the __ios_failure type is just an
    alias for std::ios_failure, so trying to construct it from an int won't
    compile. This changes the RTTI-enabled __ios_failure type to have the
    same constructor parameters as std::ios_failure, so that the constructor
    takes the same arguments whether RTTI is enabled or not.

    The __throw_ios_failure function now constructs the error_code, instead
    of the __ios_failure constructor. As a drive-by fix that error_code is
    constructed with std::generic_category() not std::system_category(),
    because the int comes from errno which corresponds to the generic
    category.

    libstdc++-v3/ChangeLog:

            PR libstdc++/99077
            * src/c++11/cxx11-ios_failure.cc (__ios_failure(const char*, int)):
            Change int parameter to error_code, to match std::ios_failure.
            (__throw_ios_failure(const char*, int)): Construct error_code
            from int parameter.

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

* [Bug libstdc++/99077] [9/10 Regression] Cannot build libstdc++ with -fno-rtti
  2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-02-12 14:43 ` cvs-commit at gcc dot gnu.org
@ 2021-02-12 14:50 ` redi at gcc dot gnu.org
  2021-03-29 20:02 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2021-02-12 14:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|11.0                        |
            Summary|[9/10/11 Regression] Cannot |[9/10 Regression] Cannot
                   |build libstdc++ with        |build libstdc++ with
                   |-fno-rtti                   |-fno-rtti

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed on trunk for now.

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

* [Bug libstdc++/99077] [9/10 Regression] Cannot build libstdc++ with -fno-rtti
  2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-02-12 14:50 ` [Bug libstdc++/99077] [9/10 " redi at gcc dot gnu.org
@ 2021-03-29 20:02 ` cvs-commit at gcc dot gnu.org
  2021-03-29 20:06 ` [Bug libstdc++/99077] [9 " redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-29 20:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:1d5d30410655f21bdeee6c5f2fd970247eea4d23

commit r10-9585-g1d5d30410655f21bdeee6c5f2fd970247eea4d23
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Feb 12 10:37:56 2021 +0000

    libstdc++: Fix bootstrap with -fno-rtti [PR 99077]

    When libstdc++ is built without RTTI the __ios_failure type is just an
    alias for std::ios_failure, so trying to construct it from an int won't
    compile. This changes the RTTI-enabled __ios_failure type to have the
    same constructor parameters as std::ios_failure, so that the constructor
    takes the same arguments whether RTTI is enabled or not.

    The __throw_ios_failure function now constructs the error_code, instead
    of the __ios_failure constructor. As a drive-by fix that error_code is
    constructed with std::generic_category() not std::system_category(),
    because the int comes from errno which corresponds to the generic
    category.

    libstdc++-v3/ChangeLog:

            PR libstdc++/99077
            * src/c++11/cxx11-ios_failure.cc (__ios_failure(const char*, int)):
            Change int parameter to error_code, to match std::ios_failure.
            (__throw_ios_failure(const char*, int)): Construct error_code
            from int parameter.

    (cherry picked from commit 4591f7e5329dcc6ee9af2f314a050936d470ab5b)

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

* [Bug libstdc++/99077] [9 Regression] Cannot build libstdc++ with -fno-rtti
  2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-03-29 20:02 ` cvs-commit at gcc dot gnu.org
@ 2021-03-29 20:06 ` redi at gcc dot gnu.org
  2021-04-19  9:31 ` cvs-commit at gcc dot gnu.org
  2021-04-19  9:39 ` redi at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2021-03-29 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[9/10 Regression] Cannot    |[9 Regression] Cannot build
                   |build libstdc++ with        |libstdc++ with -fno-rtti
                   |-fno-rtti                   |

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed for 10.3 as well.

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

* [Bug libstdc++/99077] [9 Regression] Cannot build libstdc++ with -fno-rtti
  2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-03-29 20:06 ` [Bug libstdc++/99077] [9 " redi at gcc dot gnu.org
@ 2021-04-19  9:31 ` cvs-commit at gcc dot gnu.org
  2021-04-19  9:39 ` redi at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-19  9:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:3674bfbe7c19fb1e7dfcd0a09dbad9d0e3868d78

commit r9-9358-g3674bfbe7c19fb1e7dfcd0a09dbad9d0e3868d78
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Feb 12 10:37:56 2021 +0000

    libstdc++: Fix bootstrap with -fno-rtti [PR 99077]

    When libstdc++ is built without RTTI the __ios_failure type is just an
    alias for std::ios_failure, so trying to construct it from an int won't
    compile. This changes the RTTI-enabled __ios_failure type to have the
    same constructor parameters as std::ios_failure, so that the constructor
    takes the same arguments whether RTTI is enabled or not.

    The __throw_ios_failure function now constructs the error_code, instead
    of the __ios_failure constructor. As a drive-by fix that error_code is
    constructed with std::generic_category() not std::system_category(),
    because the int comes from errno which corresponds to the generic
    category.

    libstdc++-v3/ChangeLog:

            PR libstdc++/99077
            * src/c++11/cxx11-ios_failure.cc (__ios_failure(const char*, int)):
            Change int parameter to error_code, to match std::ios_failure.
            (__throw_ios_failure(const char*, int)): Construct error_code
            from int parameter.

    (cherry picked from commit 4591f7e5329dcc6ee9af2f314a050936d470ab5b)

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

* [Bug libstdc++/99077] [9 Regression] Cannot build libstdc++ with -fno-rtti
  2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-04-19  9:31 ` cvs-commit at gcc dot gnu.org
@ 2021-04-19  9:39 ` redi at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2021-04-19  9:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed for 9.4

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

end of thread, other threads:[~2021-04-19  9:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11 23:39 [Bug libstdc++/99077] New: [9/10/11 Regression] Cannot build libstdc++ with -fno-rtti redi at gcc dot gnu.org
2021-02-11 23:39 ` [Bug libstdc++/99077] " redi at gcc dot gnu.org
2021-02-11 23:42 ` redi at gcc dot gnu.org
2021-02-12 14:43 ` cvs-commit at gcc dot gnu.org
2021-02-12 14:50 ` [Bug libstdc++/99077] [9/10 " redi at gcc dot gnu.org
2021-03-29 20:02 ` cvs-commit at gcc dot gnu.org
2021-03-29 20:06 ` [Bug libstdc++/99077] [9 " redi at gcc dot gnu.org
2021-04-19  9:31 ` cvs-commit at gcc dot gnu.org
2021-04-19  9:39 ` redi 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).