From patchwork Mon Feb 15 08:29:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1440406 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=GJImgtLr; dkim-atps=neutral Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfHM15y1Vz9sBJ for ; Mon, 15 Feb 2021 19:29:00 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB3993835422; Mon, 15 Feb 2021 08:28:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB3993835422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1613377737; bh=Vz4iM63y3vsFmc+r8ybIO22Ekb7Sqh3Ozmn/LhtMLX4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=GJImgtLr37zhWLiCjkIsUuVc4LhUhI/+nFIxqqk4eXVNwgZX+q2TLmw46f7r/J1LC WiXDDC0ia40MN1eu5Ur4rVbMW5pRAMjwhjMqpvrWQdmdtLKmb0rO4t8/cLL5zhWJkj AYgUw3PBeXaPsUqW4CFo8+1OzhL9NNbOJUMT3dE0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id B13313850422 for ; Mon, 15 Feb 2021 08:28:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B13313850422 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-419-mYzGow_TMkq3TqjmxyQabw-1; Mon, 15 Feb 2021 03:28:51 -0500 X-MC-Unique: mYzGow_TMkq3TqjmxyQabw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C63C8107ACC7 for ; Mon, 15 Feb 2021 08:28:50 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-131.ams2.redhat.com [10.36.113.131]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EFCC55D9CA; Mon, 15 Feb 2021 08:28:49 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] nptl: Mention libstdc++ compatibility for pthread_once Date: Mon, 15 Feb 2021 09:29:17 +0100 Message-ID: <871rdhhgyq.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Cc: Jonathan Wakely Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" --- nptl/pthread_once.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nptl/pthread_once.c b/nptl/pthread_once.c index 28d97097c7..702d1c0877 100644 --- a/nptl/pthread_once.c +++ b/nptl/pthread_once.c @@ -61,7 +61,15 @@ clear_once_control (void *arg) interrupted cases anymore. XXX: We split out this slow path because current compilers do not generate as efficient code when the fast path in __pthread_once below is not in a - separate function. */ + separate function. + + Compatibility note: The implementation of std::call_once in + libstdc++ before GCC 11 does not call pthread_once if the control + object has the value __PTHREAD_ONCE_DONE (2). libstdc++ starting + in GCC 11 uses the values 0 (uninitialized), 1 (in progress), 2 + (done) for its own from-scratch implementation. These + implementations can operate on the same control object if libstdc++ + is statically linked. */ static int __attribute__ ((noinline)) __pthread_once_slow (pthread_once_t *once_control, void (*init_routine) (void))