From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x335.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso7878847wmo.1; Sun, 04 Dec 2022 02:53:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=pxH+scCg/7TAUztiUlFGcyX8n7pQ79SFA4DweKZXg4c=; b=qDm9vdcc19b313XxS+HYUTgnSpLoRpgQJsdN3pvZZ9r4FcLe95ho1ghd9yuLKDnSCF E1wAtjbzmJkPBDRmaOWj5GF4ktKsLC1QlYqorQg+em+R5S2Ux9KGw7XEKVgV/U8da2mm JI+vZpO3bnC9KcelWLtZU8FzAmRswbSzkweRWzF6fgVu9ffm2xJm8Ky0mt/YkMZiVT2j 17hSFrhkfCPOaZktWiL7ZWpIJ7KaHL+A6yT9G/PA/G4wDkF7Bq/qZtEmE/+QykK5ucXj 5s+VbrClIBrEf7pujkMuKvJ9uHV6vkXDj83EUh5GhcDAKEDBIhV/vQ9UIJRmIi5f9SKd k3tw== 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) From: Iain Sandoe 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) Reply-To: iain@sandoe.co.uk MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 List-Id: 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 -- 2.37.1 (Apple Git-137.1)