From patchwork Sun Dec 4 10:53:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 61460 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5970A3851AB8 for ; Sun, 4 Dec 2022 10:54:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5970A3851AB8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670151256; bh=pxH+scCg/7TAUztiUlFGcyX8n7pQ79SFA4DweKZXg4c=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=docTHh6S5UJT0SS3+q5tAomc3L5dPPPGfsO+TkBZ7OgEiI0Pzx6JJqulYZ+yrQnHi hjj7v+nE5tWu15mOLTB1advpTs5/eftCoE8gjOY1ZzTD7glIAaUi6ZmJQelBPSOUyq apSI992cIR/Qdsug/cqHsAl05aIfUgEW+VOTiUQI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id D0A483852C56; Sun, 4 Dec 2022 10:53:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D0A483852C56 Received: by mail-wm1-x335.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso7878847wmo.1; Sun, 04 Dec 2022 02:53:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pxH+scCg/7TAUztiUlFGcyX8n7pQ79SFA4DweKZXg4c=; b=bilDfc8uERaOX/qo/k0r1Ly4TXvFMbezNXMGF1lmxfi/D8zWFgzxUli+Yta8jBOtbQ WGeebmXdE/kfhndGmlKNK5EQkeqZBH4NDzbVBe4cx29yV68wPhaMQvCA5BZBiI2B1B9J SCQnKnjtIcSYH2ol0VIfGNHFmj7jyTOhxs+66rNTkn7E98ciUlFemZ0u7Aqh1Lc9hxoY P8/G0WxUfY8CFr7oLm4hYNLJUAy1efXd5rLsenpFBjxbZQuJKT454U4dpo+ksTn8AZbA JHjaDAfNzXFjf7gYP6YKz58Nu+SVOKvJ5YLm9bYOsKFsf7ccfN98e9xi/Gys02giCNCy OTTg== X-Gm-Message-State: ANoB5pk+rhrdr3rinT0B4jOei2bfCtM26S8/V7X36Zw4XjwJP5hjAVb2 G5JbnXWA0pNt5E7nrWWZpER6K+kDwxc= X-Google-Smtp-Source: AA0mqf6v0v9MfhhdZUWB5RDwpAXz6lGAGlOJH1N5TYL/KZLvlJ4T4AQI4/xoieAqXDfTLjHrsYuhfA== X-Received: by 2002:a05:600c:350a:b0:3d0:74be:a059 with SMTP id h10-20020a05600c350a00b003d074bea059mr13229754wmq.177.1670151226278; Sun, 04 Dec 2022 02:53:46 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id h130-20020a1c2188000000b003b4fdbb6319sm17737080wmh.21.2022.12.04.02.53.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 04 Dec 2022 02:53:45 -0800 (PST) X-Google-Original-From: Iain Sandoe To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [pushed] libstdc++, Darwin: Fix weak attribute to use __weak__ instead of weak. Date: Sun, 4 Dec 2022 10:53:45 +0000 Message-Id: <20221204105345.33234-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" As pointed out on irc by Jonathan, the Darwin os_defines contains a "weak" attribute where we should use '__weak__'. Fixed thus, tested on i686, x86_64 Darwin and x86_64 Linux, pushed to master, thanks, Iain -- >8 -- The text for _GLIBCXX_WEAK_DEFINITION has used 'weak' for the attribute name, since its intoduction. Amend to use the implementation namespace '__weak__' version. Signed-off-by: Iain Sandoe libstdc++-v3/ChangeLog: * config/os/bsd/darwin/os_defines.h (_GLIBCXX_WEAK_DEFINITION): Use the implementation namespace for the weak attribute. --- libstdc++-v3/config/os/bsd/darwin/os_defines.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/config/os/bsd/darwin/os_defines.h b/libstdc++-v3/config/os/bsd/darwin/os_defines.h index a8b6d4fa324..38fdfb5f6f0 100644 --- a/libstdc++-v3/config/os/bsd/darwin/os_defines.h +++ b/libstdc++-v3/config/os/bsd/darwin/os_defines.h @@ -33,11 +33,11 @@ links to, so there's no need for weak-ness for that. */ #define _GLIBCXX_GTHREAD_USE_WEAK 0 -// On Darwin, in order to enable overriding of operator new and delete, -// GCC makes the definition of these functions weak, relies on the -// loader to implement weak semantics properly, and uses -// -flat_namespace to work around the way that it doesn't. -#define _GLIBCXX_WEAK_DEFINITION __attribute__ ((weak)) +// On Darwin, in order to enable overriding of operator new and delete, the +// ABI library exports a weak definition. The static linker will override this +// iff a user-provided implementation is given (providing that the user +// implementation is not itself a weak definition). +#define _GLIBCXX_WEAK_DEFINITION __attribute__ ((__weak__)) // Static initializer macro is buggy in darwin, see libstdc++/51906 #define _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC