From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id BB4EA3852C56; Sun, 4 Dec 2022 10:49:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB4EA3852C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670150964; bh=6rTk1JdHcPhNLC0iIO487uGRV3mOI/nP6vsrnyVNCOs=; h=From:To:Subject:Date:From; b=gNWvOg+mxwkxzMdO9QiEpx+ohQOM43YXLypiZjatmAYOdffrcIyvWsgUAASpZ1Gy+ iM2qNYfmextDRLQjR6Srp/TS8dCF6y9UboSIDTwNBKBKo3hyZpMC1ApyfzQzn8wz97 mTF4RHpucCWNiZbt8sEsVlOHOXKouqGeCkL4mclM= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-4481] libstdc++, Darwin: Fix weak attribute to use __weak__ instead of weak. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/master X-Git-Oldrev: 7fe8aca8a62341b9f4ee68d621c087c6f17ce82a X-Git-Newrev: e76a44bf68b79278cb2c20e4ce87657a247adcfe Message-Id: <20221204104924.BB4EA3852C56@sourceware.org> Date: Sun, 4 Dec 2022 10:49:24 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e76a44bf68b79278cb2c20e4ce87657a247adcfe commit r13-4481-ge76a44bf68b79278cb2c20e4ce87657a247adcfe Author: Iain Sandoe Date: Sat Dec 3 11:57:59 2022 +0000 libstdc++, Darwin: Fix weak attribute to use __weak__ instead of weak. 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. Diff: --- 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