All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Kent Gibson <warthog618@gmail.com>,
	Arnd Bergmann <arnd@kernel.org>
Subject: Re: [PATCH] libgpiod: Fix build failure with musl
Date: Fri, 10 Dec 2021 16:28:18 +0530	[thread overview]
Message-ID: <20211210105818.tsbzahtcs5nlxqkr@vireshk-i7> (raw)
In-Reply-To: <20211210033842.j4h5glg34prjn4ha@vireshk-i7>

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@gmail.com> wrote:
> > >
> > > On Thu, Dec 9, 2021 at 5:15 PM Viresh Kumar <viresh.kumar@linaro.org> 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.

-- 
viresh

  reply	other threads:[~2021-12-10 10:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 10:58 [PATCH] libgpiod: Fix build failure with musl Viresh Kumar
2021-12-09 11:59 ` Viresh Kumar
2021-12-09 15:16 ` Andy Shevchenko
2021-12-09 18:32   ` Bartosz Golaszewski
2021-12-10  3:38     ` Viresh Kumar
2021-12-10 10:58       ` Viresh Kumar [this message]
2021-12-10 13:34         ` Bartosz Golaszewski

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=20211210105818.tsbzahtcs5nlxqkr@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=vincent.guittot@linaro.org \
    --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.