linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
@ 2019-02-21 14:42 Guenter Roeck
  2019-02-21 15:54 ` Masahiro Yamada
  0 siblings, 1 reply; 8+ messages in thread
From: Guenter Roeck @ 2019-02-21 14:42 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: David S. Miller, Alexei Starovoitov, Daniel Borkmann, netdev,
	linux-kernel

On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote:
> Currently, the header search paths -Itools/include and
> -Itools/include/uapi are not used. Let's drop the unused code.
> 
> We can remove -I. too by fixing up one C file.
> 

This patch reintroduces the problem last fixed with commit ae40832e53c3
("bpfilter: fix a build err"). Seen (at least) with gcc 7.4.0, 8.2.0.
binutils version is 2.31.1. Reverting this patch fixes the problem.

Guenter

> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  net/bpfilter/Makefile | 1 -
>  net/bpfilter/main.c   | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
> index 0947ee7f70d5..5d6c7760142d 100644
> --- a/net/bpfilter/Makefile
> +++ b/net/bpfilter/Makefile
> @@ -5,7 +5,6 @@
>  
>  hostprogs-y := bpfilter_umh
>  bpfilter_umh-objs := main.o
> -KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi
>  HOSTCC := $(CC)
>  
>  ifeq ($(CONFIG_BPFILTER_UMH), y)
> diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
> index 1317f108df8a..61ce8454a88e 100644
> --- a/net/bpfilter/main.c
> +++ b/net/bpfilter/main.c
> @@ -6,7 +6,7 @@
>  #include <sys/socket.h>
>  #include <fcntl.h>
>  #include <unistd.h>
> -#include "include/uapi/linux/bpf.h"
> +#include "../../include/uapi/linux/bpf.h"
>  #include <asm/unistd.h>
>  #include "msgfmt.h"
>  
> -- 
> 2.7.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
  2019-02-21 14:42 [PATCH] bpfilter: remove extra header search paths for bpfilter_umh Guenter Roeck
@ 2019-02-21 15:54 ` Masahiro Yamada
  2019-02-21 18:05   ` Guenter Roeck
  2019-02-21 19:00   ` David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Masahiro Yamada @ 2019-02-21 15:54 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: David S. Miller, Alexei Starovoitov, Daniel Borkmann, Networking,
	Linux Kernel Mailing List

On Thu, Feb 21, 2019 at 11:46 PM Guenter Roeck <linux@roeck-us.net> wrote:
>
> On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote:
> > Currently, the header search paths -Itools/include and
> > -Itools/include/uapi are not used. Let's drop the unused code.
> >
> > We can remove -I. too by fixing up one C file.
> >
>
> This patch reintroduces the problem last fixed with commit ae40832e53c3
> ("bpfilter: fix a build err"). Seen (at least) with gcc 7.4.0, 8.2.0.
> binutils version is 2.31.1. Reverting this patch fixes the problem.


Hmm. I cannot reproduce the build error with my gcc,
but you are right.


I'd like to get back only
'KBUILD_HOSTCFLAGS += -Itools/include/ -Itools/include/uapi'
instead of the full revert.

If David is fine with it, I can send a patch with filling commit log.



Thanks.



> Guenter
>
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > ---
> >  net/bpfilter/Makefile | 1 -
> >  net/bpfilter/main.c   | 2 +-
> >  2 files changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
> > index 0947ee7f70d5..5d6c7760142d 100644
> > --- a/net/bpfilter/Makefile
> > +++ b/net/bpfilter/Makefile
> > @@ -5,7 +5,6 @@
> >
> >  hostprogs-y := bpfilter_umh
> >  bpfilter_umh-objs := main.o
> > -KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi
> >  HOSTCC := $(CC)
> >
> >  ifeq ($(CONFIG_BPFILTER_UMH), y)
> > diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
> > index 1317f108df8a..61ce8454a88e 100644
> > --- a/net/bpfilter/main.c
> > +++ b/net/bpfilter/main.c
> > @@ -6,7 +6,7 @@
> >  #include <sys/socket.h>
> >  #include <fcntl.h>
> >  #include <unistd.h>
> > -#include "include/uapi/linux/bpf.h"
> > +#include "../../include/uapi/linux/bpf.h"
> >  #include <asm/unistd.h>
> >  #include "msgfmt.h"
> >
> > --
> > 2.7.4



