diff options
| author | riastradh <riastradh@NetBSD.org> | 2023-04-03 08:00:28 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2023-04-03 08:00:28 +0000 |
| commit | 658f87774cfaf62e132f485e714f1d548f69d77b (patch) | |
| tree | fc8d0af396df3387765c4ce73276be3e1cd57ed2 /common | |
| parent | d316161240dee52beb685802b432399413956eac (diff) | |
libc __atomic_is_lock_free: Fix clang build with symbol hacks.
Diffstat (limited to 'common')
| -rw-r--r-- | common/lib/libc/atomic/atomic_is_lock_free.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/common/lib/libc/atomic/atomic_is_lock_free.c b/common/lib/libc/atomic/atomic_is_lock_free.c index dae40ca9964..0ebc0d0d7c3 100644 --- a/common/lib/libc/atomic/atomic_is_lock_free.c +++ b/common/lib/libc/atomic/atomic_is_lock_free.c @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_is_lock_free.c,v 1.1 2023/03/30 15:03:36 riastradh Exp $ */ +/* $NetBSD: atomic_is_lock_free.c,v 1.2 2023/04/03 08:00:28 riastradh Exp $ */ /*- * Copyright (c) 2023 The NetBSD Foundation, Inc. @@ -27,12 +27,21 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: atomic_is_lock_free.c,v 1.1 2023/03/30 15:03:36 riastradh Exp $"); +__RCSID("$NetBSD: atomic_is_lock_free.c,v 1.2 2023/04/03 08:00:28 riastradh Exp $"); #include <sys/types.h> #include <sys/stdbool.h> +/* + * XXX Work around clang's built-in __atomic_is_lock_free by having the + * C name be different but using an asm rename to define the right + * symbol. + */ +#define __atomic_is_lock_free __atomic_is_lock_free_hack +bool __atomic_is_lock_free(size_t, const volatile void *) + __RENAME("__atomic_is_lock_free"); + bool __atomic_is_lock_free(size_t n, const volatile void *p __unused) { |
