public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/107221] New: [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock
@ 2022-10-11 18:54 dje at gcc dot gnu.org
  2022-10-11 19:04 ` [Bug bootstrap/107221] " dje at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dje at gcc dot gnu.org @ 2022-10-11 18:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107221
           Summary: [13 Regression] libstdc++ EH no matching function
                    __gnu_cxx::__scoped_lock::__scoped_lock
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: build
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dje at gcc dot gnu.org
                CC: redi at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc-ibm-aix*

The fix for PR68606 introduced references to
__gnu_cxx::__scoped_lock::__scoped_lock that are not always defined, causing a
bootstrap failure on AIX.

libtool: compile:  /tmp/GCC/./gcc/xgcc -B/tmp/GCC/./gcc/
-B/nasfarm/edelsohn/ins
tall/GCC/powerpc-ibm-aix7.2.5.0/bin/
-B/nasfarm/edelsohn/install/GCC/powerpc-ibm
-aix7.2.5.0/lib/ -isystem
/nasfarm/edelsohn/install/GCC/powerpc-ibm-aix7.2.5.0/i
nclude -isystem
/nasfarm/edelsohn/install/GCC/powerpc-ibm-aix7.2.5.0/sys-include
 -fno-checking -DHAVE_CONFIG_H -I..
-I/nasfarm/edelsohn/src/src/libstdc++-v3/../
libiberty -I/nasfarm/edelsohn/src/src/libstdc++-v3/../include -D_GLIBCXX_SHARED 
-I/tmp/GCC/powerpc-ibm-aix7.2.5.0/libstdc++-v3/include/powerpc-ibm-aix7.2.5.0
-I/tmp/GCC/powerpc-ibm-aix7.2.5.0/libstdc++-v3/include
-I/nasfarm/edelsohn/src/src/libstdc++-v3/libsupc++
-I/nasfarm/edelsohn/install/include -I/nasfarm/edelsohn/install/include -g -O2
-DIN_GLIBCPP_V3 -Wno-error -c cp-demangle.c  -fPIC -DPIC -o cp-demangle.o
/nasfarm/edelsohn/src/src/libstdc++-v3/libsupc++/eh_alloc.cc: In member
function 'void* {anonymous}::pool::allocate(std::size_t)':
/nasfarm/edelsohn/src/src/libstdc++-v3/libsupc++/eh_alloc.cc:239:54: error: no
matching function for call to '__gnu_cxx::__scoped_lock::__scoped_lock(int&)'
  239 |       __gnu_cxx::__scoped_lock sentry(emergency_mutex);
      |                                                      ^
In file included from
/nasfarm/edelsohn/src/src/libstdc++-v3/libsupc++/eh_alloc.cc:37:
/tmp/GCC/powerpc-ibm-aix7.2.5.0/libstdc++-v3/include/ext/concurrence.h:240:14:
note: candidate: '__gnu_cxx::__scoped_lock::__scoped_lock(__mutex_type&)'
  240 |     explicit __scoped_lock(__mutex_type& __name) : _M_device(__name)
      |              ^~~~~~~~~~~~~
/tmp/GCC/powerpc-ibm-aix7.2.5.0/libstdc++-v3/include/ext/concurrence.h:240:42:
note:   no known conversion for argument 1 from 'int' to
'__gnu_cxx::__scoped_lock::__mutex_type&'
  240 |     explicit __scoped_lock(__mutex_type& __name) : _M_device(__name)
      |                            ~~~~~~~~~~~~~~^~~~~~
/tmp/GCC/powerpc-ibm-aix7.2.5.0/libstdc++-v3/include/ext/concurrence.h:236:5:
note: candidate: '__gnu_cxx::__scoped_lock::__scoped_lock(const
__gnu_cxx::__scoped_lock&)'
  236 |     __scoped_lock(const __scoped_lock&);
      |     ^~~~~~~~~~~~~
/tmp/GCC/powerpc-ibm-aix7.2.5.0/libstdc++-v3/include/ext/concurrence.h:236:19:
note:   no known conversion for argument 1 from 'int' to 'const
__gnu_cxx::__scoped_lock&'
  236 |     __scoped_lock(const __scoped_lock&);
      |                   ^~~~~~~~~~~~~~~~~~~~
make[5]: *** [Makefile:778: eh_alloc.lo] Error 1

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

* [Bug bootstrap/107221] [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock
  2022-10-11 18:54 [Bug bootstrap/107221] New: [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock dje at gcc dot gnu.org
@ 2022-10-11 19:04 ` dje at gcc dot gnu.org
  2022-10-11 19:15 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: dje at gcc dot gnu.org @ 2022-10-11 19:04 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-10-11
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from David Edelsohn <dje at gcc dot gnu.org> ---
Where is __GTHREADS defined now?

-#include <bits/c++config.h>

...

+#ifdef __GTHREADS
       // A single mutex controlling emergency allocations.
       __gnu_cxx::__mutex emergency_mutex;
+      using __scoped_lock = __gnu_cxx::__scoped_lock;
+#else
+      int emergency_mutex = 0;
+      struct __scoped_lock { explicit __scoped_lock(int) { } };
+#endif

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

* [Bug bootstrap/107221] [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock
  2022-10-11 18:54 [Bug bootstrap/107221] New: [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock dje at gcc dot gnu.org
  2022-10-11 19:04 ` [Bug bootstrap/107221] " dje at gcc dot gnu.org
@ 2022-10-11 19:15 ` redi at gcc dot gnu.org
  2022-10-11 19:36 ` cvs-commit at gcc dot gnu.org
  2022-10-12  8:47 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-11 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Same place it's always been defined, in gthr.h which is included by
<ext/concurrence.h>

And every other header includes <bits/c++config.h> i.e. all of these:

#include <exception>           // std::exception
#include <new>                 // std::terminate
#include <cstdlib>             // std::malloc, std::free, std::strtoul
#include <climits>             // INT_MAX
#include <bits/stl_function.h> // std::less
#include "unwind-cxx.h"
#if _GLIBCXX_HOSTED
# include <string_view>        // std::string_view
# include <cstring>            // std::strchr, std::memset
# include <ext/concurrence.h>  // __gnu_cxx::__mutex, __gnu_cxx::__scoped_lock
#endif

That's why I removed the unnecessary initial #include of it.


This should fix it:

--- a/libstdc++-v3/libsupc++/eh_alloc.cc
+++ b/libstdc++-v3/libsupc++/eh_alloc.cc
@@ -236,7 +236,7 @@ namespace

   void *pool::allocate (std::size_t size) noexcept
     {
-      __gnu_cxx::__scoped_lock sentry(emergency_mutex);
+      __scoped_lock sentry(emergency_mutex);
       // We need an additional size_t member plus the padding to
       // ensure proper alignment of data.
       size += offsetof (allocated_entry, data);

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

* [Bug bootstrap/107221] [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock
  2022-10-11 18:54 [Bug bootstrap/107221] New: [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock dje at gcc dot gnu.org
  2022-10-11 19:04 ` [Bug bootstrap/107221] " dje at gcc dot gnu.org
  2022-10-11 19:15 ` redi at gcc dot gnu.org
@ 2022-10-11 19:36 ` cvs-commit at gcc dot gnu.org
  2022-10-12  8:47 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-11 19:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:23c3cbaed36f6d2f3a7a64f6ebda69329723514b

commit r13-3237-g23c3cbaed36f6d2f3a7a64f6ebda69329723514b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Oct 11 20:19:08 2022 +0100

    libstdc++: Fix bootstrap for --disable-threads build [PR107221]

    The __scoped_lock type should be used unqualified so that we always
    refer to pool::__scoped_lock, which might be the dummy fallback
    implementation.

    The __mutex and __scoped_lock types in <ext/concurrence.h> already work
    fine without __GTHREADS being defined, but that header isn't included at
    all unless _GLIBCXX_HOSTED != 0. The fallback implementation should be
    used for ! _GLIBCXX_HOSTED instead of for !defined __GTHREADS.

    libstdc++-v3/ChangeLog:

            PR bootstrap/107221
            * libsupc++/eh_alloc.cc (pool): Change preprocessor condition
            for using __mutex from __GTHREADS to _GLIBCXX_HOSTED.
            (pool::allocate): Remove namespace qualification to use
            pool::__scoped_lock instead of __gnu_cxx::__scoped_lock.

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

* [Bug bootstrap/107221] [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock
  2022-10-11 18:54 [Bug bootstrap/107221] New: [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock dje at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-10-11 19:36 ` cvs-commit at gcc dot gnu.org
@ 2022-10-12  8:47 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-10-12  8:47 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-11 18:54 [Bug bootstrap/107221] New: [13 Regression] libstdc++ EH no matching function __gnu_cxx::__scoped_lock::__scoped_lock dje at gcc dot gnu.org
2022-10-11 19:04 ` [Bug bootstrap/107221] " dje at gcc dot gnu.org
2022-10-11 19:15 ` redi at gcc dot gnu.org
2022-10-11 19:36 ` cvs-commit at gcc dot gnu.org
2022-10-12  8:47 ` 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).