• Florian Fainelli's avatar
    tools: Fixed MIPS builds due to struct flock re-definition · 9b31e608
    Florian Fainelli authored
    Building perf for MIPS failed after 9f79b8b7 ("uapi: simplify
    __ARCH_FLOCK{,64}_PAD a little") with the following error:
    
      CC
    /home/fainelli/work/buildroot/output/bmips/build/linux-custom/tools/perf/trace/beauty/fcntl.o
    In file included from
    ../../../../host/mipsel-buildroot-linux-gnu/sysroot/usr/include/asm/fcntl.h:77,
                     from ../include/uapi/linux/fcntl.h:5,
                     from trace/beauty/fcntl.c:10:
    ../include/uapi/asm-generic/fcntl.h:188:8: error: redefinition of
    'struct flock'
     struct flock {
            ^~~~~
    In file included from ../include/uapi/linux/fcntl.h:5,
                     from trace/beauty/fcntl.c:10:
    ../../../../host/mipsel-buildroot-linux-gnu/sysroot/usr/include/asm/fcntl.h:63:8:
    note: originally defined here
     struct flock {
            ^~~~~
    
    This is due to the local copy under
    tools/include/uapi/asm-generic/fcntl.h including the toolchain's kernel
    headers which already define 'struct flock' and define
    HAVE_ARCH_STRUCT_FLOCK to future inclusions make a decision as to
    whether re-defining 'struct flock' is appropriate or not.
    
    Make sure what do not re-define 'struct flock'
    when HAVE_ARCH_STRUCT_FLOCK is already defined.
    
    Fixes: 9f79b8b7 ("uapi: simplify __ARCH_FLOCK{,64}_PAD a little")
    Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    [arnd: sync with include/uapi/asm-generic/fcntl.h as well]
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    9b31e608
fcntl.h 5.53 KB