From 658f87774cfaf62e132f485e714f1d548f69d77b Mon Sep 17 00:00:00 2001 From: riastradh Date: Mon, 3 Apr 2023 08:00:28 +0000 Subject: libc __atomic_is_lock_free: Fix clang build with symbol hacks. --- common/lib/libc/atomic/atomic_is_lock_free.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'common') 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 -__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 #include +/* + * 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) { -- cgit