This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Purpose of USE_ATOMIC_COMPILER_BUILTINS


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]