There have been several mentions on mailing lists about missing atomic
functions in our system libraries (e.g. ``__atomic_load_8`` and
friends), and recently I also saw `__bswapdi2` and `__bswapsi2`
mentioned too.
We already have these as source files in our libcompiler_rt
Makefile.inc, but currently:
* The `atomic.c` file is only enabled for 32 bit PowerPC, and only for
clang (since gcc apparently already has it?). This was added by
@alfredo in D22549 and committed by @jhibbits in rS356104.
* The `bswap[ds]i` C implementations are only enabled for mips and
riscv, apparently because "on some archs gcc 6.3 requires them".
* The `bswap[ds]i` assembly implementations are only enabled for arm.
I think it would be nice to just always make both the atomic builtins
and the bswap functions available in our libcompiler_rt, at least in the
.a file. That would probably solve quite a lot of user complaints about
not being to able to compile ports, and having them switch to gcc
instead.
Note that with respect to compiler-rt's `atomic.c`, I am not totally
convinced that its implementation will work in all possible situations,
but having it it better than nothing...