public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/110432] macOS: Segmentation fault when using stdlibc++ from gcc 13.1 in combination with clang-16
Date: Wed, 19 Jul 2023 19:35:05 +0000	[thread overview]
Message-ID: <bug-110432-4-cotvgKTJ4o@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110432-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:61bf34d17473d611bb2695329808810dbd5af478

commit r13-7591-g61bf34d17473d611bb2695329808810dbd5af478
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jun 30 11:07:35 2023 +0100

    libstdc++: Fix iostream init for Clang on darwin [PR110432]

    The __has_attribute(init_priority) check in <iostream> is true for Clang
    on darwin, which means that user code including <iostream> thinks the
    library will initialize the global streams. However, when libstdc++ is
    built by GCC on darwin, the __has_attribute(init_priority) check is
    false, which means that the library thinks that user code will do the
    initialization when <iostream> is included. This means that the
    initialization is never done.

    Add an autoconf check so that the header and the library both make their
    decision based on the static properties of GCC at build time, with a
    consistent outcome.

    As a belt and braces check, also do the initialization in <iostream> if
    the compiler including that header doesn't support the attribute (even
    if the library also containers the initialization). This might result in
    redundant initialization done in <iostream>, but ensures the
    initialization happens somewhere if there's any doubt about the
    attribute working correctly due to missing linker support.

    libstdc++-v3/ChangeLog:

            PR libstdc++/110432
            * acinclude.m4 (GLIBCXX_CHECK_INIT_PRIORITY): New.
            * config.h.in: Regenerate.
            * configure: Regenerate.
            * configure.ac: Use GLIBCXX_CHECK_INIT_PRIORITY.
            * include/std/iostream: Use new autoconf macro as well as
            __has_attribute.
            * src/c++98/ios_base_init.h: Use new autoconf macro instead of
            __has_attribute.

    Reviewed-by: Patrick Palka <ppalka@redhat.com>
    (cherry picked from commit fe2651affa8c15624188bfd062fb894648743431)

  parent reply	other threads:[~2023-07-19 19:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27  9:56 [Bug libstdc++/110432] New: " sascha.scandella at dentsplysirona dot com
2023-06-27 10:27 ` [Bug libstdc++/110432] " redi at gcc dot gnu.org
2023-06-27 10:32 ` sascha.scandella at dentsplysirona dot com
2023-06-27 10:46 ` iains at gcc dot gnu.org
2023-06-27 10:50 ` sascha.scandella at dentsplysirona dot com
2023-06-27 11:05 ` iains at gcc dot gnu.org
2023-06-27 12:08 ` sascha.scandella at dentsplysirona dot com
2023-06-27 12:09 ` redi at gcc dot gnu.org
2023-06-29 15:54 ` sascha.scandella at dentsplysirona dot com
2023-06-29 16:09 ` ppalka at gcc dot gnu.org
2023-06-29 16:12 ` iains at gcc dot gnu.org
2023-06-29 16:28 ` redi at gcc dot gnu.org
2023-06-30 14:37 ` cvs-commit at gcc dot gnu.org
2023-06-30 15:19 ` sascha.scandella at dentsplysirona dot com
2023-06-30 15:25 ` jakub at gcc dot gnu.org
2023-07-01 14:11 ` sascha.scandella at dentsplysirona dot com
2023-07-19 19:35 ` cvs-commit at gcc dot gnu.org [this message]
2023-07-19 19:36 ` redi at gcc dot gnu.org
2023-07-20 11:58 ` redi at gcc dot gnu.org
2023-08-07 13:04 ` sascha.scandella at dentsplysirona dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110432-4-cotvgKTJ4o@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).