--
Best Regards

Masahiro Yamada

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
  2019-02-21 15:54 ` Masahiro Yamada
@ 2019-02-21 18:05   ` Guenter Roeck
  2019-02-21 19:00   ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2019-02-21 18:05 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: David S. Miller, Alexei Starovoitov, Daniel Borkmann, Networking,
	Linux Kernel Mailing List

On Fri, Feb 22, 2019 at 12:54:47AM +0900, Masahiro Yamada wrote:
> On Thu, Feb 21, 2019 at 11:46 PM Guenter Roeck <linux@roeck-us.net> wrote:
> >
> > On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote:
> > > Currently, the header search paths -Itools/include and
> > > -Itools/include/uapi are not used. Let's drop the unused code.
> > >
> > > We can remove -I. too by fixing up one C file.
> > >
> >
> > This patch reintroduces the problem last fixed with commit ae40832e53c3
> > ("bpfilter: fix a build err"). Seen (at least) with gcc 7.4.0, 8.2.0.
> > binutils version is 2.31.1. Reverting this patch fixes the problem.
> 
> 
> Hmm. I cannot reproduce the build error with my gcc,
> but you are right.
> 
Maybe it has less to do with the gcc version and more with how the
toolchain is built. I see the problem with toolchains generated
using buildroot.

> 
> I'd like to get back only
> 'KBUILD_HOSTCFLAGS += -Itools/include/ -Itools/include/uapi'
> instead of the full revert.
> 

That doesn't work for me. I need

KBUILD_HOSTCFLAGS += -I. -Itools/include/uapi

Just don't ask me why.

Guenter
 
> If David is fine with it, I can send a patch with filling commit log.
> 
> 
> 
> Thanks.
> 
> 
> 
> > Guenter
> >
> > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > Signed-off-by: David S. Miller <davem@davemloft.net>
> > > ---
> > >  net/bpfilter/Makefile | 1 -
> > >  net/bpfilter/main.c   | 2 +-
> > >  2 files changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
> > > index 0947ee7f70d5..5d6c7760142d 100644
> > > --- a/net/bpfilter/Makefile
> > > +++ b/net/bpfilter/Makefile
> > > @@ -5,7 +5,6 @@
> > >
> > >  hostprogs-y := bpfilter_umh
> > >  bpfilter_umh-objs := main.o
> > > -KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi
> > >  HOSTCC := $(CC)
> > >
> > >  ifeq ($(CONFIG_BPFILTER_UMH), y)
> > > diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
> > > index 1317f108df8a..61ce8454a88e 100644
> > > --- a/net/bpfilter/main.c
> > > +++ b/net/bpfilter/main.c
> > > @@ -6,7 +6,7 @@
> > >  #include <sys/socket.h>
> > >  #include <fcntl.h>
> > >  #include <unistd.h>
> > > -#include "include/uapi/linux/bpf.h"
> > > +#include "../../include/uapi/linux/bpf.h"
> > >  #include <asm/unistd.h>
> > >  #include "msgfmt.h"
> > >
> > > --
> > > 2.7.4
> 
> 
> 
> --
> Best Regards
> 
> Masahiro Yamada

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
  2019-02-21 15:54 ` Masahiro Yamada
  2019-02-21 18:05   ` Guenter Roeck
@ 2019-02-21 19:00   ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2019-02-21 19:00 UTC (permalink / raw)
  To: yamada.masahiro; +Cc: linux, ast, daniel, netdev, linux-kernel

From: Masahiro Yamada <yamada.masahiro@socionext.com>
Date: Fri, 22 Feb 2019 00:54:47 +0900

