Re: [PATCH] libgpiod: Fix build failure with musl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 10, 2021 at 11:58 AM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> On 10-12-21, 09:08, Viresh Kumar wrote:
> > On 09-12-21, 19:32, Bartosz Golaszewski wrote:
> > > On Thu, Dec 9, 2021 at 4:17 PM Andy Shevchenko
> > > <andy.shevchenko@xxxxxxxxx> wrote:
> > > >
> > > > On Thu, Dec 9, 2021 at 5:15 PM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> > > > >
> > > > > Musl defines the _IO*() macros in the files included via <sys/ioctl.h>
> > > > > and hence we get redefinition errors during build as <linux/ioctl.h>,
> > > > > included via <uapi/gpio.h>, defines them again.
> > > > >
> > > > > Fix this by undefining the macros between both the includes, document it
> > > > > all in musl-compat.h as well.
> > > >
> > > > Is it only me who wonders why it should be fixed here?
> > > >
> > > > --
> > > > With Best Regards,
> > > > Andy Shevchenko
> > >
> > > No, I'm wondering the same. I see these musl compat issues being
> > > "fixed" in half the embedded linux projects. Looks to me musl
> > > introduces these issues, doesn't it? Any reason for it? Can it be
> > > fixed in the library?
> >
> > Not sure if I can go fix musl here :)
> >
> > Btw, another thing that will work better is if we do this:
> >
> > diff --git a/include/uapi/linux/gpio.h b/include/uapi/linux/gpio.h
> > index eaaea3d8e6b4..ebf6b5312cc0 100644
> > --- a/include/uapi/linux/gpio.h
> > +++ b/include/uapi/linux/gpio.h
> > @@ -12,8 +12,8 @@
> >  #define _UAPI_GPIO_H_
> >
> >  #include <linux/const.h>
> > -#include <linux/ioctl.h>
> >  #include <linux/types.h>
> > +#include <sys/ioctl.h>
> >
> >  /*
> >   * The maximum size of name and label arrays.
> >
> >
> >
> > That will fix it properly as well, no undef issues on any library
> > then. Some of the files in uapi already do this.
>
> This got fixed somehow after I played a bit with the toolchain for
> musl. Abandoning this change for now.
>

Good, because the commit that introduces this <sys/ioctl.h> include in
some uapi headers looks like this:

commit 607ca46e97a1b6594b29647d98a32d545c24bdff
Author: David Howells <dhowells@xxxxxxxxxx>
Date:   Sat Oct 13 10:46:48 2012 +0100

    UAPI: (Scripted) Disintegrate include/linux

    Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
    Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
    Acked-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
    Acked-by: Michael Kerrisk <mtk.manpages@xxxxxxxxx>
    Acked-by: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
    Acked-by: Dave Jones <davej@xxxxxxxxxx>

and is 68737 lines long.

No idea what the author meant honestly and why this was acked as it
is. I can't find any discussion on that anymore.

Bart



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux