Purpose of USE_ATOMIC_COMPILER_BUILTINS

Joseph Myers joseph@codesourcery.com
Mon Nov 16 18:02:00 GMT 2015


On Mon, 16 Nov 2015, Florian Weimer wrote:

> What is the USE_ATOMIC_COMPILER_BUILTINS?  Is it still needed now that
> we require GCC 4.7 or later to compile glibc?

Yes.  glibc can't use out-of-line functions from libatomic, since 
libatomic can only be built after glibc.  (Out-of-line functions from 
libgcc are OK if it's considered they don't involve performance issues on 
a particular processor.  Built-in functions might generate calls to either 
libgcc or libatomic.)  The macro says whether it's known for a given 
architecture that the __atomic_* built-in functions are suitable both 
regarding correctness (not generating calls to libatomic functions for the 
glibc use cases) and performance.

It's entirely plausible that some architectures could move away from their 
existing asm to USE_ATOMIC_COMPILER_BUILTINS, however.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list