> On Thu, Feb 21, 2019 at 11:46 PM Guenter Roeck <linux@roeck-us.net> wrote:
>>
>> On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote:
>> > Currently, the header search paths -Itools/include and
>> > -Itools/include/uapi are not used. Let's drop the unused code.
>> >
>> > We can remove -I. too by fixing up one C file.
>> >
>>
>> This patch reintroduces the problem last fixed with commit ae40832e53c3
>> ("bpfilter: fix a build err"). Seen (at least) with gcc 7.4.0, 8.2.0.
>> binutils version is 2.31.1. Reverting this patch fixes the problem.
> 
> 
> Hmm. I cannot reproduce the build error with my gcc,
> but you are right.
> 
> 
> I'd like to get back only
> 'KBUILD_HOSTCFLAGS += -Itools/include/ -Itools/include/uapi'
> instead of the full revert.
> 
> If David is fine with it, I can send a patch with filling commit log.

If that really fixes the build regression, sure.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
  2019-01-31  3:15 Masahiro Yamada
  2019-02-01 23:59 ` Alexei Starovoitov
@ 2019-02-04  4:13 ` David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2019-02-04  4:13 UTC (permalink / raw)
  To: yamada.masahiro
  Cc: ast, daniel, netdev, mcroce, linux-kernel, jakub.kicinski,
	labbott, ast, yuehaibing

From: Masahiro Yamada <yamada.masahiro@socionext.com>
Date: Thu, 31 Jan 2019 12:15:35 +0900

> Currently, the header search paths -Itools/include and
> -Itools/include/uapi are not used. Let's drop the unused code.
> 
> We can remove -I. too by fixing up one C file.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

I guess I'm ok with this, applied to net-next.

Thanks for explaining things.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
  2019-02-01 23:59 ` Alexei Starovoitov
@ 2019-02-02 13:40   ` Masahiro Yamada
  0 siblings, 0 replies; 8+ messages in thread
From: Masahiro Yamada @ 2019-02-02 13:40 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: Daniel Borkmann, Networking, Matteo Croce, David S. Miller,
	Linux Kernel Mailing List, Jakub Kicinski, Laura Abbott,
	YueHaibing

On Sat, Feb 2, 2019 at 9:00 AM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote:
> > Currently, the header search paths -Itools/include and
> > -Itools/include/uapi are not used. Let's drop the unused code.
> >
> > We can remove -I. too by fixing up one C file.
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> > Perhaps, are these extra header search paths for
> > more upstreaming in the future?
> >
> > If this patch is rejected, I will send an alternative one.
> >
> > To clean up the Kbuild core,
> > I want to drop as many unused header search paths as possible.
> >
> >
> >  net/bpfilter/Makefile | 1 -
> >  net/bpfilter/main.c   | 2 +-
> >  2 files changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
> > index 0947ee7..5d6c776 100644
> > --- a/net/bpfilter/Makefile
> > +++ b/net/bpfilter/Makefile
> > @@ -5,7 +5,6 @@
> >
> >  hostprogs-y := bpfilter_umh
> >  bpfilter_umh-objs := main.o
> > -KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi
> >  HOSTCC := $(CC)
> >
> >  ifeq ($(CONFIG_BPFILTER_UMH), y)
> > diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
> > index 1317f10..61ce845 100644
> > --- a/net/bpfilter/main.c
> > +++ b/net/bpfilter/main.c
> > @@ -6,7 +6,7 @@
> >  #include <sys/socket.h>
> >  #include <fcntl.h>
> >  #include <unistd.h>
> > -#include "include/uapi/linux/bpf.h"
> > +#include "../../include/uapi/linux/bpf.h"
>
> argh. that's not pretty.
> I would prefer to keep -I in a makefile


This hunk is not a question.

The code #include "include/uapi/linux/bpf.h" is wrong
if you understand the meaning of #include "..."

https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html


The directive #include "include/uapi/linux/bpf.h"
means the preprocessor should look for this header first
in the path relative to the directory of net/bpfilter/main.c

That is, the preprocessor will look for
net/bpfilter/include/uapi/linux/bpf.h
which obviously does not exist.


I am fixing this because adding -I.
in kernel Makefile is always wrong.
For example, commit 5cd5548ff439b91


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
  2019-01-31  3:15 Masahiro Yamada
