linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v06 00/36] Userspace compile test and fixes for exported uapi header files
@ 2017-08-06 16:43 Mikko Rapeli
  2017-08-06 16:43 ` [PATCH v06 01/36] Add scripts/headers_compile_test.sh: compile test for exported uapi headers Mikko Rapeli
                   ` (32 more replies)
  0 siblings, 33 replies; 90+ messages in thread
From: Mikko Rapeli @ 2017-08-06 16:43 UTC (permalink / raw)
  To: linux-kernel, linux-api; +Cc: Mikko Rapeli

v6:
Addressed v5 review comments.
Dropped patches already applied from other developers for same problems:
thanks Christoph Hellwig, Nicolas Dichtel, Arnd Bergmann, Dmitry V. Levin,
Leon Romanovsky, David Lebrun, Jason Gunthorpe, Jonas Gorski, Stephen
Hemminger, Davide Caratti and others!
Moved glibc compatibility fix to a separate patch set to focus on these.
Minor tuning to scripts/headers_compile_test.sh.
Since several patches are not getting any review comments from lkml or from
people and lists added by scripts/get_maintainer.pl, added manually crafted
Cc:'s to the patches.

v5:
https://lkml.org/lkml/2016/8/22/661
two years now from v1 to v5 though some of the patches have been applied
with these changes all uapi headers compile stand alone in users space
added myself to MAINTAINERS for the test script
tried to fix all v04 review findings
due to regression in one of the accepted patches, added a glibc compatibility test
fixed some glibc compatibility issues, which are hopefully on the right path

v4:
https://lkml.org/lkml/2015/10/15/22
tried to fix v03 review findings
tried to fix all hack patches

v3:
https://lkml.org/lkml/2015/5/30/96
tried to fix all v2 review findings
tried to guess how to fix a few more issue
with a few hacks, 0 files fail and 760 files pass the compile test on 32bit x86

v2:
https://lkml.org/lkml/2015/2/16/521
added cross compiler support with CROSS_COMPILE,
detecting libc and GCC headers from compiler,
more header file fixes

v1:
https://lkml.org/lkml/2014/8/21/665

Users of kernel header files would be happier if they did not contain
kernel specific parts and would contain #include statements for all
other header files that they depend on, and in general would compile.

This patch set introduces a compile test for headers exported to userspace
and then fixes all 42 of the remaining userspace header compilation
failures. Some of the fixes may change include order and thus may expose
incompatibilities between kernel and libc and other userspace library
headers which include incompatible copies of kernel uapi header definitions.

Changes are also available in headers_test_v06 branch at github:
https://github.com/mcfrisk/linux/tree/headers_test_v06

Here's how to run the userspace compile tests and example output with these
patches applied on top of v4.13-rc3-216-g0a23ea65ce9f:

$ make headers_install
$ cd usr/include
$ ../../scripts/headers_compile_test.sh
...
Kernel header compile test statistics:

0 files failed the kernel header compile test.
863 files passed the kernel header compile test.

Compile tested with the test itself on 32bit x86 and armhf and
with allmodconfig on x86 i586.

Would be nice when various Linux kernel subsystem maintainers would
pick and apply patches from this series to their queues, and comment
if there are problems with any of them.

