tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

PATCH libatomic



Lack of libatomic is increasingly hard to deal with. This library
implements function calls for atomic operations.

Personally I stopped testing sanitizers year ago as they required
libatomic. We want libatomic for LLDB in base. Rewritting everything to
stop using libatomic is no viable as this is a standard C11/C++14 feature.

Workaround to enforce newest CPU models does not work as a general
solution (unless we want to drop all ports except recent x86_64 and
perhaps recent aarch64).

Analogous situation is in FreeBSD, but they have a workaround with
enforcing GCC libatomic when needed. There is no workaround for NetBSD.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230888
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220822

+ other "duplicates"

I propose the following patch:

http://netbsd.org/~kamil/patch-00250-libatomic.txt

Based on:

https://github.com/llvm/llvm-project/blob/master/compiler-rt/lib/builtins/atomic.c

Local changes:
 - ported to NetBSD
 - switched to C11 stdatomic.h and fixed compatibility with GCC
 - added __atomic_fetch_nand_##n functions
 - fixed __atomic_compare_exchange_##n

Attachment: signature.asc
Description: OpenPGP digital signature



Home | Main Index | Thread Index | Old Index