This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Purpose of USE_ATOMIC_COMPILER_BUILTINS
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 16 Nov 2015 18:02:35 +0000
- Subject: Re: Purpose of USE_ATOMIC_COMPILER_BUILTINS
- Authentication-results: sourceware.org; auth=none
- References: <5649F832 dot 7000001 at redhat dot com>
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