diff options
author | Jens Axboe <axboe@kernel.dk> | 2020-07-25 13:37:15 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-07-25 13:37:15 -0600 |
commit | 2117a6f559a62982b054600ec23e53505ceb3fcd (patch) | |
tree | 877c3385a105da1f79d2449fdec5e387f09fd6ec | |
parent | 1d458e5b8044d81b96cccfc82e3fd99cbb1eebf9 (diff) | |
parent | bb012314f734b9de3b2fc198db2c4e3e060db240 (diff) | |
download | fio-2117a6f559a62982b054600ec23e53505ceb3fcd.tar.gz fio-2117a6f559a62982b054600ec23e53505ceb3fcd.tar.bz2 |
Merge branch 'check-atomics' of https://github.com/sitsofe/fio
* 'check-atomics' of https://github.com/sitsofe/fio:
configure: check for C11 atomics support
-rw-r--r-- | compiler/compiler.h | 7 | ||||
-rwxr-xr-x | configure | 33 |
2 files changed, 19 insertions, 21 deletions
diff --git a/compiler/compiler.h b/compiler/compiler.h index 8c0eb9d1..8a784b92 100644 --- a/compiler/compiler.h +++ b/compiler/compiler.h @@ -1,13 +1,6 @@ #ifndef FIO_COMPILER_H #define FIO_COMPILER_H -/* IWYU pragma: begin_exports */ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9) || __clang_major__ >= 6 -#else -#error Compiler too old, need at least gcc 4.9 -#endif -/* IWYU pragma: end_exports */ - #define __must_check __attribute__((warn_unused_result)) #define __compiletime_warning(message) __attribute__((warning(message))) @@ -496,20 +496,6 @@ else fi ########################################## -# check compiler version - -cat > $TMPC <<EOF -#include "$(pwd)/compiler/compiler.h" -int main(void) -{ - return 0; -} -EOF -if ! compile_prog "" "" "compiler check"; then - fatal "Your compiler is too old, needs GCC 4.9 or higher" -fi - -########################################## # check endianness if test "$bigendian" != "yes" ; then bigendian="no" @@ -565,6 +551,25 @@ fi print_config "Static build" "$build_static" ########################################## +# check for C11 atomics support +cat > $TMPC <<EOF +#include <stdatomic.h> +int main(void) +{ + _Atomic unsigned v; + atomic_load(&v); + return 0; +} +EOF +if ! compile_prog "" "" "C11 atomics"; then + echo + echo "Your compiler doesn't support C11 atomics. gcc 4.9/clang 3.6 are the" + echo "minimum versions with it - perhaps your compiler is too old?" + fatal "C11 atomics support not found" +fi + + +########################################## # check for wordsize wordsize="0" cat > $TMPC <<EOF |