[PATCH] atomics: Remove unused atomics
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Wed Sep 3 15:30:31 GMT 2025
Hi Adhemerval,
> Unfortunatelly it triggers build failures for hppa, microblaze, m68k, alpha, powerpc, powerpc64,
> powerpc64le, and sh4; which are the architectures with USE_ATOMIC_COMPILER_BUILTINS set to 0.
That's interesting since this is based on an existing patch that passed buildmanyglibc. I only removed
totally unused macros and changed a few catomic_* to atomic_* and used atomic_fetch_add_relaxed
which already has many existing uses.
> We will need to keep !USE_ATOMIC_COMPILER_BUILTINS for at least hppa and sh, where GCC atomic
> builtins [1] generated libcalls to libatomic.
We will need to find out whether these targets are still broken with GCC 12+ - I think that was all
about old broken GCC versions. At the time buildmanyglibc passed with all targets using
USE_ATOMIC_COMPILER_BUILTINS - I presume any use of libatomic would give link errors?
> I don't recall why we haven't make the switch on powerpc; I recall there were some issues
> w.r.t consume semantic in malloc code. I will check if USE_ATOMIC_COMPILER_BUILTINS
> is possible on powerpc.
I did post a patch to make malloc use the right acquire sequence - the current implementation
might indeed fail on some hardware.
Cheers,
Wilco
More information about the Libc-alpha
mailing list