From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:40669 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069AbeBZS6N (ORCPT ); Mon, 26 Feb 2018 13:58:13 -0500 Received: by mail-pf0-f195.google.com with SMTP id m5so6886479pff.7 for ; Mon, 26 Feb 2018 10:58:13 -0800 (PST) Date: Mon, 26 Feb 2018 10:58:10 -0800 From: Stephen Hemminger To: Thomas De Schampheleire Cc: netdev@vger.kernel.org Subject: Re: [PATCH iproute2] Fix compilation with kernel headers < 3.4 Message-ID: <20180226105810.34524ce6@xeon-e3> In-Reply-To: <20180226185112.9657-1-thomas.de_schampheleire@nokia.com> References: <20180226185112.9657-1-thomas.de_schampheleire@nokia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On Mon, 26 Feb 2018 19:51:12 +0100 Thomas De Schampheleire wrote: > Since commit 596b1c94aa38e21b7a8c8562e8b61ccb744255d2, iproute2 uses types > __kernel_long_t and __kernel_ulong_t but does not provide internal > definitions for it. > > This means that compilation using kernel headers that are older than 3.4 > (where these types were added) will fail. This situation may be uncommon for > native compilation, but not uncommon for cross compilation where the > toolchains may be a bit older. > > Provide the necessary types internally if not provided by the kernel > headers to fix compilation in such cases. > > Signed-off-by: Thomas De Schampheleire > --- > include/uapi/linux/posix_types.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/include/uapi/linux/posix_types.h b/include/uapi/linux/posix_types.h > index 9a7a740b..60f3d378 100644 > --- a/include/uapi/linux/posix_types.h > +++ b/include/uapi/linux/posix_types.h > @@ -35,4 +35,13 @@ typedef int __kernel_mqd_t; > > #include > > +/* in case the kernel header asm/posix_types.h is too old (< 3.4) to provide > + * __kernel_long_t, provide it here */ > +#ifndef __kernel_long_t > +typedef long __kernel_long_t; > +#endif > +#ifndef __kernel_ulong_t > +typedef unsigned long __kernel_ulong_t; > +#endif > + > #endif /* _LINUX_POSIX_TYPES_H */ No. The headers in uapi are automatically generated from the upstream kernel headers. If there are places that need to have backwards compatibility, fix it in the main iproute2 source.