aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2022-12-03 11:57:59 +0000
committerIain Sandoe <iain@sandoe.co.uk>2022-12-04 10:48:48 +0000
commite76a44bf68b79278cb2c20e4ce87657a247adcfe (patch)
tree7d4d44753e89e7ffdb5f3afeacacb0cb4963768c
parent7fe8aca8a62341b9f4ee68d621c087c6f17ce82a (diff)
downloadgcc-e76a44bf68b79278cb2c20e4ce87657a247adcfe.zip
gcc-e76a44bf68b79278cb2c20e4ce87657a247adcfe.tar.gz
gcc-e76a44bf68b79278cb2c20e4ce87657a247adcfe.tar.bz2
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 <iain@sandoe.co.uk> libstdc++-v3/ChangeLog: * config/os/bsd/darwin/os_defines.h (_GLIBCXX_WEAK_DEFINITION): Use the implementation namespace for the weak attribute.
-rw-r--r--libstdc++-v3/config/os/bsd/darwin/os_defines.h10
1 files 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 a8b6d4f..38fdfb5 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