On 22/12/16 17:37, Segher Boessenkool wrote: > We do not always have all atomic instructions. Not all processors have > all, and it depends on the compiler flags used which are used. How would > libatomic know what compiler flags are used to compile the program it is > linked to? > > Sounds like a job for multilibs?
x86_64 uses ifunc dispatch to always use atomic instructions if available (which is bad because ifunc is not supported on all platforms). either such runtime feature detection and dispatch is needed in libatomic or different abis have to be supported (with the usual hassle).