Groups | Search | Server Info | Login | Register
Groups > muc.lists.netbsd.tech.toolchain > #3558
| From | matthew green <mrg@eterna23.net> |
|---|---|
| Newsgroups | muc.lists.netbsd.tech.toolchain |
| Subject | __atomic_test_and_set() and mips o32 - help wanted |
| Date | 2025-11-16 20:10 +1100 |
| Organization | Newsgate at muc.de e.V. |
| Message-ID | <6492.1763284237@splode.eterna23.net> (permalink) |
hi folks. one of the GCC 14 issues is that for mips o32, libstdc++ tries to use a newer-ish builtin called __atomic_test_and_set(), that ends up emitting a call to a library function on o32, which leads to a link failure in gdb (and more). this library function is defined as: bool __atomic_test_and_set(bool *ptr, int memorder); where "memorder" is from <stdatomic.h> and is eg, "memory_order_relaxed", or "memory_order_consume", or a few other options. using -abi=n32 or -abi=64 generates a bunch of code using ll/sc, and some ugly crap to only operate on one byte. the n32 one is: https://www.netbsd.org/~mrg/mips-n32-atomic_test_and_set.s the libstdc++ direct calls to __atomic_test_and_set() are in: external/gpl3/gcc/dist/libstdc++-v3/include/bits/atomic_base.h there is a _GLIBCXX_ATOMIC_BUILTINS define that should be able to implement these differently if possible.. the same problem exists on sh3, but there's a workaround i just seem to have tested (sh3 and sh4 cpus support tas.b instruction, but gcc wants "-mtas" to enable it.) i'm not sure what the right thing to do here is. it's not clear to me that the actual old 32-bit hardware can do this at all, but there are now explicit calls to this builtin. GCC configury tries to find and notice it's missing, but libstdc++ still has a couple of calls to it directly in it's "test_and_set()". anyone have a good idea? .mrg. -- Posted automagically by a mail2news gateway at muc.de e.V. Please direct questions, flames, donations, etc. to news-admin@muc.de
Back to muc.lists.netbsd.tech.toolchain | Previous | Next | Find similar
__atomic_test_and_set() and mips o32 - help wanted matthew green <mrg@eterna23.net> - 2025-11-16 20:10 +1100
csiph-web