• gcc-12 build failure

    From Samuel Thibault@21:1/5 to All on Mon Aug 29 00:20:03 2022
    Hello,

    There was a build failure with gcc-12: missing reference to
    pthread_once. This is due to a mismatch in glibc concerning where
    pthread functions are, gcc is assuming all ports behave the same. I'm
    currently trying the attached patch which should fix things.

    Samuel

    commit feb39fffbcfd724518f1055c50d3933fc8b356df
    Author: Samuel Thibault <[email protected]>
    Date: Sun Aug 28 23:48:56 2022 +0200

    libstdc++: Introduce GNU/Hurd-specific libstdc++ os-defines.h

    This is notably needed because in glibc 2.34, the move of pthread functions
    into libc.so happened for Linux only, not GNU/Hurd.

    The pthread_self() function can also always be used fine as it is.

    libstdc++-v3/ChangeLog:

    * config/os/gnu/os_defines.h: New file.
    * config/os/gnu/ctype_base.h: New file.
    * config/os/gnu/ctype_configure_char.cc: New file.
    * config/os/gnu/ctype_inline.h: New file.
    * configure.host: On gnu* host, use os/gnu instead of os/gnu-linux.

    diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
    index ba5939d9003..dd288cce2ca 100644
    --- a/libstdc++-v3/ChangeLog
    +++ b/libstdc++-v3/ChangeLog
    @@ -1,3 +1,11 @@
    +2022-08-28 Samuel Thibault <[email protected]>
    +
    + * config/os/gnu/os_defines.h: New file.
    + * config/os/gnu/ctype_base.h: New file.
    + * config/os/gnu/ctype_configure_char.cc: New file.
    + * config/os/gnu/ctype_inline.h: New file.
    + * configure.host: On gnu* host, use os/gnu instead of os/gnu-linux.
    +
    2022-08-27 Patrick Palka <[email protected]>

    * testsuite/20_util/logical_traits/requirements/base_classes.cc: New test.
    diff --git a/libstdc++-v3/config/os/gnu/ctype_base.h b/libstdc++-v3/config/os/gnu/ctype_base.h
    new file mode 100644
    index 00000000000..955146543db
    --- /dev/null
    +++ b/libstdc++-v3/config/os/gnu/ctype_base.h
    @@ -0,0 +1,66 @@
    +// Locale support -*- C++ -*-
    +
    +// Copyright (C) 1997-2022 Free Software Foundation, Inc.
    +//
    +// This file is part of the GNU ISO C++ Library. This library is free
    +// software; you can redistribute it and/or modify it under the
    +// terms of the GNU Gen