Mikko Rapeli (36):
  Add scripts/headers_compile_test.sh: compile test for exported uapi
    headers
  uapi scsi/scsi_bsg_fc.h: use __u8, __u32 and __u64 from linux/types.h
  uapi scsi/scsi_netlink.h: use __u8, __u16 and __u64 from linux/types.h
  uapi scsi/scsi_netlink_fc.h: use __u16, __u32 and __u64 from
    linux/types.h
  uapi linux/sysctl.h: use __kernel_size_t instead of size_t
  uapi asm-generic/ipcbuf.h: include linux/posix_types.h
  uapi asm-generic/msgbuf.h: include asm/ipcbuf.h
  uapi asm-generic/shmbuf.h: include fixes
  uapi asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h
  uapi asm-generic/signal.h: use __kernel_size_t instead of size_t
  uapi asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h
  x86 uapi asm/signal.h: use __kernel_size_t instead of size_t
  x86 uapi asm/sembuf.h: include linux/types.h and linux/ipc.h
  arm uapi asm/signal.h: include <stddef.h> for size_t in userspace
  uapi linux/socket.h: include sys/socket.h in user space
  uapi linux/dlm_netlink.h: include linux/dlmconstants.h
  uapi linux/sctp.h: use __u8, __u16 and __u32 from linux/types.h
  uapi linux/errqueue.h: include linux/time.h in user space
  uapi linux/omapfb.h: use __kernel_size_t instead of size_t
  uapi linux/scc.h: include linux/sockios.h
  uapi linux/kexec.h: use __kernel_size_t instead of size_t
  uapi linux/reiserfs_xattr.h: use __kernel_size_t instead of size_t
  uapi linux/coda.h: use __kernel_pid_t and add u_short etc definitions
    for userspace
  uapi linux/coda_psdev.h: move upc_req definition from uapi to kernel
    side headers
  uapi linux/android/binder.h: use __kernel_pid_t and __kernel_uid_t
  uapi xen/privcmd.h: fix compilation in userspace
  uapi xen/gntdev.h: include xen/privcmd.h and define grant_ref_t
  uapi xen/evtchn.h: include xen/privcmd.h
  uapi linux/elfcore.h: remove non-compiling userspace parts
  uapi rdma/rdma_user_rxe.h: include in.h and in6.h
  uapi linux/patchkey.h: change #error to #warning if file included
    directly
  uapi drm/armada_drm.h: use __u32 and __u64 instead of uint32_t and
    uint64_t
  uapi linux/fsmap.h: use __kernel_size_t instead of size_t
  uapi: break dependency loop between <linux/hdlc/ioctl.h> and
    <linux/if.h>
  uapi linux/tls.h: don't include <net/tcp.h> in user space
  uapi linux/kfd_ioctl.h: use __u32 and __u64 instead of uint32_t and
    uint64_t

 MAINTAINERS                         |   5 +
 arch/arm/include/uapi/asm/signal.h  |   2 +
 arch/x86/include/uapi/asm/sembuf.h  |   3 +
 arch/x86/include/uapi/asm/signal.h  |   2 +-
 include/linux/coda_psdev.h          |  11 +
 include/uapi/asm-generic/ipcbuf.h   |   2 +
 include/uapi/asm-generic/msgbuf.h   |   2 +
 include/uapi/asm-generic/sembuf.h   |   2 +
 include/uapi/asm-generic/shmbuf.h   |   4 +-
 include/uapi/asm-generic/signal.h   |   2 +-
 include/uapi/asm-generic/ucontext.h |   3 +
 include/uapi/drm/armada_drm.h       |  22 +-
 include/uapi/linux/android/binder.h |   4 +-
 include/uapi/linux/coda.h           |  11 +-
 include/uapi/linux/coda_psdev.h     |  13 -
 include/uapi/linux/dlm_netlink.h    |   1 +
 include/uapi/linux/elfcore.h        |  21 +-
 include/uapi/linux/errqueue.h       |   6 +
 include/uapi/linux/fsmap.h          |   2 +-
 include/uapi/linux/hdlc/ioctl.h     |  17 +-
 include/uapi/linux/if.h             |  23 +-
 include/uapi/linux/kexec.h          |   4 +-
 include/uapi/linux/kfd_ioctl.h      | 172 ++++++------
 include/uapi/linux/omapfb.h         |   2 +-
 include/uapi/linux/patchkey.h       |   2 +-
 include/uapi/linux/reiserfs_xattr.h |   2 +-
 include/uapi/linux/scc.h            |   1 +
 include/uapi/linux/sctp.h           |  20 +-
 include/uapi/linux/socket.h         |   4 +
 include/uapi/linux/sysctl.h         |   4 +-
 include/uapi/linux/tls.h            |   2 +
 include/uapi/rdma/rdma_user_rxe.h   |   2 +
 include/uapi/scsi/scsi_bsg_fc.h     |  54 ++--
 include/uapi/scsi/scsi_netlink.h    |  22 +-
 include/uapi/scsi/scsi_netlink_fc.h |  16 +-
 include/uapi/xen/evtchn.h           |   2 +
 include/uapi/xen/gntdev.h           |   6 +
 include/uapi/xen/privcmd.h          |  14 +-
 include/xen/interface/grant_table.h |   6 +-
 scripts/headers_compile_test.sh     | 507 ++++++++++++++++++++++++++++++++++++
 40 files changed, 784 insertions(+), 216 deletions(-)
 create mode 100755 scripts/headers_compile_test.sh

-- 
2.13.3

^ permalink raw reply	[flat|nested] 90+ messages in thread

