https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86275
Bug ID: 86275 Summary: gcc-8.1, linux 4.18-rc1, x86_64: error: redefinition of 'struct timespec' Product: gcc Version: 8.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer Assignee: unassigned at gcc dot gnu.org Reporter: gcc at nmacleod dot com CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org, jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org Target Milestone: --- Since this kernel commit in 4.18-rc1: https://github.com/torvalds/linux/commit/7a074e96dee62586c935c80cecd931431bfdd0be#diff-590a640c13a8f3a134e57b84f5c4fb79 building a gcc-8.1 toolchain with 4.18-rc1 for x86_64 will now fail with the following error: In file included from /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/asm/signal.h:7, from /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/linux/signal.h:5, from /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/linux/aio_abi.h:32, from /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/gcc-8.1.0/libsanitizer/include/system/linux/aio_abi.h:2, from /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/gcc-8.1.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc:50: /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/linux/time.h:10:8: error: redefinition of 'struct timespec' struct timespec { ^~~~~~~~ In file included from /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/sys/stat.h:30, from /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/gcc-8.1.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_linux.cc:31: /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include/bits/types/struct_timespec.h:8:8: note: previous definition of 'struct timespec' struct timespec ^~~~~~~~ make[5]: *** [Makefile:539: sanitizer_platform_limits_linux.lo] Error 1 make[5]: *** Waiting for unfinished jobs.... Prior to the 7a074e96d commit, gcc-8.1 would build the 4.18 and all previous kernels without a problem. I performed a git bisect on the kernel between 4.17 (good) and 4.18-rc1 (bad), and git bisect identified the above commit as the first bad commit. gcc-8.1 is configured as follows: Executing (host): /home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/gcc-8.1.0/configure --host=x86_64-linux-gnu --build=x86_64-linux-gnu --prefix=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain --bindir=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/bin --sbindir=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/sbin --sysconfdir=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/etc --libexecdir=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/lib --localstatedir=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/var --disable-static --enable-shared --target=x86_64-libreelec-linux-gnu --with-sysroot=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain/x86_64-libreelec-linux-gnu/sysroot --with-gmp=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain --with-mpfr=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain --with-mpc=/home/neil/projects/scratch/alternates/LibreELEC.tv/build.LibreELEC-Generic.x86_64-9.0-devel-next/toolchain --with-gnu-as --with-gnu-ld --enable-plugin --enable-lto --enable-gold --enable-ld=default --with-linker-hash-style=gnu --disable-multilib --disable-nls --enable-checking=release --with-default-libstdcxx-abi=gcc4-compatible --without-ppl --without-cloog --disable-libada --disable-libmudflap --disable-libatomic --disable-libitm --disable-libquadmath --disable-libgomp --disable-libmpx --disable-libssp --enable-languages=c,c++ --enable-__cxa_atexit --enable-decimal-float --enable-tls --enable-shared --disable-static --enable-c99 --enable-long-long --enable-threads=posix --disable-libstdcxx-pch --enable-libstdcxx-time --enable-clocale=gnu The toolchain is being built with glibc 2.27 and binutils 2.30. The build host is Ubuntu 17.10. The complete gcc log can be found here (4MB, txt): http://milhouse.libreelec.tv/other/gcc-8.1_linux-4.18-rc1.log.txt