[CRIU] [PATCH] ppc64le: fix build with UFFD

Mike Rapoport rppt at linux.vnet.ibm.com
Tue Apr 12 22:30:14 PDT 2016


On Tue, Apr 12, 2016 at 11:21:55AM -0700, Andrew Vagin wrote:
> On Tue, Apr 12, 2016 at 08:52:29PM +0300, Mike Rapoport wrote:
> > The __u64 is 'unsigned long' on Power and 'unsigned long long' on x86_64.
> > Using PRI?64 does not help because, for instance, PRIu64 is 'lu'.
> > 
> > According to [1] the solution is to define __SANE_USERSPACE_TYPES__ for
> > Power builds
> > 
> > [1] http://thread.gmane.org/gmane.linux.kernel/1425475/focus=1427433
> > 
> > Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
> > ---
> >  Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index e22c71e..625cf31 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -67,7 +67,7 @@ ifeq ($(ARCH),ppc64)
> >                  error := $(error ppc64 big endian not yet supported)
> >          endif
> >  
> > -        DEFINES		:= -DCONFIG_PPC64
> > +        DEFINES		:= -DCONFIG_PPC64 -D__SANE_USERSPACE_TYPES__
> 
> I think the same problem exists for arm and aarch64.
> 
> Can we define __SANE_USERSPACE_TYPES__ for all arch-es and remove
> PRI*64 from code?

__SANE_USERSPACE_TYPES__ defined only for Power and MIPS, apparently
because these arches have switched from long unsigned int to long long
unsigned int for __u64 and they needed to keep backward compatibility for
existing userspace.
arm(64) is using long long unsigned int, just like x86, so I think the
problem in arm is different.

As for the PRI*64, I afraid it's not that simple. To drop those we should
ensure that all 64-bit integers are long long and this is far more
intrusive than -D__SANE_USERSPACE_TYPES__ :)

> Thanks,
> Andrew
> 
> >  endif
> >  
> >  export PROTOUFIX DEFINES USERCFLAGS
> > -- 
> > 1.9.1
> > 
--
Sincerely yours,
Mike.



More information about the CRIU mailing list