GCC defines built-ins for atomic instructions found on i486 and higher.

Because FreeBSD no longer supports the 80386 cpu all code targeting
FreeBSD/i386 necessarily runs on i486 or higher so the compiler
built-ins can be used by default inside libstdc++ and in C++ headers.
This allows newly compiled C++ code to inline some atomic operations.
Old binaries continue to use libstdc++ functions.

PR:		148926
Tested by:	Yuri Karaban <tech askold net>
Reviewed by:	kan
Approved by:	kib (mentor)
MFC after:	2 weeks
This commit is contained in:
Tijl Coosemans 2010-09-07 08:33:17 +00:00
parent 36a7e25854
commit 2751839107
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212286
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ ATOMICITY_H= ${SRCDIR}/config/cpu/${MARCHDIR}/atomicity.h
ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_mutex/atomicity.h
.endif
.if ${MACHINE_CPUARCH} == "amd64"
.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
.if exists(${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h)
ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h
.endif

View File

@ -671,7 +671,7 @@
/* #undef VERSION */
/* Define if builtin atomic operations are supported on this host. */
#if defined(__amd64__)
#if defined(__amd64__) || defined(__i386__)
#define _GLIBCXX_ATOMIC_BUILTINS 1
#endif