From patchwork Sun Feb 26 01:01:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dmitry V. Levin" X-Patchwork-Id: 9592103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A51A660471 for ; Sun, 26 Feb 2017 01:02:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8665328068 for ; Sun, 26 Feb 2017 01:02:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79276283F6; Sun, 26 Feb 2017 01:02:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B540228068 for ; Sun, 26 Feb 2017 01:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=T90QMip2UYoeOCWgomJK0tIKVPhR+IIc4ufGgeKv/Us=; b=HdJQvKnJyrztyd SnSRx9pcVmGRGDsldP5ULDPcDEBy+u9Uce7URpFvbOYmBPJtFbMsDHTDhhYofQufYsvmTXpw2AJHr jnQO8FwHs6SlZMZISGofgIrxaIEHyYHh7sKCjVoeiUpJY499NdPPQ6aOpjVlOK6zlUMeAkdA0OTal 5TOidnL+hTHPPlDDP1cZu5dlGm2FVDlgQwkYI1hiiSoTINWcOuuo//MeI/sa1YuL7CBZrKLpwabMU QW5Odm/ivVeXBY7ZTN+UIVSnrQwYTCg9V6wj4Bgoa+Fa7xHHfEPjtSsoDfZoFYBq9ZqjvzVtHx8jc LUhS07y3xEk38w+t7P6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1chnEJ-00014Z-Gr; Sun, 26 Feb 2017 01:02:27 +0000 Received: from vmicros1.altlinux.org ([194.107.17.57]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1chnEE-00012K-6C for linux-arm-kernel@lists.infradead.org; Sun, 26 Feb 2017 01:02:26 +0000 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 2D50072EF79; Sun, 26 Feb 2017 04:01:57 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 015847CCC18; Sun, 26 Feb 2017 04:01:56 +0300 (MSK) Date: Sun, 26 Feb 2017 04:01:56 +0300 From: "Dmitry V. Levin" To: Arnd Bergmann Subject: [PATCH] uapi: fix asm/signal.h userspace compilation errors Message-ID: <20170226010156.GA28831@altlinux.org> Mime-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170225_170222_709756_E59C1CC8 X-CRM114-Status: GOOD ( 10.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-xtensa@linux-xtensa.org, Benjamin Herrenschmidt , Heiko Carstens , "James E.J. Bottomley" , David Howells , Max Filippov , Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, Hans-Christian Egtvedt , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Jesper Nilsson , linux-am33-list@redhat.com, Yoshinori Sato , Michael Ellerman , Helge Deller , x86@kernel.org, Russell King , Ingo Molnar , Geert Uytterhoeven , Haavard Skinnemoen , uclinux-h8-devel@lists.sourceforge.jp, Fenghua Yu , Mikael Starvik , linux-m68k@lists.linux-m68k.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Chris Zankel , Tony Luck , linux-parisc@vger.kernel.org, linux-cris-kernel@axis.com, linux-kernel@vger.kernel.org, Ralf Baechle , linux-alpha@vger.kernel.org, Martin Schwidefsky , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Include (guarded by #ifndef __KERNEL__) to fix asm/signal.h userspace compilation errors like this: /usr/include/asm/signal.h:126:2: error: unknown type name 'size_t' size_t ss_size; As no uapi header provides a definition of size_t, inclusion of seems to be the most conservative fix available. On the kernel side size_t is typedef'ed to __kernel_size_t, so an alternative fix would be to change the type of sigaltstack.ss_size from size_t to __kernel_size_t for all architectures except those where sizeof(size_t) < sizeof(__kernel_size_t), namely, x32 and mips n32. On x32 and mips n32, however, #include seems to be the most straightforward way to obtain the definition for sigaltstack.ss_size's type. Signed-off-by: Dmitry V. Levin --- include/uapi/asm-generic/signal.h | 3 +++ arch/alpha/include/uapi/asm/signal.h | 3 +++ arch/arm/include/uapi/asm/signal.h | 3 +++ arch/avr32/include/uapi/asm/signal.h | 3 +++ arch/cris/include/uapi/asm/signal.h | 3 +++ arch/h8300/include/uapi/asm/signal.h | 3 +++ arch/ia64/include/uapi/asm/signal.h | 4 ++++ arch/m32r/include/uapi/asm/signal.h | 3 +++ arch/m68k/include/uapi/asm/signal.h | 3 +++ arch/mips/include/uapi/asm/signal.h | 3 +++ arch/mn10300/include/uapi/asm/signal.h | 3 +++ arch/parisc/include/uapi/asm/signal.h | 4 ++++ arch/powerpc/include/uapi/asm/signal.h | 3 +++ arch/s390/include/uapi/asm/signal.h | 3 +++ arch/sparc/include/uapi/asm/signal.h | 3 +++ arch/x86/include/uapi/asm/signal.h | 3 +++ arch/xtensa/include/uapi/asm/signal.h | 2 ++ 17 files changed, 52 insertions(+) diff --git a/include/uapi/asm-generic/signal.h b/include/uapi/asm-generic/signal.h index 3094618..e618eab 100644 --- a/include/uapi/asm-generic/signal.h +++ b/include/uapi/asm-generic/signal.h @@ -100,6 +100,9 @@ typedef unsigned long old_sigset_t; #endif #ifndef __KERNEL__ + +#include /* For size_t. */ + struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; diff --git a/arch/alpha/include/uapi/asm/signal.h b/arch/alpha/include/uapi/asm/signal.h index dd4ca4bc..74e09f6 100644 --- a/arch/alpha/include/uapi/asm/signal.h +++ b/arch/alpha/include/uapi/asm/signal.h @@ -94,6 +94,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/arm/include/uapi/asm/signal.h b/arch/arm/include/uapi/asm/signal.h index 33073bd..a7b0012 100644 --- a/arch/arm/include/uapi/asm/signal.h +++ b/arch/arm/include/uapi/asm/signal.h @@ -93,6 +93,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/avr32/include/uapi/asm/signal.h b/arch/avr32/include/uapi/asm/signal.h index ffe8c77..62f3b88 100644 --- a/arch/avr32/include/uapi/asm/signal.h +++ b/arch/avr32/include/uapi/asm/signal.h @@ -95,6 +95,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/cris/include/uapi/asm/signal.h b/arch/cris/include/uapi/asm/signal.h index ce42fa7..bedff78 100644 --- a/arch/cris/include/uapi/asm/signal.h +++ b/arch/cris/include/uapi/asm/signal.h @@ -89,6 +89,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/h8300/include/uapi/asm/signal.h b/arch/h8300/include/uapi/asm/signal.h index af3a6c3..361e2e5 100644 --- a/arch/h8300/include/uapi/asm/signal.h +++ b/arch/h8300/include/uapi/asm/signal.h @@ -88,6 +88,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/ia64/include/uapi/asm/signal.h b/arch/ia64/include/uapi/asm/signal.h index c0ea285..b089bfc 100644 --- a/arch/ia64/include/uapi/asm/signal.h +++ b/arch/ia64/include/uapi/asm/signal.h @@ -107,6 +107,10 @@ # include +# ifndef __KERNEL__ +# include /* For size_t. */ +# endif + /* Avoid too many header ordering problems. */ struct siginfo; diff --git a/arch/m32r/include/uapi/asm/signal.h b/arch/m32r/include/uapi/asm/signal.h index 54acacb..269ec39 100644 --- a/arch/m32r/include/uapi/asm/signal.h +++ b/arch/m32r/include/uapi/asm/signal.h @@ -90,6 +90,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/m68k/include/uapi/asm/signal.h b/arch/m68k/include/uapi/asm/signal.h index cba6f85..f6a409e 100644 --- a/arch/m68k/include/uapi/asm/signal.h +++ b/arch/m68k/include/uapi/asm/signal.h @@ -86,6 +86,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/mips/include/uapi/asm/signal.h b/arch/mips/include/uapi/asm/signal.h index addb9f5..744fd71 100644 --- a/arch/mips/include/uapi/asm/signal.h +++ b/arch/mips/include/uapi/asm/signal.h @@ -101,6 +101,9 @@ typedef unsigned long old_sigset_t; /* at least 32 bits */ #include #ifndef __KERNEL__ + +#include /* For size_t. */ + struct sigaction { unsigned int sa_flags; __sighandler_t sa_handler; diff --git a/arch/mn10300/include/uapi/asm/signal.h b/arch/mn10300/include/uapi/asm/signal.h index f423a08..2e79c71 100644 --- a/arch/mn10300/include/uapi/asm/signal.h +++ b/arch/mn10300/include/uapi/asm/signal.h @@ -98,6 +98,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/parisc/include/uapi/asm/signal.h b/arch/parisc/include/uapi/asm/signal.h index e26043b..6c6c979 100644 --- a/arch/parisc/include/uapi/asm/signal.h +++ b/arch/parisc/include/uapi/asm/signal.h @@ -81,6 +81,10 @@ # include +# ifndef __KERNEL__ +# include /* For size_t. */ +# endif + /* Avoid too many header ordering problems. */ struct siginfo; diff --git a/arch/powerpc/include/uapi/asm/signal.h b/arch/powerpc/include/uapi/asm/signal.h index 6c69ee9..fba7738 100644 --- a/arch/powerpc/include/uapi/asm/signal.h +++ b/arch/powerpc/include/uapi/asm/signal.h @@ -91,6 +91,9 @@ typedef struct { #include #ifndef __KERNEL__ + +#include /* For size_t. */ + struct old_sigaction { __sighandler_t sa_handler; old_sigset_t sa_mask; diff --git a/arch/s390/include/uapi/asm/signal.h b/arch/s390/include/uapi/asm/signal.h index 2f43cfb..306373b6a 100644 --- a/arch/s390/include/uapi/asm/signal.h +++ b/arch/s390/include/uapi/asm/signal.h @@ -96,6 +96,9 @@ typedef unsigned long sigset_t; #include #ifndef __KERNEL__ + +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { diff --git a/arch/sparc/include/uapi/asm/signal.h b/arch/sparc/include/uapi/asm/signal.h index f387400..3b4664c 100644 --- a/arch/sparc/include/uapi/asm/signal.h +++ b/arch/sparc/include/uapi/asm/signal.h @@ -154,6 +154,9 @@ struct sigstack { #include #ifndef __KERNEL__ + +#include /* For size_t. */ + struct __new_sigaction { __sighandler_t sa_handler; unsigned long sa_flags; diff --git a/arch/x86/include/uapi/asm/signal.h b/arch/x86/include/uapi/asm/signal.h index 8264f47..2d6db1d 100644 --- a/arch/x86/include/uapi/asm/signal.h +++ b/arch/x86/include/uapi/asm/signal.h @@ -96,6 +96,9 @@ typedef unsigned long sigset_t; # ifndef __KERNEL__ + +# include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ #ifdef __i386__ diff --git a/arch/xtensa/include/uapi/asm/signal.h b/arch/xtensa/include/uapi/asm/signal.h index 586756e..bbc9b14 100644 --- a/arch/xtensa/include/uapi/asm/signal.h +++ b/arch/xtensa/include/uapi/asm/signal.h @@ -106,6 +106,8 @@ typedef struct { #ifndef __KERNEL__ +#include /* For size_t. */ + /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction {