From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f65.google.com ([209.85.160.65]:37471 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752783AbeB1QHs (ORCPT ); Wed, 28 Feb 2018 11:07:48 -0500 Received: by mail-pl0-f65.google.com with SMTP id ay8-v6so1767721plb.4 for ; Wed, 28 Feb 2018 08:07:48 -0800 (PST) Date: Wed, 28 Feb 2018 08:07:45 -0800 From: Stephen Hemminger To: Serhey Popovych Cc: netdev@vger.kernel.org, thomas.de_schampheleire@nokia.com Subject: Re: [PATCH iproute2 1/3] ip: Fix compilation with kernel headers < 3.4 Message-ID: <20180228080745.73ab3f4f@xeon-e3> In-Reply-To: <88f6c9ea-3ac1-ba78-aeb3-03d37d5a0bb1@gmail.com> References: <1519733212-30703-1-git-send-email-serhe.popovych@gmail.com> <1519733212-30703-2-git-send-email-serhe.popovych@gmail.com> <20180227090412.3de0f95e@xeon-e3> <88f6c9ea-3ac1-ba78-aeb3-03d37d5a0bb1@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_//qj3w/ll9glR=AUhLejxAyM"; protocol="application/pgp-signature" Sender: netdev-owner@vger.kernel.org List-ID: --Sig_//qj3w/ll9glR=AUhLejxAyM Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 27 Feb 2018 21:34:56 +0200 Serhey Popovych wrote: > Stephen Hemminger wrote: > > On Tue, 27 Feb 2018 14:06:50 +0200 > > Serhey Popovych wrote: > > =20 > >> Since commit 596b1c94aa38 ("iproute: build more easily on Android"), > >> 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 uncomm= on > >> for native compilation, but not uncommon for cross compilation where t= he > >> toolchains may be a bit older. > >> > >> Provide the necessary types internally if not provided by the kernel > >> headers to fix compilation in such cases. > >> > >> Co-Developed-by: Serhii Popovych > >> Signed-off-by: Thomas De Schampheleire > >> Signed-off-by: Serhey Popovych > >> --- > >> Makefile | 5 ++++- > >> include/compat/kernel/linux/sysinfo.h | 14 ++++++++++++++ =20 > >=20 > > Why not just start a single file include/compat.h which is what > > other software does. =20 >=20 > Yes it is good, but not for our case. We use include_next to define > __kernel_long_t and __kernel_ulong_t types if they not defined. If doing > single we need to include it in nearly all .c files as first > include file. >=20 > I also start thinking on single and found it bit complicated > than just adding header, (re)defining functionality and then include_next. >=20 > >=20 > > Doing fine grained kernel and libc per file makes it more painful. =20 >=20 > Agree, and we already have done using similar schema > that is reverted with this series. This is a real rats nest. It all comes because kernel headers are including= asm/posix_types.h. Normally, I would just clone that file out of kernel headers process, but t= he file is arch specific which doesn't help. --Sig_//qj3w/ll9glR=AUhLejxAyM Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEn2/DRbBb5+dmuDyPgKd/YJXN5H4FAlqW09EACgkQgKd/YJXN 5H5v7xAAtChlEtZVUm1rekLDzGWq7KYoiVdCdJYr+ViNVVQtBnPWtdfl8qYfNNkp JmOGMEltWjRDvB+N5QNbExncdRrtn7pvgldhXDxMnJ0yO+V1Z+B87ecsinnJJG7S mYT8qhbZ7vSaqhcVAZCdYJS5ou7OvW2MT+Nhp0ESNC7zHFxz9w7kr5EH/2ZptN3H 9kxRvRUeLX800fD5gzAjFiyMfzNpmE2B8qVqk4bPTmu/d6AVdFoUGLZpjC3piaYf OMDh6lGUonOy4zC5hwPDLlSTMCXtejhlwqVYO70crAcrYmJbBIp3b0aUQ0PFXD6K upE6ymx6683UvqABnAqLTAQ1k5ZXpJLlLQBtzyBBq1pljO9f9IbZqkGRFOTpBnIS XA1DFkZMeNBg1URUrg3q4huE3gyWE7gYTVgRn+OAiMtV2OyZ3ubu75Ziuoxbme0B 9cVRhZW3ElzbbVMhdnqo/dwFel9Dtu/AumllNKvk1cQl4TrZNuSeouW5VAwsrFFT 75Mqz5eoORfrjnCfCwDA/QXrC1jK8gxlCdd7b18dSOvL9+5sW/BKnT6xU1Y3zG2Q 4BR1LoR4ZMbTeQs9JkzGtjchbDf3eI/2Xv91QSRLfRqOGQpuOBHZhONlnvWC+qut mKJ1AsPpO3Sjk1sAFlH44S0WaKlK3JIErwchKwLVFI58vCtOvSQ= =BvX5 -----END PGP SIGNATURE----- --Sig_//qj3w/ll9glR=AUhLejxAyM--