netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Serhey Popovych <serhe.popovych@gmail.com>
Cc: netdev@vger.kernel.org, thomas.de_schampheleire@nokia.com
Subject: Re: [PATCH iproute2 1/3] ip: Fix compilation with kernel headers < 3.4
Date: Wed, 28 Feb 2018 08:07:45 -0800	[thread overview]
Message-ID: <20180228080745.73ab3f4f@xeon-e3> (raw)
In-Reply-To: <88f6c9ea-3ac1-ba78-aeb3-03d37d5a0bb1@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2102 bytes --]

On Tue, 27 Feb 2018 21:34:56 +0200
Serhey Popovych <serhe.popovych@gmail.com> wrote:

> Stephen Hemminger wrote:
> > On Tue, 27 Feb 2018 14:06:50 +0200
> > Serhey Popovych <serhe.popovych@gmail.com> wrote:
> >   
> >> 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 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.
> >>
> >> Co-Developed-by: Serhii Popovych <serhe.popovych@gmail.com>
> >> Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
> >> Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
> >> ---
> >>  Makefile                              |    5 ++++-
> >>  include/compat/kernel/linux/sysinfo.h |   14 ++++++++++++++  
> > 
> > Why not just start a single file include/compat.h which is what
> > other software does.  
> 
> 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 <compat.h> we need to include it in nearly all .c files as first
> include file.
> 
> I also start thinking on single <compat.h> and found it bit complicated
> than just adding header, (re)defining functionality and then include_next.
> 
> > 
> > Doing fine grained kernel and libc per file makes it more painful.  
> 
> Agree, and we already have <netinet/tcp.h> 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 the file
is arch specific which doesn't help.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2018-02-28 16:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 12:06 [PATCH iproute2 0/3] ip: Provide compatibility bits to build with old glibc/kernel headers Serhey Popovych
2018-02-27 12:06 ` [PATCH iproute2 1/3] ip: Fix compilation with kernel headers < 3.4 Serhey Popovych
2018-02-27 17:04   ` Stephen Hemminger
2018-02-27 19:34     ` Serhey Popovych
2018-02-28 16:07       ` Stephen Hemminger [this message]
2018-03-02  7:55         ` Serhey Popovych
2018-02-27 12:06 ` [PATCH iproute2 2/3] ss: Fix build with old libc headers without AF_VSOCK Serhey Popovych
2018-03-01  0:13   ` Stephen Hemminger
2018-03-02  7:57     ` Serhey Popovych
2018-02-27 12:06 ` [PATCH iproute2 3/3] ip: Get rid of custom netinet/tcp.h Serhey Popovych

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180228080745.73ab3f4f@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=serhe.popovych@gmail.com \
    --cc=thomas.de_schampheleire@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).