All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
	Kent Gibson <warthog618@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [libgpiod][PATCH 6/6] core: add the kernel uapi header to the repository
Date: Mon, 11 Jan 2021 16:15:21 +0100	[thread overview]
Message-ID: <CAMpxmJW=6YXgPBJ3=1sBbNAOWTV4idwHz-cWv+YborZ4hLtcKA@mail.gmail.com> (raw)
In-Reply-To: <20210111144647.GY4077@smile.fi.intel.com>

On Mon, Jan 11, 2021 at 3:45 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Mon, Jan 11, 2021 at 03:06:28PM +0100, Bartosz Golaszewski wrote:
> > On Mon, Jan 11, 2021 at 2:45 PM Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> > >
> > > On Mon, Jan 11, 2021 at 3:37 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> > > >
> > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > > >
> > > > In order to avoid any problems with symbols missing from the host linux
> > > > kernel headers (for example: if current version of libgpiod supports
> > > > features that were added recently to the kernel but the host headers are
> > > > outdated and don't export required symbols) let's add the uapi header to
> > > > the repository and include it instead of the one in /usr/include/linux.
> > >
> > > I doubt this is a good decision. First of all if the host (or rather
> > > target, because host should not influence build of libgpiod) has
> >
> > I meant the host as in: the machine on which you build and which
> > contains the headers for the target as well but I see what you mean.
> >
> > > outdated header it may be for a reason (it runs old kernel).
> > > When you run new library on outdated kernel it might produce various
> > > of interesting errors (in general, I haven't investigated libgpiod
> > > case).
> > > On top of that you make a copy'n'paste source code which is against
> > > the Unix way.
> > >
> > > Sorry, but I'm in favour of dropping this one.
> > >
> >
> > Cc: Thomas
> >
> > This problem has been raised by the buildroot people when we started
> > requiring different versions of kernel headers to build v1.4 and v1.6.
> > It turns out most projects simply package the uapi headers together
> > with their sources (e.g. wpa_supplicant, libnl, iproute2) to avoid
> > complicated dependencies. It's true that now the library can fail at
> > runtime but I'm fine with that. Also: if we add new features between
> > two kernel versions, we still allow to build the new library version
> > except that these new features won't work on older kernels.
>
> I see.
>
> So known ways to solve this are
>  - provide a header with source tree (see above)
>  - modify code with ifdeffery against specific kernel versions
>  - ...something else... ?
>
> Second item is what ALSA used (not sure if they provide a standalone driver
> anymore). Ugly, but won't require header which may be staled.
>
> Any other solutions in mind?
>

I tried to go the third way and just ignore the problem but I've
received too many emails about that. :)

I don't like the ifdef hell so I prefer to bundle the header. I'm open
to other suggestions, although I can't come up with anything else.

Bart

  reply	other threads:[~2021-01-11 15:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 13:34 [libgpiod][PATCH 0/6] treewide: remove more cruft and Bartosz Golaszewski
2021-01-11 13:34 ` [libgpiod][PATCH 1/6] treewide: remove helpers for opening chips by name & number Bartosz Golaszewski
2021-01-11 13:34 ` [libgpiod][PATCH 2/6] treewide: simplify the active-low line property Bartosz Golaszewski
2021-01-11 13:34 ` [libgpiod][PATCH 3/6] treewide: rename BIAS_AS_IS to BIAS_NONE Bartosz Golaszewski
2021-01-11 14:31   ` Kent Gibson
2021-01-11 13:34 ` [libgpiod][PATCH 4/6] treewide: make drive settings an enum Bartosz Golaszewski
2021-01-11 14:39   ` Kent Gibson
2021-01-11 14:48     ` Bartosz Golaszewski
2021-01-11 13:34 ` [libgpiod][PATCH 5/6] bindings: cxx: line: reorder bias mapping entries Bartosz Golaszewski
2021-01-11 13:34 ` [libgpiod][PATCH 6/6] core: add the kernel uapi header to the repository Bartosz Golaszewski
2021-01-11 13:46   ` Andy Shevchenko
2021-01-11 14:06     ` Bartosz Golaszewski
2021-01-11 14:46       ` Andy Shevchenko
2021-01-11 15:15         ` Bartosz Golaszewski [this message]
2021-01-25  5:55           ` Kent Gibson
2021-01-25 10:54             ` Andy Shevchenko
2021-01-26 15:07             ` Bartosz Golaszewski
2021-01-26 17:11               ` Greg Kroah-Hartman
2021-01-26 19:08                 ` Bartosz Golaszewski
2021-01-27 11:43                   ` Greg Kroah-Hartman
2021-01-28  3:26                     ` Kent Gibson
2021-01-28  7:51                       ` Greg Kroah-Hartman

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='CAMpxmJW=6YXgPBJ3=1sBbNAOWTV4idwHz-cWv+YborZ4hLtcKA@mail.gmail.com' \
    --to=bgolaszewski@baylibre.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=warthog618@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.