Bug 1850174

Summary: fatal error: stdatomic.h: No such file or directory
Product: Red Hat Enterprise Linux 7 Reporter: Zhang Yi <yizhan>
Component: gccAssignee: Marek Polacek <mpolacek>
Status: CLOSED NOTABUG QA Contact: Alexandra Petlanová Hájková <ahajkova>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.9CC: fweimer, jakub, ohudlick, sipoyare
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-24 14:01:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zhang Yi 2020-06-23 16:08:04 UTC
Description of problem:
fatal error: stdatomic.h: No such file or directory

Version-Release number of selected component (if applicable):
[root@storageqe-31 fio]# rpm -qf /usr/bin/gcc
gcc-4.8.5-44.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. compiling the latest fio source code
2.
3.

Actual results:


Expected results:


Additional info:
# cd fio && ./configure && make && make install
STDOUT:
Operating system              Linux
CPU                           x86_64
Big endian                    no
Compiler                      gcc
Cross compile                 no

Static build                  no
Wordsize                      64
zlib                          yes
Linux AIO support             yes
Linux AIO support rw flags    no
Linux AIO over io_uring       no
POSIX AIO support             yes
POSIX AIO support needs -lrt  yes
POSIX AIO fsync               yes
POSIX pshared support         yes
pthread_condattr_setclock()   yes
pthread_sigmask()             yes
Solaris AIO support           no
__sync_fetch_and_add          yes
__sync_synchronize            yes
__sync_val_compare_and_swap   yes
libverbs                      no
rdmacm                        no
asprintf()                    yes
vasprintf()                   yes
Linux fallocate               yes
POSIX fadvise                 yes
POSIX fallocate               yes
sched_setaffinity(3 arg)      yes
sched_setaffinity(2 arg)      no
clock_gettime                 yes
CLOCK_MONOTONIC               yes
CLOCK_MONOTONIC_RAW           yes
CLOCK_MONOTONIC_PRECISE       no
clockid_t                     yes
gettimeofday                  yes
fdatasync                     yes
pipe()                        yes
pipe2()                       yes
pread()                       yes
sync_file_range               yes
EXT4 move extent              yes
Linux splice(2)               yes
GUASI                         no
libnuma                       no
strsep                        yes
strcasestr                    yes
strlcat                       no
getopt_long_only()            yes
inet_aton                     yes
socklen_t                     yes
__thread                      yes
RUSAGE_THREAD                 yes
SCHED_IDLE                    yes
TCP_NODELAY                   yes
Net engine window_size        yes
TCP_MAXSEG                    yes
RLIMIT_MEMLOCK                yes
pwritev/preadv                yes
pwritev2/preadv2              no
IPv6 helpers                  yes
http engine                   no
Rados engine                  no
Rados Block Device engine     no
setvbuf                       yes
Gluster API engine            no
s390_z196_facilities          no
HDFS engine                   no
MTD                           yes
libpmem                       yes
libpmemblk                    yes
PMDK pmemblk engine           yes
PMDK dev-dax engine           yes
PMDK libpmem engine           yes
DDN's Infinite Memory Engine  no
iscsi engine                  no
NBD engine                    no
lex/yacc for arithmetic       no
getmntent                     yes
getmntinfo                    no
Static Assert                 yes
bool                          yes
strndup                       yes
Valgrind headers              no
Zoned block device support    no
libzbc engine                 no
march_armv8_a_crc_crypto      no
cuda                          no
Build march=native            yes
CUnit                         no
__kernel_rwf_t                no
-Wimplicit-fallthrough=2      no
MADV_HUGEPAGE                 yes
gettid                        no
statx(2)/libc                 no
statx(2)/syscall              no
TCMalloc support              no
make[1]: Entering directory `/mnt/tests/kernel/storage/NVDIMM/btt_md_randio/fio'
make[1]: Leaving directory `/mnt/tests/kernel/storage/NVDIMM/btt_md_randio/fio'
make[1]: Entering directory `/mnt/tests/kernel/storage/NVDIMM/btt_md_randio/fio'
    CC crc/crc16.o
    CC crc/crc32.o
    CC crc/crc32c-arm64.o
make[1]: Leaving directory `/mnt/tests/kernel/storage/NVDIMM/btt_md_randio/fio'
STDERR:FIO_VERSION = fio-3.20-57-g6532
In file included from crc/crc32c.h:23:0,
                 from crc/crc32c-arm64.c:1:
crc/../arch/arch.h:4:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.
make[1]: *** [crc/crc32c-arm64.o] Error 1

Comment 2 Marek Polacek 2020-06-23 16:18:38 UTC
stdatomic.h was only added in gcc4.9 so it's expected that this file is missing in gcc4.8.

You can use the Developer Toolset which provides newer versions of gcc.

Comment 3 Zhang Yi 2020-06-24 03:14:42 UTC
It works now

[root@hpe-dl380gen9-01 fio]# scl enable devtoolset-7 bash
[root@hpe-dl380gen9-01 fio]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-7/root/usr --mandir=/opt/rh/devtoolset-7/root/usr/share/man --infodir=/opt/rh/devtoolset-7/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-7.3.1-20180303/obj-x86_64-redhat-linux/isl-install --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC) 

[root@hpe-dl380gen9-01 fio]# rpm -qa devtoolset-7-gcc
devtoolset-7-gcc-7.3.1-5.16.el7.x86_64

Comment 4 Marek Polacek 2020-06-24 14:01:17 UTC
Great.  DTS7 is unsupported so I'd recommend using DTS 9, if possible.