@ 2019-02-01 23:59 ` Alexei Starovoitov
  2019-02-02 13:40   ` Masahiro Yamada
  2019-02-04  4:13 ` David Miller
  1 sibling, 1 reply; 8+ messages in thread
From: Alexei Starovoitov @ 2019-02-01 23:59 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Daniel Borkmann, netdev, Matteo Croce, David S. Miller,
	linux-kernel, Jakub Kicinski, Laura Abbott, YueHaibing

On Thu, Jan 31, 2019 at 12:15:35PM +0900, Masahiro Yamada wrote:
> Currently, the header search paths -Itools/include and
> -Itools/include/uapi are not used. Let's drop the unused code.
> 
> We can remove -I. too by fixing up one C file.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
> Perhaps, are these extra header search paths for
> more upstreaming in the future?
> 
> If this patch is rejected, I will send an alternative one.
> 
> To clean up the Kbuild core,
> I want to drop as many unused header search paths as possible.
> 
> 
>  net/bpfilter/Makefile | 1 -
>  net/bpfilter/main.c   | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
> index 0947ee7..5d6c776 100644
> --- a/net/bpfilter/Makefile
> +++ b/net/bpfilter/Makefile
> @@ -5,7 +5,6 @@
>  
>  hostprogs-y := bpfilter_umh
>  bpfilter_umh-objs := main.o
> -KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi
>  HOSTCC := $(CC)
>  
>  ifeq ($(CONFIG_BPFILTER_UMH), y)
> diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
> index 1317f10..61ce845 100644
> --- a/net/bpfilter/main.c
> +++ b/net/bpfilter/main.c
> @@ -6,7 +6,7 @@
>  #include <sys/socket.h>
>  #include <fcntl.h>
>  #include <unistd.h>
> -#include "include/uapi/linux/bpf.h"
> +#include "../../include/uapi/linux/bpf.h"

argh. that's not pretty.
I would prefer to keep -I in a makefile


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] bpfilter: remove extra header search paths for bpfilter_umh
@ 2019-01-31  3:15 Masahiro Yamada
  2019-02-01 23:59 ` Alexei Starovoitov
  2019-02-04  4:13 ` David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: Masahiro Yamada @ 2019-01-31  3:15 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, netdev
  Cc: Masahiro Yamada, Matteo Croce, David S. Miller, linux-kernel,
	Jakub Kicinski, Laura Abbott, Alexei Starovoitov, YueHaibing

Currently, the header search paths -Itools/include and
-Itools/include/uapi are not used. Let's drop the unused code.

We can remove -I. too by fixing up one C file.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Perhaps, are these extra header search paths for
more upstreaming in the future?

If this patch is rejected, I will send an alternative one.

To clean up the Kbuild core,
I want to drop as many unused header search paths as possible.


 net/bpfilter/Makefile | 1 -
 net/bpfilter/main.c   | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/bpfilter/Makefile b/net/bpfilter/Makefile
index 0947ee7..5d6c776 100644
--- a/net/bpfilter/Makefile
+++ b/net/bpfilter/Makefile
@@ -5,7 +5,6 @@
 
 hostprogs-y := bpfilter_umh
 bpfilter_umh-objs := main.o
-KBUILD_HOSTCFLAGS += -I. -Itools/include/ -Itools/include/uapi
 HOSTCC := $(CC)
 
 ifeq ($(CONFIG_BPFILTER_UMH), y)
diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
index 1317f10..61ce845 100644
--- a/net/bpfilter/main.c
+++ b/net/bpfilter/main.c
@@ -6,7 +6,7 @@
 #include <sys/socket.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include "include/uapi/linux/bpf.h"
+#include "../../include/uapi/linux/bpf.h"
 #include <asm/unistd.h>
 #include "msgfmt.h"
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-02-21 19:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-21 14:42 [PATCH] bpfilter: remove extra header search paths for bpfilter_umh Guenter Roeck
2019-02-21 15:54 ` Masahiro Yamada
2019-02-21 18:05   ` Guenter Roeck
2019-02-21 19:00   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-01-31  3:15 Masahiro Yamada
2019-02-01 23:59 ` Alexei Starovoitov
2019-02-02 13:40   ` Masahiro Yamada
2019-02-04  4:13 ` David Miller

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).