Bug 200081
Summary: | Redefinition error after #include <signal.h> | ||
---|---|---|---|
Product: | IO/Storage | Reporter: | Radostin Stoyanov (rstoyanov1) |
Component: | AIO | Assignee: | Badari Pulavarty (pbadari) |
Status: | NEW --- | ||
Severity: | normal | CC: | alkondratenko, kernel.org, rstoyanov1 |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.18 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Radostin Stoyanov
2018-06-15 08:39:28 UTC
The changes of the above mentioned commit are: https://github.com/torvalds/linux/commit/7a074e96dee62586c935c80cecd931431bfdd0be#diff-590a640c13a8f3a134e57b84f5c4fb79 In addition, gcc-8.1 is unable to build against 4.18-rc1 after commit 7a074e96dee62586c935c80cecd931431bfdd0be Building gcc-8.1.0 for an x86_64 toolchain fails to build against the 4.18-rc1 kernel due to 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.... ``` End of build log: https://pastebin.com/raw/jbbA7CrE I bisected the 4.18-rc1 kernel (v4.17 being "good") and this commit is identified as the bad commit - presumably this is a kernel issue rather than a gcc issue? Just looking for pointers on who to bother at this stage... :) Seeing this when trying to include linux/signal.h as well. I.e. just: ``` #include <stdlib.h> #include <linux/signal.h> ``` Gives approximately same errors about timespec redefinition. Happening in glibc and musl. I am also seeing this failing even inside docker for centos 7 where kernel headers are quite old: kernel-headers-3.10.0-1160.15.2.el7.x86_64 ``` [root@1b336f6ef5a5 ~]# gcc -o test.o -x c - #include <stdlib.h> #include <linux/signal.h> In file included from /usr/include/asm/signal.h:6:0, from /usr/include/linux/signal.h:4, from <stdin>:2: /usr/include/linux/time.h:9:8: error: redefinition of 'struct timespec' struct timespec { ^ In file included from /usr/include/sys/select.h:43:0, from /usr/include/sys/types.h:219, from /usr/include/stdlib.h:314, from <stdin>:1: /usr/include/time.h:120:8: note: originally defined here struct timespec ^ In file included from /usr/include/asm/signal.h:6:0, from /usr/include/linux/signal.h:4, from <stdin>:2: /usr/include/linux/time.h:15:8: error: redefinition of 'struct timeval' struct timeval { ^ In file included from /usr/include/sys/select.h:45:0, from /usr/include/sys/types.h:219, from /usr/include/stdlib.h:314, from <stdin>:1: /usr/include/bits/time.h:30:8: note: originally defined here struct timeval ^ In file included from /usr/include/linux/signal.h:4:0, from <stdin>:2: /usr/include/asm/signal.h:15:23: error: conflicting types for 'sigset_t' typedef unsigned long sigset_t; ^ In file included from /usr/include/sys/types.h:219:0, from /usr/include/stdlib.h:314, from <stdin>:1: /usr/include/sys/select.h:37:20: note: previous declaration of 'sigset_t' was here typedef __sigset_t sigset_t; ^ ``` As part of https://github.com/gperftools/gperftools/pull/1250 we're trying to fetch define for sigev_notify_thread_id. So this looks like some bug in kernel headers, and not recent it seems. |