Re: [musl] [PATCH 1/1] uapi: Don't include in

2020-10-01 Thread Petr Vorel
Hi,

> On Thu, Oct 01, 2020 at 10:27:03PM +0200, Petr Vorel wrote:
> > Hi Rich,

> > > On Thu, Oct 01, 2020 at 09:52:31PM +0200, Petr Vorel wrote:
> > > > + update code where needed (include  in code which
> > > > included  only to get struct sysinfo or SI_LOAD_SHIFT).

> > > > The reason is to avoid indirect  include when using
> > > > some network headers:  or others [1] ->
> > > >  -> .

> > > > This indirect include causes redefinition of struct sysinfo when
> > > > included both  and some of network headers:

> > > > In file included from 
> > > > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5,
> > > >  from 
> > > > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5,
> > > >  from ../include/tst_netlink.h:14,
> > > >  from tst_crypto.c:13:
> > > > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: 
> > > > error: redefinition of ‘struct sysinfo’
> > > >  struct sysinfo {
> > > > ^~~
> > > > In file included from ../include/tst_safe_macros.h:15,
> > > >  from ../include/tst_test.h:93,
> > > >  from tst_crypto.c:11:
> > > > x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: 
> > > > note: originally defined here

> > > > [1] or , , , 
> > > > 

> > > > Suggested-by: Rich Felker 
> > > > Signed-off-by: Petr Vorel 
> > > > ---
> > > > Hi,

> > > > this looks to be long standing problem: python-psutil [2], iproute2 [3],
> > > > even for glibc in the past [4] and it tried to be solved before [5].

> > > > This will require glibc fix after:

> > > You can't do this; it breaks the existing contract with glibc. New
> > > kernel headers can't force a glibc upgrade.
> > Right, got that.

> > > You just have to get rid
> > > of use of  elsewhere in the uapi headers. It was a
> > > mistake that  was ever separated out of
> > >  since it didn't (and couldn't) fix the contract that
> > >  exposes struct sysinfo (and that it's misnamed). But
> > > it's no big deal. This can all be fixed without any breakage anywhere
> > > just by not using it.
> > Back to your original suggestion to move the alignment macros to a separate
> > header. I was trying to avoid it not sure if introducing new header is
> > acceptable, but we'll see.

> Isn't there already another similar header with that type of macro
> that they belong in?
The only one I've found is const.h. Not sure it'd be better to move things
there.

Kind regards,
Petr

> Rich


Re: [musl] [PATCH 1/1] uapi: Don't include in

2020-10-01 Thread Rich Felker
On Thu, Oct 01, 2020 at 10:27:03PM +0200, Petr Vorel wrote:
> Hi Rich,
> 
> > On Thu, Oct 01, 2020 at 09:52:31PM +0200, Petr Vorel wrote:
> > > + update code where needed (include  in code which
> > > included  only to get struct sysinfo or SI_LOAD_SHIFT).
> 
> > > The reason is to avoid indirect  include when using
> > > some network headers:  or others [1] ->
> > >  -> .
> 
> > > This indirect include causes redefinition of struct sysinfo when
> > > included both  and some of network headers:
> 
> > > In file included from 
> > > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5,
> > >  from 
> > > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5,
> > >  from ../include/tst_netlink.h:14,
> > >  from tst_crypto.c:13:
> > > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: 
> > > error: redefinition of ‘struct sysinfo’
> > >  struct sysinfo {
> > > ^~~
> > > In file included from ../include/tst_safe_macros.h:15,
> > >  from ../include/tst_test.h:93,
> > >  from tst_crypto.c:11:
> > > x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: 
> > > originally defined here
> 
> > > [1] or , , , 
> > > 
> 
> > > Suggested-by: Rich Felker 
> > > Signed-off-by: Petr Vorel 
> > > ---
> > > Hi,
> 
> > > this looks to be long standing problem: python-psutil [2], iproute2 [3],
> > > even for glibc in the past [4] and it tried to be solved before [5].
> 
> > > This will require glibc fix after:
> 
> > You can't do this; it breaks the existing contract with glibc. New
> > kernel headers can't force a glibc upgrade.
> Right, got that.
> 
> > You just have to get rid
> > of use of  elsewhere in the uapi headers. It was a
> > mistake that  was ever separated out of
> >  since it didn't (and couldn't) fix the contract that
> >  exposes struct sysinfo (and that it's misnamed). But
> > it's no big deal. This can all be fixed without any breakage anywhere
> > just by not using it.
> Back to your original suggestion to move the alignment macros to a separate
> header. I was trying to avoid it not sure if introducing new header is
> acceptable, but we'll see.

Isn't there already another similar header with that type of macro
that they belong in?

Rich


Re: [musl] [PATCH 1/1] uapi: Don't include in

2020-10-01 Thread Petr Vorel
Hi Rich,

> On Thu, Oct 01, 2020 at 09:52:31PM +0200, Petr Vorel wrote:
> > + update code where needed (include  in code which
> > included  only to get struct sysinfo or SI_LOAD_SHIFT).

> > The reason is to avoid indirect  include when using
> > some network headers:  or others [1] ->
> >  -> .

> > This indirect include causes redefinition of struct sysinfo when
> > included both  and some of network headers:

> > In file included from 
> > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5,
> >  from 
> > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5,
> >  from ../include/tst_netlink.h:14,
> >  from tst_crypto.c:13:
> > x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: error: 
> > redefinition of ‘struct sysinfo’
> >  struct sysinfo {
> > ^~~
> > In file included from ../include/tst_safe_macros.h:15,
> >  from ../include/tst_test.h:93,
> >  from tst_crypto.c:11:
> > x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: 
> > originally defined here

> > [1] or , , , 
> > 

> > Suggested-by: Rich Felker 
> > Signed-off-by: Petr Vorel 
> > ---
> > Hi,

> > this looks to be long standing problem: python-psutil [2], iproute2 [3],
> > even for glibc in the past [4] and it tried to be solved before [5].

> > This will require glibc fix after:

> You can't do this; it breaks the existing contract with glibc. New
> kernel headers can't force a glibc upgrade.
Right, got that.

> You just have to get rid
> of use of  elsewhere in the uapi headers. It was a
> mistake that  was ever separated out of
>  since it didn't (and couldn't) fix the contract that
>  exposes struct sysinfo (and that it's misnamed). But
> it's no big deal. This can all be fixed without any breakage anywhere
> just by not using it.
Back to your original suggestion to move the alignment macros to a separate
header. I was trying to avoid it not sure if introducing new header is
acceptable, but we'll see.

> Rich

Kind regards,
Petr


Re: [musl] [PATCH 1/1] uapi: Don't include in

2020-10-01 Thread Rich Felker
On Thu, Oct 01, 2020 at 09:52:31PM +0200, Petr Vorel wrote:
> + update code where needed (include  in code which
> included  only to get struct sysinfo or SI_LOAD_SHIFT).
> 
> The reason is to avoid indirect  include when using
> some network headers:  or others [1] ->
>  -> .
> 
> This indirect include causes redefinition of struct sysinfo when
> included both  and some of network headers:
> 
> In file included from 
> x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5,
>  from 
> x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5,
>  from ../include/tst_netlink.h:14,
>  from tst_crypto.c:13:
> x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: error: 
> redefinition of ‘struct sysinfo’
>  struct sysinfo {
> ^~~
> In file included from ../include/tst_safe_macros.h:15,
>  from ../include/tst_test.h:93,
>  from tst_crypto.c:11:
> x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: 
> originally defined here
> 
> [1] or , , , 
> 
> 
> Suggested-by: Rich Felker 
> Signed-off-by: Petr Vorel 
> ---
> Hi,
> 
> this looks to be long standing problem: python-psutil [2], iproute2 [3],
> even for glibc in the past [4] and it tried to be solved before [5].
> 
> This will require glibc fix after:

You can't do this; it breaks the existing contract with glibc. New
kernel headers can't force a glibc upgrade. You just have to get rid
of use of  elsewhere in the uapi headers. It was a
mistake that  was ever separated out of
 since it didn't (and couldn't) fix the contract that
 exposes struct sysinfo (and that it's misnamed). But
it's no big deal. This can all be fixed without any breakage anywhere
just by not using it.

Rich