end of thread, other threads:[~2017-09-18 12:57 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-06 16:43 [PATCH v06 00/36] Userspace compile test and fixes for exported uapi header files Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 01/36] Add scripts/headers_compile_test.sh: compile test for exported uapi headers Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 02/36] uapi scsi/scsi_bsg_fc.h: use __u8, __u32 and __u64 from linux/types.h Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 03/36] uapi scsi/scsi_netlink.h: use __u8, __u16 " Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 04/36] uapi scsi/scsi_netlink_fc.h: use __u16, __u32 " Mikko Rapeli
2017-08-06 18:22   ` James Bottomley
     [not found]     ` <1502043773.2673.9.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2017-08-06 20:42       ` Mikko Rapeli
2017-08-06 22:09         ` James Bottomley
     [not found]           ` <1502057361.2673.21.camel-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org>
2017-08-07  6:08             ` Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 06/36] uapi asm-generic/ipcbuf.h: include linux/posix_types.h Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 07/36] uapi asm-generic/msgbuf.h: include asm/ipcbuf.h Mikko Rapeli
2017-08-06 16:43 ` [PATCH v06 08/36] uapi asm-generic/shmbuf.h: include fixes Mikko Rapeli
2017-08-08 22:42   ` Dmitry V. Levin
2017-08-06 16:44 ` [PATCH v06 09/36] uapi asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h Mikko Rapeli
2017-08-08 22:45   ` Dmitry V. Levin
2017-08-06 16:44 ` [PATCH v06 10/36] uapi asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 11/36] uapi asm-generic/ucontext.h: include asm/signal.h and asm/sigcontext.h Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 12/36] x86 uapi asm/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli
2017-08-07 14:30   ` Arnd Bergmann
2017-08-08 22:50   ` Dmitry V. Levin
2017-08-06 16:44 ` [PATCH v06 13/36] x86 uapi asm/sembuf.h: include linux/types.h and linux/ipc.h Mikko Rapeli
     [not found]   ` <20170806164428.2273-14-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-08 22:54     ` Dmitry V. Levin
2017-08-06 16:44 ` [PATCH v06 14/36] arm uapi asm/signal.h: include <stddef.h> for size_t in userspace Mikko Rapeli
2017-08-08 22:57   ` Dmitry V. Levin
     [not found]     ` <20170808225739.GF10552-u2l5PoMzF/Vg9hUCZPvPmw@public.gmane.org>
2017-08-09 12:41       ` Arnd Bergmann
     [not found]         ` <CAK8P3a30Vd2JquMvZ88tTO4jFAUMJGtUpvLuDmDPp2UFBYXDLQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-09 12:52           ` Dmitry V. Levin
2017-08-06 16:44 ` [PATCH v06 15/36] uapi linux/socket.h: include sys/socket.h in user space Mikko Rapeli
     [not found]   ` <20170806164428.2273-16-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-08 23:00     ` Dmitry V. Levin
     [not found]       ` <20170808230041.GG10552-u2l5PoMzF/Vg9hUCZPvPmw@public.gmane.org>
2017-08-09 12:32         ` Arnd Bergmann
2017-08-06 16:44 ` [PATCH v06 16/36] uapi linux/dlm_netlink.h: include linux/dlmconstants.h Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 17/36] uapi linux/sctp.h: use __u8, __u16 and __u32 from linux/types.h Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 18/36] uapi linux/errqueue.h: include linux/time.h in user space Mikko Rapeli
2017-08-06 20:23   ` Willem de Bruijn
2017-08-06 20:26     ` Willem de Bruijn
2017-08-06 20:58       ` Mikko Rapeli
     [not found]     ` <CAF=yD-L2ntuH54J_SwN9WcpBMgkV_v0e-Q2Pu2mrQ3+1RozGFQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-06 20:56       ` Mikko Rapeli
     [not found]         ` <20170806205654.GF28459-dqH1CgrzRhOk/eJAJmRu5A@public.gmane.org>
2017-08-06 21:24           ` Willem de Bruijn
     [not found]             ` <CAF=yD-+w2sboybyUZ-6nKQy1s=Oi1S4Z5yZgksM-CzQjDRG+Vw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-06 21:33               ` Mikko Rapeli
2017-08-06 21:42                 ` Willem de Bruijn
     [not found]                   ` <CAF=yD-LN9b9q6sY38eCBM3VyfErQ8sqpQ_7fwkJzMxgjeRFtFg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-06 21:52                     ` Mikko Rapeli
     [not found]                       ` <20170806215244.GB31101-dqH1CgrzRhOk/eJAJmRu5A@public.gmane.org>
2017-08-06 22:03                         ` Willem de Bruijn
2017-08-06 16:44 ` [PATCH v06 19/36] uapi linux/omapfb.h: use __kernel_size_t instead of size_t Mikko Rapeli
2017-08-07 15:00   ` Arnd Bergmann
2017-08-08 23:11   ` Dmitry V. Levin
2017-08-06 16:44 ` [PATCH v06 20/36] uapi linux/scc.h: include linux/sockios.h Mikko Rapeli
     [not found] ` <20170806164428.2273-1-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-06 16:43   ` [PATCH v06 05/36] uapi linux/sysctl.h: use __kernel_size_t instead of size_t Mikko Rapeli
     [not found]     ` <20170806164428.2273-6-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-08 22:34       ` Dmitry V. Levin
