Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467924 > unrolled thread

[PATCH v05 00/72] Userspace compile test and fixes for exported uapi header files

Started byMikko Rapeli <mikko.rapeli@iki.fi>
First post2016-08-22 20:50 +0200
Last post2016-08-22 21:50 +0200
Articles 20 on this page of 87 — 11 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v05 00/72] Userspace compile test and fixes for exported uapi header files Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 31/72] include/uapi/linux/mroute.h: include linux/in.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 31/72] include/uapi/linux/mroute.h: include  linux/in.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 18/72] include/uapi/asm-generic/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ definition to hdlc/ioctl.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
        Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h David Miller <davem@davemloft.net> - 2016-08-23 09:10 +0200
          Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h Frans Klaver <fransklaver@gmail.com> - 2016-08-23 10:10 +0200
            Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h Frans Klaver <fransklaver@gmail.com> - 2016-08-24 09:00 +0200
        Re: [PATCH v05 27/72] linux/if.h linux/hdlc/ioctl.h: move IFNAMSIZ  definition to hdlc/ioctl.h Frans Klaver <fransklaver@gmail.com> - 2016-08-23 09:20 +0200
    [PATCH v05 26/72] include/uapi/linux/if_pppox.h: include linux/in.h and linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 26/72] include/uapi/linux/if_pppox.h: include  linux/in.h and linux/in6.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 17/72] asm-generic/sembuf.h: include asm/posix_types.h and asm/ipcbuf.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include linux/time.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include  linux/time.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 37/72] include/uapi/linux/auto_fs.h: include linux/limits.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 37/72] include/uapi/linux/auto_fs.h: include  linux/limits.h Ian Kent <raven@themaw.net> - 2016-08-23 02:50 +0200
    [PATCH v05 30/72] include/uapi/linux/mqueue.h: include linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 05/72] hsi_char.h: use __u32 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 05/72] hsi_char.h: use __u32 from linux/types.h Sebastian Reichel <sre@kernel.org> - 2016-08-22 23:00 +0200
    [PATCH v05 13/72] include/uapi/linux/sysctl.h: use __kernel_size_t instead of size_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 39/72] include/uapi/linux/target_core_user.h: use __u8, __u16, __u32 and __u64 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 32/72] include/uapi/linux/dlm_netlink.h: include linux/dlmconstants.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 33/72] include/uapi/linux/ip6_tunnel.h: include linux/if.h and linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 28/72] include/uapi/linux/packet_diag.h: include linux/netdevice.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 36/72] arch/x86/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h Stephen Hemminger <stephen@networkplumber.org> - 2016-08-22 21:40 +0200
        Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h David Miller <davem@davemloft.net> - 2016-08-23 01:30 +0200
        Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 09:00 +0200
      Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 43/72] include/uapi/linux/btrfs.h: define NULL Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
      Re: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include  linux/time.h Sebastian Reichel <sre@kernel.org> - 2016-08-22 23:00 +0200
        Re: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include  linux/time.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 09:00 +0200
    [PATCH v05 02/72] scripts/headers_compile_test.sh: compile test script for exported headers Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 20:50 +0200
    [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:00 +0200
      Re: [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32  from linux/types.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:00 +0200
      Re: [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
        Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header  file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 23:30 +0200
          Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header  file compatibility fixes David Miller <davem@davemloft.net> - 2016-08-24 01:50 +0200
    [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:00 +0200
      Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header  file compatibility fixes David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
      Re: [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header  file compatibility fixes David Miller <davem@davemloft.net> - 2016-08-24 01:50 +0200
    [PATCH v05 55/72] include/uapi/xen/gntdev.h: include xen/privcmd.h and define grant_ref_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:00 +0200
    [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:10 +0200
      Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include  linux/if.h Stephen Hemminger <stephen@networkplumber.org> - 2016-08-22 21:40 +0200
        Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include  linux/if.h David Miller <davem@davemloft.net> - 2016-08-23 01:30 +0200
        Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include  linux/if.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 08:50 +0200
      Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include  linux/if.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 57/72] coda_psdev.h: move upc_req definition from uapi to kernel side headers Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:10 +0200
    [PATCH v05 65/72] uapi fcntl.h: glibc fcntl.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:10 +0200
    [PATCH v05 23/72] include/uapi/linux/ipv6_route.h: include linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
      Re: [PATCH v05 23/72] include/uapi/linux/ipv6_route.h: include  linux/in6.h David Miller <davem@davemloft.net> - 2016-08-23 01:30 +0200
    [PATCH v05 19/72] include/uapi/linux/socket.h: include sys/socket.h in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
    [PATCH v05 60/72] arch/arm/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
      Re: [PATCH v05 60/72] arch/arm/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t Arnd Bergmann <arnd@arndb.de> - 2016-08-24 17:10 +0200
    [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
    [PATCH v05 52/72] include/linux/sdb.h: use linux/types.h types instead of stdint.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
    [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:20 +0200
      Re: [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation in  userspace Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-08-23 12:10 +0200
        Re: [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation  in userspace Stefano Stabellini <sstabellini@kernel.org> - 2016-08-23 20:20 +0200
          Re: [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation in  userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 22:40 +0200
            Re: [PATCH v05 54/72] include/uapi/xen/privcmd.h: fix compilation  in userspace Stefano Stabellini <sstabellini@kernel.org> - 2016-08-23 23:20 +0200
    [PATCH v05 24/72] include/uapi/linux/ipv6_route.h: include linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 56/72] include/uapi/xen/evtchn.h: include xen/privcmd.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 63/72] include/uapi/sound/Kbuild: remove sound/asoc.h from userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
      Re: [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting  defitions with glibc netipx/ipx.h David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 20/72] include/uapi/linux/rds.h: include linux/socket.h and linux/types.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 58/72] include/uapi/linux/elfcore.h: remove non-compiling userspace parts Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 70/72] uapi time.h: glibc time.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 68/72] uapi ax25.h: glibc netax25/ax25.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
      Re: [PATCH v05 68/72] uapi ax25.h: glibc netax25/ax25.h header  file compatibility fixes David Miller <davem@davemloft.net> - 2016-08-23 01:40 +0200
    [PATCH v05 50/72] include/uapi/linux/fuse.h: use linux/types.h also in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
      Re: [PATCH v05 50/72] include/uapi/linux/fuse.h: use linux/types.h  also in userspace Miklos Szeredi <miklos@szeredi.hu> - 2016-08-23 09:20 +0200
        Re: [PATCH v05 50/72] include/uapi/linux/fuse.h: use linux/types.h  also in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-23 09:50 +0200
    [PATCH v05 67/72] uapi uio.h: glibc sys/uio.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:30 +0200
    [PATCH v05 59/72] include/uapi/linux/errqueue.h: include time.h in userspace Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:40 +0200
    [PATCH v05 53/72] include/linux/xz.h: use linux/types.h types instead of stdint.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:40 +0200
    [PATCH v05 61/72] include/uapi/rdma/rdma_user_rxe.h: include in.h and in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:40 +0200
      Re: [PATCH v05 61/72] include/uapi/rdma/rdma_user_rxe.h: include in.h  and in6.h Doug Ledford <dledford@redhat.com> - 2016-08-23 17:10 +0200
    [PATCH v05 71/72] uapi term*.h: glibc termios.h header file compatibility fixes Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:50 +0200
    [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:50 +0200
      Re: [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include  linux/if.h, linux/ip.h and linux/in6.h David Miller <davem@davemloft.net> - 2016-08-23 01:30 +0200
    [PATCH v05 51/72] include/linux/ipmi-fru.h: use linux/types.h instead of stdint.h Mikko Rapeli <mikko.rapeli@iki.fi> - 2016-08-22 21:50 +0200

Page 2 of 5 — ← Prev page 1 [2] 3 4 5  Next page →


#1467937 — [PATCH v05 13/72] include/uapi/linux/sysctl.h: use __kernel_size_t instead of size_t

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 13/72] include/uapi/linux/sysctl.h: use __kernel_size_t instead of size_t
Message-ID<s92si-1v9-41@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compilation error:

error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/sysctl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
index d2b1215..52e9795 100644
--- a/include/uapi/linux/sysctl.h
+++ b/include/uapi/linux/sysctl.h
@@ -35,9 +35,9 @@ struct __sysctl_args {
 	int __user *name;
 	int nlen;
 	void __user *oldval;
-	size_t __user *oldlenp;
+	__kernel_size_t __user *oldlenp;
 	void __user *newval;
-	size_t newlen;
+	__kernel_size_t newlen;
 	unsigned long __unused[4];
 };
 
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467938 — [PATCH v05 39/72] include/uapi/linux/target_core_user.h: use __u8, __u16, __u32 and __u64 from linux/types.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 39/72] include/uapi/linux/target_core_user.h: use __u8, __u16, __u32 and __u64 from linux/types.h
Message-ID<s92si-1v9-57@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compilation errors like:

error: unknown type name ‘uint16_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/target_core_user.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/uapi/linux/target_core_user.h b/include/uapi/linux/target_core_user.h
index c506cdd..af17b41 100644
--- a/include/uapi/linux/target_core_user.h
+++ b/include/uapi/linux/target_core_user.h
@@ -105,26 +105,26 @@ struct tcmu_cmd_entry {
 
 	union {
 		struct {
-			uint32_t iov_cnt;
-			uint32_t iov_bidi_cnt;
-			uint32_t iov_dif_cnt;
-			uint64_t cdb_off;
-			uint64_t __pad1;
-			uint64_t __pad2;
+			__u32 iov_cnt;
+			__u32 iov_bidi_cnt;
+			__u32 iov_dif_cnt;
+			__u64 cdb_off;
+			__u64 __pad1;
+			__u64 __pad2;
 			struct iovec iov[0];
 		} req;
 		struct {
-			uint8_t scsi_status;
-			uint8_t __pad1;
-			uint16_t __pad2;
-			uint32_t __pad3;
+			__u8 scsi_status;
+			__u8 __pad1;
+			__u16 __pad2;
+			__u32 __pad3;
 			char sense_buffer[TCMU_SENSE_BUFFERSIZE];
 		} rsp;
 	};
 
 } __packed;
 
-#define TCMU_OP_ALIGN_SIZE sizeof(uint64_t)
+#define TCMU_OP_ALIGN_SIZE sizeof(__u64)
 
 enum tcmu_genl_cmd {
 	TCMU_CMD_UNSPEC,
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467940 — [PATCH v05 32/72] include/uapi/linux/dlm_netlink.h: include linux/dlmconstants.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 32/72] include/uapi/linux/dlm_netlink.h: include linux/dlmconstants.h
Message-ID<s92si-1v9-47@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compilation error:

error: ‘DLM_RESNAME_MAXLEN’ undeclared here (not in a function)
  char resource_name[DLM_RESNAME_MAXLEN];

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/dlm_netlink.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/dlm_netlink.h b/include/uapi/linux/dlm_netlink.h
index 647c8ef..ef1e2e0 100644
--- a/include/uapi/linux/dlm_netlink.h
+++ b/include/uapi/linux/dlm_netlink.h
@@ -10,6 +10,7 @@
 #define _DLM_NETLINK_H
 
 #include <linux/types.h>
+#include <linux/dlmconstants.h>
 
 enum {
 	DLM_STATUS_WAITING = 1,
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467941 — [PATCH v05 33/72] include/uapi/linux/ip6_tunnel.h: include linux/if.h and linux/in6.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 33/72] include/uapi/linux/ip6_tunnel.h: include linux/if.h and linux/in6.h
Message-ID<s92si-1v9-61@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compile errors like:

error: ‘IFNAMSIZ’ undeclared here (not in a function)
error: field ‘laddr’ has incomplete type
  struct in6_addr laddr; /* local tunnel end-point address */

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/ip6_tunnel.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/ip6_tunnel.h b/include/uapi/linux/ip6_tunnel.h
index 48af63c..21cfd62 100644
--- a/include/uapi/linux/ip6_tunnel.h
+++ b/include/uapi/linux/ip6_tunnel.h
@@ -2,6 +2,8 @@
 #define _IP6_TUNNEL_H
 
 #include <linux/types.h>
+#include <linux/if.h>
+#include <linux/in6.h>
 
 #define IPV6_TLV_TNL_ENCAP_LIMIT 4
 #define IPV6_DEFAULT_TNL_ENCAP_LIMIT 4
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467942 — [PATCH v05 28/72] include/uapi/linux/packet_diag.h: include linux/netdevice.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 28/72] include/uapi/linux/packet_diag.h: include linux/netdevice.h
Message-ID<s92si-1v9-63@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compilation error:

error: ‘MAX_ADDR_LEN’ undeclared here (not in a function)

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/packet_diag.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/packet_diag.h b/include/uapi/linux/packet_diag.h
index d08c63f..2a75e97 100644
--- a/include/uapi/linux/packet_diag.h
+++ b/include/uapi/linux/packet_diag.h
@@ -2,6 +2,7 @@
 #define __PACKET_DIAG_H__
 
 #include <linux/types.h>
+#include <linux/netdevice.h>
 
 struct packet_diag_req {
 	__u8	sdiag_family;
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467943 — [PATCH v05 36/72] arch/x86/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 36/72] arch/x86/include/uapi/asm/signal.h: use __kernel_size_t instead of size_t
Message-ID<s92sj-1v9-69@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compilation error:

error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 arch/x86/include/uapi/asm/signal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/uapi/asm/signal.h b/arch/x86/include/uapi/asm/signal.h
index 8264f47..74346db 100644
--- a/arch/x86/include/uapi/asm/signal.h
+++ b/arch/x86/include/uapi/asm/signal.h
@@ -127,7 +127,7 @@ struct sigaction {
 typedef struct sigaltstack {
 	void __user *ss_sp;
 	int ss_flags;
-	size_t ss_size;
+	__kernel_size_t ss_size;
 } stack_t;
 
 #endif /* __ASSEMBLY__ */
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467945 — [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
Message-ID<s92sj-1v9-71@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compiler error:

error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/openvswitch.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index d95a301..645499a 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -632,8 +632,8 @@ enum ovs_hash_alg {
  * @hash_basis: basis used for computing hash.
  */
 struct ovs_action_hash {
-	uint32_t  hash_alg;     /* One of ovs_hash_alg. */
-	uint32_t  hash_basis;
+	__u32  hash_alg;     /* One of ovs_hash_alg. */
+	__u32  hash_basis;
 };
 
 /**
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1468003 — Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h

FromStephen Hemminger <stephen@networkplumber.org>
Date2016-08-22 21:40 +0200
SubjectRe: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
Message-ID<s93eG-26x-43@gated-at.bofh.it>
In reply to#1467945
On Mon, 22 Aug 2016 20:32:55 +0200
Mikko Rapeli <mikko.rapeli@iki.fi> wrote:

> Fixes userspace compiler error:
> 
> error: unknown type name ‘uint32_t’
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> ---
>  include/uapi/linux/openvswitch.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
> index d95a301..645499a 100644
> --- a/include/uapi/linux/openvswitch.h
> +++ b/include/uapi/linux/openvswitch.h
> @@ -632,8 +632,8 @@ enum ovs_hash_alg {
>   * @hash_basis: basis used for computing hash.
>   */
>  struct ovs_action_hash {
> -	uint32_t  hash_alg;     /* One of ovs_hash_alg. */
> -	uint32_t  hash_basis;
> +	__u32  hash_alg;     /* One of ovs_hash_alg. */
> +	__u32  hash_basis;
>  };
>  
>  /**

This is a a real issue, but being buried in a huge patch series of include
file stuff I don't think anyone would see it.

[toc] | [prev] | [next] | [standalone]


#1468149 — Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 01:30 +0200
SubjectRe: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
Message-ID<s96Pf-4qY-7@gated-at.bofh.it>
In reply to#1468003
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 22 Aug 2016 12:39:38 -0700

> This is a a real issue, but being buried in a huge patch series of include
> file stuff I don't think anyone would see it.

It hit netdev and thus patchwork, therefore anyone watching networking
patches saw it.

I would not call it buried at all.

[toc] | [prev] | [next] | [standalone]


#1468328 — Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-23 09:00 +0200
SubjectRe: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
Message-ID<s9dQJ-lX-7@gated-at.bofh.it>
In reply to#1468003
On Mon, Aug 22, 2016 at 12:39:38PM -0700, Stephen Hemminger wrote:
> On Mon, 22 Aug 2016 20:32:55 +0200
> Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> 
> > Fixes userspace compiler error:
> > 
> > error: unknown type name ‘uint32_t’
> > 
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> > ---
> >  include/uapi/linux/openvswitch.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
> > index d95a301..645499a 100644
> > --- a/include/uapi/linux/openvswitch.h
> > +++ b/include/uapi/linux/openvswitch.h
> > @@ -632,8 +632,8 @@ enum ovs_hash_alg {
> >   * @hash_basis: basis used for computing hash.
> >   */
> >  struct ovs_action_hash {
> > -	uint32_t  hash_alg;     /* One of ovs_hash_alg. */
> > -	uint32_t  hash_basis;
> > +	__u32  hash_alg;     /* One of ovs_hash_alg. */
> > +	__u32  hash_basis;
> >  };
> >  
> >  /**
> 
> This is a a real issue, but being buried in a huge patch series of include
> file stuff I don't think anyone would see it.

The mechanism for finding this issue the same as finding a missing header file
dependency: the uapi header userspace compile test.

https://lkml.org/lkml/2016/8/22/659

I'm using "scripts/get_maintainers.pl --no-rolestats" to fill in the Cc: list
for git send-email so if MAINTAINERS is uptodate, then correct lists and
maintainers should have the received the patches.

-Mikko

[toc] | [prev] | [next] | [standalone]


#1468158 — Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 01:40 +0200
SubjectRe: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
Message-ID<s96YW-4v1-15@gated-at.bofh.it>
In reply to#1467945
From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:55 +0200

> Fixes userspace compiler error:
> 
> error: unknown type name ‘uint32_t’
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

[toc] | [prev] | [next] | [standalone]


#1467946 — [PATCH v05 43/72] include/uapi/linux/btrfs.h: define NULL

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 43/72] include/uapi/linux/btrfs.h: define NULL
Message-ID<s92si-1v9-65@gated-at.bofh.it>
In reply to#1467924
Copied the NULL definition from include/linux/stddef.h which does not have
it in userspace.

Fixes userspace compilation error:

error: ‘NULL’ undeclared (first use in this function)
    return NULL;

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/btrfs.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index ac5eacd..8865985 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -20,6 +20,12 @@
 #define _UAPI_LINUX_BTRFS_H
 #include <linux/types.h>
 #include <linux/ioctl.h>
+#include <linux/stddef.h>
+
+/* for userspace where linux/stddef.h doesn't define this */
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
 
 #define BTRFS_IOCTL_MAGIC 0x94
 #define BTRFS_VOL_NAME_MAX 255
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467947 — [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h
Message-ID<s92sj-1v9-75@gated-at.bofh.it>
In reply to#1467924
Fixes userspace compilation errors due to missing timespec definition.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/hsi/cs-protocol.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/hsi/cs-protocol.h b/include/uapi/linux/hsi/cs-protocol.h
index f153d6e..c8d9f08 100644
--- a/include/uapi/linux/hsi/cs-protocol.h
+++ b/include/uapi/linux/hsi/cs-protocol.h
@@ -26,6 +26,7 @@
 
 #include <linux/types.h>
 #include <linux/ioctl.h>
+#include <linux/time.h>
 
 /* chardev parameters */
 #define CS_DEV_FILE_NAME		"/dev/cmt_speech"
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1468049 — Re: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h

FromSebastian Reichel <sre@kernel.org>
Date2016-08-22 23:00 +0200
SubjectRe: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h
Message-ID<s94u6-2Ol-41@gated-at.bofh.it>
In reply to#1467947

[Multipart message — attachments visible in raw view] — view raw

Hi,

On Mon, Aug 22, 2016 at 08:32:23PM +0200, Mikko Rapeli wrote:
> Fixes userspace compilation errors due to missing timespec definition.
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> ---
>  include/uapi/linux/hsi/cs-protocol.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/hsi/cs-protocol.h b/include/uapi/linux/hsi/cs-protocol.h
> index f153d6e..c8d9f08 100644
> --- a/include/uapi/linux/hsi/cs-protocol.h
> +++ b/include/uapi/linux/hsi/cs-protocol.h
> @@ -26,6 +26,7 @@
>  
>  #include <linux/types.h>
>  #include <linux/ioctl.h>
> +#include <linux/time.h>
>  
>  /* chardev parameters */
>  #define CS_DEV_FILE_NAME		"/dev/cmt_speech"

As far as I can see there header file does not use timespec since
I removed it roughly a year ago.

-- Sebastian

[toc] | [prev] | [next] | [standalone]


#1468327 — Re: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-23 09:00 +0200
SubjectRe: [PATCH v05 06/72] include/uapi/linux/hsi/cs-protocol.h: include linux/time.h
Message-ID<s9dQJ-lX-3@gated-at.bofh.it>
In reply to#1468049
On Mon, Aug 22, 2016 at 10:52:20PM +0200, Sebastian Reichel wrote:
> Hi,
> 
> On Mon, Aug 22, 2016 at 08:32:23PM +0200, Mikko Rapeli wrote:
> > Fixes userspace compilation errors due to missing timespec definition.
> > 
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> > ---
> >  include/uapi/linux/hsi/cs-protocol.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/uapi/linux/hsi/cs-protocol.h b/include/uapi/linux/hsi/cs-protocol.h
> > index f153d6e..c8d9f08 100644
> > --- a/include/uapi/linux/hsi/cs-protocol.h
> > +++ b/include/uapi/linux/hsi/cs-protocol.h
> > @@ -26,6 +26,7 @@
> >  
> >  #include <linux/types.h>
> >  #include <linux/ioctl.h>
> > +#include <linux/time.h>
> >  
> >  /* chardev parameters */
> >  #define CS_DEV_FILE_NAME		"/dev/cmt_speech"
> 
> As far as I can see there header file does not use timespec since
> I removed it roughly a year ago.

Ok, sorry I missed that. I will the need for this again.

-Mikko

[toc] | [prev] | [next] | [standalone]


#1467948 — [PATCH v05 02/72] scripts/headers_compile_test.sh: compile test script for exported headers

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 20:50 +0200
Subject[PATCH v05 02/72] scripts/headers_compile_test.sh: compile test script for exported headers
Message-ID<s92si-1v9-51@gated-at.bofh.it>
In reply to#1467924
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.

For each header file exported to userspace, this script tries to compile it
together with minimal header files from GCC and libc, and reports results.

Kernel headers depend on GCC headers so their path is included in the
test compiler command line.

Default libc and GCC header file locations are parsed from compiler
configuration.

Some gcc and kernel headers depend on libc headers which are made available
by copying from the compiler default location to a temporary location and
removing possibly existing kernel headers from this directory. This is a bit
of a hack but seems to work in multiple environments.

Tested natively on:

Debian unstable, i586-linux-gnu and gcc 4.9.2
Raspbian Wheezy, arm-linux-gnueabihf and gcc 4.6.3
Ubuntu 12.04 LTS, x86_64-linux-gnu and gcc 4.6.3

Tested cross compilation using standard CROSS_COMPILE=/path/to/gcc with:

arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) 4.9.2 20140904 (prerelease)

Execute the script in the directory where kernel header files are installed.
For example:

$ make headers_install
$ cd usr/include
$ ../../scripts/headers_compile_test.sh

Example statistics from v4.4-rc3-10-gc846b17 kernel on 32bit x86:

122 files failed the compile test.
645 files passed the compile test.

Example error types from v4.4-rc3-10-gc846b17 kernel:

$ ../../scripts/headers_compile_test.sh 2>&1 | \
grep error: | sed -e 's/.*error://g' | sort | uniq -c | sort -rn

    381  unknown type name ‘uint32_t’
    125  unknown type name ‘uint64_t’
     99  unknown type name ‘size_t’
     43  unknown type name ‘__kernel_ulong_t’
     29  unknown type name ‘uint8_t’
     23  unknown type name ‘int32_t’
     16  unknown type name ‘__kernel_time_t’
     14  unknown type name ‘__be16’
     14  ‘IFNAMSIZ’ undeclared here (not in a function)
     14  field ‘addr’ has incomplete type
      9  field ‘ifru_netmask’ has incomplete type
      9  field ‘ifru_hwaddr’ has incomplete type
      9  field ‘ifru_dstaddr’ has incomplete type
      9  field ‘ifru_broadaddr’ has incomplete type
      9  field ‘ifru_addr’ has incomplete type
      8  unknown type name ‘uint16_t’
      8  unknown type name ‘pid_t’
      8  unknown type name ‘__kernel_pid_t’
      7  unknown type name ‘u_short’
      5  unknown type name ‘__kernel_long_t’
      4  unknown type name ‘__kernel_uid32_t’
      4  unknown type name ‘__kernel_gid32_t’
      4  ‘ETH_ALEN’ undeclared here (not in a function)
      3  unknown type name ‘caddr_t’
      3  ‘IPSET_ERR_TYPE_SPECIFIC’ undeclared here (not in a function)
      3  field ‘src_addr’ has incomplete type
      3  field ‘laddr’ has incomplete type
      3  field ‘bssid’ has incomplete type
      3  expected specifier-qualifier-list before ‘uint64_t’
      2  unknown type name ‘u_long’
      2  unknown type name ‘stack_t’
      2  unknown type name ‘sigset_t’
      2  unknown type name ‘sa_family_t’
      2  unknown type name ‘__kernel_mode_t’
      2  unknown type name ‘__kernel_key_t’
      2  unknown type name ‘elf_gregset_t’
      2  unknown type name ‘bool’
      2  ‘uint64_t’ undeclared here (not in a function)
      2  ‘true’ undeclared (first use in this function)
      2  ‘NAME_MAX’ undeclared here (not in a function)
      2  ‘__kernel_mode_t’ undeclared here (not in a function)
      2  invalid application of ‘sizeof’ to incomplete type ‘struct sockaddr’
      2  field ‘uc_mcontext’ has incomplete type
      2  field ‘src’ has incomplete type
      2  field ‘shm_perm’ has incomplete type
      2  field ‘sem_perm’ has incomplete type
      2  field ‘raddr’ has incomplete type
      2  field ‘msg_perm’ has incomplete type
      2  field ‘grp’ has incomplete type
      2  field ‘dst_addr’ has incomplete type
      2  field ‘arp_pa’ has incomplete type
      2  field ‘arp_netmask’ has incomplete type
      2  field ‘arp_ha’ has incomplete type
      2  ‘false’ undeclared (first use in this function)
      1  xen/interface/xen.h: No such file or directory
      1  via_drmclient.h: No such file or directory
      1  unknown type name ‘wait_queue_head_t’
      1  unknown type name ‘uid_t’
      1  unknown type name ‘int64_t’
      1  unknown type name ‘int16_t’
      1  unknown type name ‘ino_t’
      1  unknown type name ‘elf_greg_t’
      1  unknown type name ‘elf_fpxregset_t’
      1  unknown type name ‘elf_fpregset_t’
      1  unknown type name ‘__be32’
      1  ‘SIOCDEVPRIVATE’ undeclared here (not in a function)
      1  ‘sa_family_t’ undeclared here (not in a function)
      1  ‘NULL’ undeclared (first use in this function)
      1  ‘MSG_FIN’ undeclared here (not in a function)
      1  ‘MAX_IPOPTLEN’ undeclared here (not in a function)
      1  ‘MAX_ADDR_LEN’ undeclared here (not in a function)
      1  ‘IFHWADDRLEN’ undeclared here (not in a function)
      1  field ‘vmask’ has incomplete type
      1  field ‘vifc_rmt_addr’ has incomplete type
      1  field ‘vifc_lcl_addr’ has incomplete type
      1  field ‘vaddr’ has incomplete type
      1  field ‘uc_chain’ has incomplete type
      1  field ‘tcp’ has incomplete type
      1  field ‘sspp_addr’ has incomplete type
      1  field ‘ssp_addr’ has incomplete type
      1  field ‘src_mask’ has incomplete type
      1  field ‘spt_address’ has incomplete type
      1  field ‘spp_address’ has incomplete type
      1  field ‘spinfo_address’ has incomplete type
      1  field ‘spc_aaddr’ has incomplete type
      1  field ‘smsk’ has incomplete type
      1  field ‘sin_addr’ has incomplete type
      1  field ‘sas_obs_rto_ipaddr’ has incomplete type
      1  field ‘saddr’ has incomplete type
      1  field ‘rtmsg_src’ has incomplete type
      1  field ‘rtmsg_gateway’ has incomplete type
      1  field ‘rtmsg_dst’ has incomplete type
      1  field ‘rt_genmask’ has incomplete type
      1  field ‘rt_gateway’ has incomplete type
      1  field ‘rt_dst’ has incomplete type
      1  field ‘prefix’ has incomplete type
      1  field ‘mfcc_origin’ has incomplete type
      1  field ‘mfcc_mcastgrp’ has incomplete type
      1  field ‘mf6cc_origin’ has incomplete type
      1  field ‘mf6cc_mcastgrp’ has incomplete type
      1  field ‘mask’ has incomplete type
      1  field ‘iph’ has incomplete type
      1  field ‘ip’ has incomplete type
      1  field ‘im_src’ has incomplete type
      1  field ‘im_dst’ has incomplete type
      1  field ‘im6_src’ has incomplete type
      1  field ‘im6_dst’ has incomplete type
      1  field ‘gw’ has incomplete type
      1  field ‘dst_mask’ has incomplete type
      1  field ‘dmsk’ has incomplete type
      1  field ‘dest_addr’ has incomplete type
      1  field ‘daddr’ has incomplete type
      1  field ‘ap_addr’ has incomplete type
      1  field ‘a6’ has incomplete type
      1  field ‘a4’ has incomplete type
      1  #error "patchkey.h included directly"
      1  ‘DLM_RESNAME_MAXLEN’ undeclared here (not in a function)
      1  array type has incomplete element type ‘struct timespec’
      1  array type has incomplete element type ‘struct in6_addr’

Once all these errors have been fixed, this test should be added to
'make headers_check'.

Since I've been stubborn enough to work with this script and fixes to the
test failures for over a year, I added my self to MAINTAINERS.
I will continue to maintain this script as a hobby.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Gabriel Laskar <gabriel@lse.epita.fr>
---
 MAINTAINERS                     |   5 +
 scripts/headers_compile_test.sh | 198 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 203 insertions(+)
 create mode 100755 scripts/headers_compile_test.sh

diff --git a/MAINTAINERS b/MAINTAINERS
index a306795..a6fb57d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3245,6 +3245,11 @@ S:	Maintained
 F:	mm/memcontrol.c
 F:	mm/swap_cgroup.c
 
+COMPILE TEST FOR HEADER FILES EXPORTED TO USERSPACE
+M:	Mikko Rapeli <mikko.rapeli@iki.fi>
+S:	Maintained
+F:	scripts/headers_compile_test.sh
+
 CORETEMP HARDWARE MONITORING DRIVER
 M:	Fenghua Yu <fenghua.yu@intel.com>
 L:	linux-hwmon@vger.kernel.org
diff --git a/scripts/headers_compile_test.sh b/scripts/headers_compile_test.sh
new file mode 100755
index 0000000..e13f533
--- /dev/null
+++ b/scripts/headers_compile_test.sh
@@ -0,0 +1,198 @@
+#!/bin/bash
+
+help() {
+	cat << EOF_HELP
+Userspace compile test for exported kernel headers.
+
+    Copyright (C) 2015 Mikko Rapeli <mikko.rapeli@iki.fi>
+
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License
+    as published by the Free Software Foundation; version 2
+    of the License.
+
+Execute in root directory of exported kernel headers in Linux kernel source
+tree. Sets up gcc and libc headers without existing kernel headers to
+a temporary environment and tries to compile all exported header files
+from current directory against them. Return value is zero if all tests pass,
+non-zero if something goes wrong during execution, or the amount of files
+which failed the compile test.
+
+Supported arguments:
+
+    -h|--help       print help
+    -k|--keep       don't cleanup temporary header files and directories
+    -v|--verbose    print more verbose output
+
+Example in Linux kernel source tree:
+
+    \$ make headers_install
+    \$ cd usr/include
+    \$ $( readlink -f "$0" )
+
+EOF_HELP
+}
+
+# bash due to arithmetics and pipefail
+set -euo pipefail
+
+KEEP=0
+HELP=0
+
+# command line arguments
+for p in "$@"; do
+	case "$p" in
+		-k|--keep)
+			KEEP=1
+		;;
+		-h|--help)
+			HELP=1
+		;;
+		-v|--verbose)
+			set -x
+		;;
+		*)
+			help
+			echo "Unknown argument: $p"
+			exit 1
+		;;
+	esac
+done
+
+if [ "$HELP" != "0" ]; then help; exit 0; fi
+
+# sanity test
+if [ ! -d ./linux ]; then
+	echo Sanity check error: ./linux directory not found
+	echo Should be called in usr/include after \'make headers_install\'.
+	echo Returns number of failed files, 0 if none.
+	exit 1
+fi
+
+# Support CC variable for compiler and ccache, and cross compiling.
+# CC is used without quotes to support CC="ccache gcc".
+set +u
+if [ "$CC"foobar == "foobar" ]; then
+	CC=cc
+fi
+
+if [ "$CROSS_COMPILE"foobar != "foobar" ]; then
+	# Using gcc name since some cross compiler tool chains don't provide
+	# the cc symlink
+	CC="$CROSS_COMPILE"gcc
+fi
+set -u
+
+# Kernel headers refer to some gcc and libc headers so make them available.
+set +u
+if [ "$ARCH_TRIPLET"foobar == "foobar" ]; then
+	# Taking triplet from gcc/cpp
+	ARCH_TRIPLET="$( $CC -v -x c -E - < /dev/null 2>&1 | \
+			grep Target | sed -e 's/Target: //' )"
+fi
+
+if [ "$LIBC"foobar == "foobar" ]; then
+	# trying to grep libc includes from gcc/cpp defaults
+	_TEMP="$( $CC -v -x c -E - < /dev/null 2>&1 | \
+		sed -n -e '/^#include <...> search starts here:$/,/^End of search list.$/{//!p}' | \
+		sed -e 's/^\ \//\//g' | \
+		grep '/usr/include' )"
+
+	# sanity check and prepare LIBC dirs
+	for d in $_TEMP; do
+		if [ ! -d "$d" ]; then
+			echo "$d not a directory"
+			exit 1
+		fi
+		LIBC="$LIBC $d"
+	done
+fi
+set -u
+
+# Copy libc include files to temp directory for the tests.
+COMPILE_TEST_INC="$( readlink -f \
+		"$( mktemp -d ../headers_compile_test_include.XXXXXX )" )"
+
+# cleanup if keep not set
+if [ "$KEEP" = "0" ]; then
+	trap 'rm -rf "$COMPILE_TEST_INC"' EXIT
+else
+	trap 'printf \
+"Temporary directory not cleaned up! Remove manually:\n${COMPILE_TEST_INC}\n"' \
+		EXIT
+fi
+
+for d in $LIBC; do
+	# check if last part of dir is the arch triplet, cross compile paths
+	# can have it also elsewhere so just the last one counts.
+	if ! ( echo "$d" | egrep "$ARCH_TRIPLET$" > /dev/null ); then
+		# hopefully just main libc dir, e.g. /usr/include,
+		# follow symlinks from e.g. /usr/include/bits
+		cp -aL "$d"/* "$COMPILE_TEST_INC"/
+	elif ( echo "$d" | egrep "$ARCH_TRIPLET$" > /dev/null ); then
+		# hopefully the arch specific dir, e.g. /usr/include/x86_64-linux-gnu
+		cp -ar "$d"/* "$COMPILE_TEST_INC/"
+	else
+		echo "$d unexpected, bailing out"
+		exit 1
+	fi
+done
+
+# Simulate libc headers without kernel headers by removing
+# all known kernel header dirs from the copied libc ones.
+# This seems to magically work.
+_KERNEL_DIRS="$( find . -type d | grep -v '^\.$' )"
+( cd "$COMPILE_TEST_INC" && rm -rf $_KERNEL_DIRS )
+
+# GCC headers
+set +u
+if [ "$GCC_INC"foobar == "foobar" ]; then
+	# Take from $CC default system include paths, filter out
+	# /usr/local/include and /usr/include stuff first, then try to match
+	# for gcc.
+	_TEMP="$( $CC -v -x c -E - < /dev/null 2>&1 | \
+		sed -n -e '/^#include <...> search starts here:$/,/^End of search list.$/{//!p}' | \
+		sed -e 's/^\ \//\//g' | \
+		egrep -v '/usr/local/include' | \
+		egrep -v '/usr/include' | \
+		grep gcc | \
+		xargs )"
+
+	# merge and prepare for use with $CC
+	for d in $_TEMP; do
+		# sanity test
+		if [ ! -d "$d" ]; then
+			echo "$d: is not a directory"
+			exit 1
+		fi
+		GCC_INC="$GCC_INC -I $d"
+	done
+fi
+set -u
+
+# For each header file, try to compile it using the headers we prepared.
+_FAILED=0
+_PASSED=0
+for f in $( find . -name "*\.h" | xargs ); do
+	_FAIL=0
+
+	# compile test, CC not quoted to support ccache
+	echo $CC -Wall -c -nostdinc $GCC_INC -I . -I "$COMPILE_TEST_INC" -I "$COMPILE_TEST_INC/$ARCH_TRIPLET" -o /dev/null "$f"
+	$CC -Wall -c -nostdinc $GCC_INC -I . -I "$COMPILE_TEST_INC" -I "$COMPILE_TEST_INC/$ARCH_TRIPLET" -o /dev/null "$f" \
+		|| _FAIL=1
+
+	# report errors
+	if [ "$_FAIL" -gt 0 ]; then
+		echo "FAILED: $f"
+		_FAILED="$(( _FAILED + 1 ))"
+	else
+		echo "PASSED: $f"
+		_PASSED="$(( _PASSED + 1))"
+	fi
+done
+
+echo Statistics:
+echo "$_FAILED files failed the compile test."
+echo "$_PASSED files passed the compile test."
+
+exit "$_FAILED"
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1467951 — [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:00 +0200
Subject[PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
Message-ID<s92BX-1yy-9@gated-at.bofh.it>
In reply to#1467924
Kernel uapi header are supposed to use them. Fixes userspace compile error:

linux/openvswitch.h:583:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/openvswitch.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index 645499a..54c3b4f 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -583,7 +583,7 @@ enum ovs_userspace_attr {
 #define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
 
 struct ovs_action_trunc {
-	uint32_t max_len; /* Max packet size in bytes. */
+	__u32 max_len; /* Max packet size in bytes. */
 };
 
 /**
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1468163 — Re: [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 01:40 +0200
SubjectRe: [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
Message-ID<s96YW-4v1-33@gated-at.bofh.it>
In reply to#1467951
From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:33:19 +0200

> Kernel uapi header are supposed to use them. Fixes userspace compile error:
> 
> linux/openvswitch.h:583:2: error: unknown type name ‘uint32_t’
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

[toc] | [prev] | [next] | [standalone]


#1467954 — [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix

FromMikko Rapeli <mikko.rapeli@iki.fi>
Date2016-08-22 21:00 +0200
Subject[PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix
Message-ID<s92BX-1yy-17@gated-at.bofh.it>
In reply to#1467924
Fixes this userspace compile error when net/route.h is included before
linux/route.h:

linux/route.h:30:8: error: redefinition of ‘struct rtentry’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/libc-compat.h | 10 ++++++++++
 include/uapi/linux/route.h       |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 07a3462..16ba7dc 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -230,6 +230,13 @@
 
 #endif /* defined(_NETROSE_ROSE_H) */
 
+/* Coordinate with glibc net/route.h */
+#if defined(_NET_ROUTE_H)
+#define __UAPI_DEF_RTENTRY		0
+#else /* defined(_NET_ROUTE_H) */
+#define __UAPI_DEF_RTENTRY		1
+#endif /* defined(_NET_ROUTE_H) */
+
 /* Coordinate with glibc pty.h */
 #if defined(_PTY_H)
 #define __UAPI_DEF_TERMIOS	0
@@ -369,6 +376,9 @@
 #define __UAPI_DEF_ROSE_CAUSE_STRUCT			1
 #define __UAPI_DEF_ROSE_FACILITIES_STRUCT		1
 
+/* Definitions for route.h */
+#define __UAPI_DEF_RTENTRY		1
+
 /* Definitions for time.h */
 #define __UAPI_DEF_TIMESPEC			1
 #define __UAPI_DEF_TIMEVAL			1
diff --git a/include/uapi/linux/route.h b/include/uapi/linux/route.h
index 6600708..7b77ef2 100644
--- a/include/uapi/linux/route.h
+++ b/include/uapi/linux/route.h
@@ -23,10 +23,12 @@
 #ifndef _LINUX_ROUTE_H
 #define _LINUX_ROUTE_H
 
+#include <linux/libc-compat.h>
 #include <linux/if.h>
 #include <linux/compiler.h>
 
 /* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
+#if __UAPI_DEF_RTENTRY
 struct rtentry {
 	unsigned long	rt_pad1;
 	struct sockaddr	rt_dst;		/* target address		*/
@@ -45,7 +47,7 @@ struct rtentry {
 	unsigned long	rt_window;	/* Window clamping 		*/
 	unsigned short	rt_irtt;	/* Initial RTT			*/
 };
-
+#endif /* __UAPI_DEF_RTENTRY */
 
 #define	RTF_UP		0x0001		/* route usable		  	*/
 #define	RTF_GATEWAY	0x0002		/* destination is a gateway	*/
-- 
2.8.1

[toc] | [prev] | [next] | [standalone]


#1468167 — Re: [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix

FromDavid Miller <davem@davemloft.net>
Date2016-08-23 01:40 +0200
SubjectRe: [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix
Message-ID<s96YW-4v1-35@gated-at.bofh.it>
In reply to#1467954
You have to post this properly to the netdev list.

If netdev is not CC:'d it doesn't get properly logged in patchwork,
and won't be applied.

[toc] | [prev] | [next] | [standalone]


Page 2 of 5 — ← Prev page 1 [2] 3 4 5  Next page →

Back to top | Article view | linux.kernel


csiph-web