[CRIU] Compile errors with 4.18 kernels

Adrian Reber adrian at lisas.de
Mon Jul 2 12:22:05 MSK 2018


Just found this:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86275

seems fixes for glibc have been merged and should soon hit Fedora 29 and
fix our travis errors.

Partial fixes are already part of Rawhide's glibc and if we wait one
more day (or two) CRIU should build on Rawhide again.

		Adrian


On Fri, Jun 15, 2018 at 12:14:18AM -0700, Andrei Vagin wrote:
> On Thu, Jun 14, 2018 at 10:50:56PM +0100, Radostin Stoyanov wrote:
> > On 14/06/18 19:20, Adrian Reber wrote:
> > > As I see it also in travis (https://api.travis-ci.org/v3/job/392077603/log.txt)
> > > I guess it is known that currently compilation fails on early 4.18
> > > kernels.
> > >
> > >   CC       criu/pie/parasite.o
> > > In file included from /usr/include/asm/signal.h:7,
> > >                  from /usr/include/linux/signal.h:5,
> > >                  from /usr/include/linux/aio_abi.h:32,
> > >                  from criu/include/aio.h:4,
> > >                  from criu/pie/parasite.c:22:
> > > /usr/include/linux/time.h:10:8: error: redefinition of ‘struct timespec’
> > >
> > > (and more)
> > >
> > > Is this a bug in the kernel or does it need a fix in CRIU? Just curious
> > > if somebody is looking into it?
> > The problem comes from the commit below, which includes <linux/signal.h>
> > in linux/aio_abi.h
> >    
> > https://github.com/torvalds/linux/commit/7a074e96dee62586c935c80cecd931431bfdd0be#diff-590a640c13a8f3a134e57b84f5c4fb79
> > 
> > I will try to fix it and I will send a patch.
> 
> I suggest to report this problem into lkml.
> Here is a minimal reproducer:
> 
> [root at b5766979408e /]# cat test.c
> #include <signal.h>
> #include <linux/aio_abi.h>
> 
> 
> int main()
> {
> 	return 0;
> }
> 
> 
> [root at b5766979408e /]# gcc -Wall test.c
> In file included from /usr/include/asm/signal.h:7,
>                  from /usr/include/linux/signal.h:5,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/linux/time.h:10:8: error: redefinition of 'struct timespec'
>  struct timespec {
>         ^~~~~~~~
> In file included from /usr/include/signal.h:53,
>                  from test.c:1:
> /usr/include/bits/types/struct_timespec.h:8:8: note: originally defined
> here
>  struct timespec
>         ^~~~~~~~
> In file included from /usr/include/linux/signal.h:5,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/asm/signal.h:16:23: error: conflicting types for 'sigset_t'
>  typedef unsigned long sigset_t;
>                        ^~~~~~~~
> In file included from /usr/include/signal.h:35,
>                  from test.c:1:
> /usr/include/bits/types/sigset_t.h:7:20: note: previous declaration of
> 'sigset_t' was here
>  typedef __sigset_t sigset_t;
>                     ^~~~~~~~
> In file included from /usr/include/linux/signal.h:5,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/asm/signal.h:115:8: error: redefinition of 'struct
> sigaction'
>  struct sigaction {
>         ^~~~~~~~~
> In file included from /usr/include/signal.h:226,
>                  from test.c:1:
> /usr/include/bits/sigaction.h:27:8: note: originally defined here
>  struct sigaction
>         ^~~~~~~~~
> /usr/include/asm/signal.h:116:17: error: expected ':', ',', ';', '}' or
> '__attribute__' before '.' token
>   __sighandler_t sa_handler;
>                  ^~~~~~~~~~
> In file included from /usr/include/linux/signal.h:5,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/asm/signal.h:128:3: error: conflicting types for 'stack_t'
>  } stack_t;
>    ^~~~~~~
> In file included from /usr/include/signal.h:303,
>                  from test.c:1:
> /usr/include/bits/types/stack_t.h:31:5: note: previous declaration of
> 'stack_t' was here
>    } stack_t;
>      ^~~~~~~
> In file included from /usr/include/asm/siginfo.h:15,
>                  from /usr/include/linux/signal.h:6,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/asm-generic/siginfo.h:8:15: error: redefinition of 'union
> sigval'
>  typedef union sigval {
>                ^~~~~~
> In file included from /usr/include/bits/types/siginfo_t.h:6,
>                  from /usr/include/signal.h:57,
>                  from test.c:1:
> /usr/include/bits/types/__sigval_t.h:24:7: note: originally defined here
>  union sigval
>        ^~~~~~
> In file included from /usr/include/asm/siginfo.h:15,
>                  from /usr/include/linux/signal.h:6,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/asm-generic/siginfo.h:11:3: error: conflicting types for
> 'sigval_t'
>  } sigval_t;
>    ^~~~~~~~
> In file included from /usr/include/signal.h:62,
>                  from test.c:1:
> /usr/include/bits/types/sigval_t.h:16:20: note: previous declaration of
> 'sigval_t' was here
>  typedef __sigval_t sigval_t;
>                     ^~~~~~~~
> In file included from /usr/include/asm/siginfo.h:15,
>                  from /usr/include/linux/signal.h:6,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/asm-generic/siginfo.h:133:24: error: conflicting types for
> 'siginfo_t'
>  } __ARCH_SI_ATTRIBUTES siginfo_t;
>                         ^~~~~~~~~
> In file included from /usr/include/signal.h:57,
>                  from test.c:1:
> /usr/include/bits/types/siginfo_t.h:124:5: note: previous declaration of
> 'siginfo_t' was here
>    } siginfo_t __SI_ALIGNMENT;
>      ^~~~~~~~~
> In file included from /usr/include/asm/siginfo.h:15,
>                  from /usr/include/linux/signal.h:6,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/asm-generic/siginfo.h:313:16: error: redefinition of
> 'struct sigevent'
>  typedef struct sigevent {
>                 ^~~~~~~~
> In file included from /usr/include/signal.h:66,
>                  from test.c:1:
> /usr/include/bits/types/sigevent_t.h:22:16: note: originally defined
> here
>  typedef struct sigevent
>                 ^~~~~~~~
> In file included from /usr/include/asm/siginfo.h:15,
>                  from /usr/include/linux/signal.h:6,
>                  from /usr/include/linux/aio_abi.h:32,
>                  from test.c:2:
> /usr/include/asm-generic/siginfo.h:326:3: error: conflicting types for
> 'sigevent_t'
>  } sigevent_t;
>    ^~~~~~~~~~
> In file included from /usr/include/signal.h:66,
>                  from test.c:1:
> /usr/include/bits/types/sigevent_t.h:42:5: note: previous declaration of
> 'sigevent_t' was here
>    } sigevent_t;
>      ^~~~~~~~~~
> 
> [root at b5766979408e /]# cat /etc/redhat-release 
> Fedora release 29 (Rawhide)


More information about the CRIU mailing list