2017-08-09  7:18         ` Mikko Rapeli
2017-08-06 16:44   ` [PATCH v06 21/36] uapi linux/kexec.h: " Mikko Rapeli
     [not found]     ` <20170806164428.2273-22-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-07 15:12       ` Arnd Bergmann
2017-08-08 23:15     ` Dmitry V. Levin
2017-08-06 16:44   ` [PATCH v06 30/36] uapi rdma/rdma_user_rxe.h: include in.h and in6.h Mikko Rapeli
     [not found]     ` <20170806164428.2273-31-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-08 23:13       ` Jason Gunthorpe
     [not found]         ` <20170808231306.GH29372-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-09 13:48           ` Moni Shoua
2017-08-09 15:52             ` Jason Gunthorpe
     [not found]               ` <20170809155241.GB15586-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-10  2:47                 ` Dmitry V. Levin
     [not found]                   ` <20170810024747.GA30198-u2l5PoMzF/Vg9hUCZPvPmw@public.gmane.org>
2017-08-10 16:19                     ` Jason Gunthorpe
2017-08-06 16:44   ` [PATCH v06 36/36] uapi linux/kfd_ioctl.h: use __u32 and __u64 instead of uint32_t and uint64_t Mikko Rapeli
     [not found]     ` <20170806164428.2273-37-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-07 15:01       ` Arnd Bergmann
2017-09-02 12:30         ` Oded Gabbay
2017-08-06 16:44 ` [PATCH v06 22/36] uapi linux/reiserfs_xattr.h: use __kernel_size_t instead of size_t Mikko Rapeli
2017-08-08 23:17   ` Dmitry V. Levin
2017-08-06 16:44 ` [PATCH v06 23/36] uapi linux/coda.h: use __kernel_pid_t and add u_short etc definitions for userspace Mikko Rapeli
     [not found]   ` <20170806164428.2273-24-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-07 15:06     ` Arnd Bergmann
2017-08-06 16:44 ` [PATCH v06 24/36] uapi linux/coda_psdev.h: move upc_req definition from uapi to kernel side headers Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 25/36] uapi linux/android/binder.h: use __kernel_pid_t and __kernel_uid_t Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 26/36] uapi xen/privcmd.h: fix compilation in userspace Mikko Rapeli
2017-08-15 22:58   ` [Xen-devel] " Stefano Stabellini
2017-08-06 16:44 ` [PATCH v06 27/36] uapi xen/gntdev.h: include xen/privcmd.h and define grant_ref_t Mikko Rapeli
     [not found]   ` <20170806164428.2273-28-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-21 13:33     ` Juergen Gross
     [not found]       ` <ff3e726a-8e03-4543-7190-e6f8229b9e99-IBi9RG/b67k@public.gmane.org>
2017-08-21 14:31         ` Boris Ostrovsky
     [not found]           ` <c4766f8b-fcd0-4158-2d70-72417bf4afbb-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-08-21 14:46             ` Juergen Gross
2017-08-21 14:59               ` Boris Ostrovsky
2017-08-06 16:44 ` [PATCH v06 28/36] uapi xen/evtchn.h: include xen/privcmd.h Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 29/36] uapi linux/elfcore.h: remove non-compiling userspace parts Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 31/36] uapi linux/patchkey.h: change #error to #warning if file included directly Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 32/36] uapi drm/armada_drm.h: use __u32 and __u64 instead of uint32_t and uint64_t Mikko Rapeli
     [not found]   ` <20170806164428.2273-33-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-07  9:47     ` Daniel Vetter
2017-08-06 16:44 ` [PATCH v06 33/36] uapi linux/fsmap.h: use __kernel_size_t instead of size_t Mikko Rapeli
     [not found]   ` <20170806164428.2273-34-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2017-08-07 15:54     ` Darrick J. Wong
2017-08-07 16:01       ` Arnd Bergmann
     [not found]         ` <CAK8P3a3sVWu9wiqct4h9njZC53qUOrLbM_wXL7XXZ8hfiuK7Lg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-07 16:45           ` Darrick J. Wong
2017-08-07 20:20             ` Arnd Bergmann
2017-08-08 23:08               ` Darrick J. Wong
2017-08-09  8:24                 ` Arnd Bergmann
2017-08-06 16:44 ` [PATCH v06 34/36] uapi: break dependency loop between <linux/hdlc/ioctl.h> and <linux/if.h> Mikko Rapeli
2017-08-06 16:44 ` [PATCH v06 35/36] uapi linux/tls.h: don't include <net/tcp.h> in user space Mikko Rapeli
2017-08-08 23:25   ` Dmitry V. Levin
2017-09-04 16:15     ` Dmitry V. Levin
     [not found]       ` <20170904161510.GA16001-u2l5PoMzF/Vg9hUCZPvPmw@public.gmane.org>
2017-09-18 12:57         ` Mikko Rapeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).