2019-10-11 00:30:13

by Ivan Khoronzhuk

[permalink] [raw]
Subject: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

While compiling natively, the host's cflags and ldflags are equal to
ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it
should have own, used for target arch. While verification, for arm,
arm64 and x86_64 the following flags were used always:

-Wall -O2
-fomit-frame-pointer
-Wmissing-prototypes
-Wstrict-prototypes

So, add them as they were verified and used before adding
Makefile.target and lets omit "-fomit-frame-pointer" as were proposed
while review, as no sense in such optimization for samples.

Signed-off-by: Ivan Khoronzhuk <[email protected]>
---
samples/bpf/Makefile | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 91bfb421c278..57a15ff938a6 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -176,8 +176,10 @@ BPF_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR)
TPROGS_CFLAGS += $(ARM_ARCH_SELECTOR)
endif

-TPROGS_LDLIBS := $(KBUILD_HOSTLDLIBS)
-TPROGS_CFLAGS += $(KBUILD_HOSTCFLAGS) $(HOST_EXTRACFLAGS)
+TPROGS_CFLAGS += -Wall -O2
+TPROGS_CFLAGS += -Wmissing-prototypes
+TPROGS_CFLAGS += -Wstrict-prototypes
+
TPROGS_CFLAGS += -I$(objtree)/usr/include
TPROGS_CFLAGS += -I$(srctree)/tools/lib/bpf/
TPROGS_CFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
--
2.17.1


2019-10-11 08:51:31

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

More grammar nitpicking...

On 11.10.2019 3:28, Ivan Khoronzhuk wrote:

> While compiling natively, the host's cflags and ldflags are equal to
> ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it
> should have own, used for target arch. While verification, for arm,

While verifying.

> arm64 and x86_64 the following flags were used always:
>
> -Wall -O2
> -fomit-frame-pointer
> -Wmissing-prototypes
> -Wstrict-prototypes
>
> So, add them as they were verified and used before adding
> Makefile.target and lets omit "-fomit-frame-pointer" as were proposed
> while review, as no sense in such optimization for samples.
>
> Signed-off-by: Ivan Khoronzhuk <[email protected]>
[...]

MBR, Sergei

2019-10-11 09:58:08

by Ivan Khoronzhuk

[permalink] [raw]
Subject: Re: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

On Fri, Oct 11, 2019 at 11:49:38AM +0300, Sergei Shtylyov wrote:
> More grammar nitpicking...
>
>On 11.10.2019 3:28, Ivan Khoronzhuk wrote:
>
>>While compiling natively, the host's cflags and ldflags are equal to
>>ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it
>>should have own, used for target arch. While verification, for arm,
>
> While verifying.
While verification stage.

>
>>arm64 and x86_64 the following flags were used always:
>>
>>-Wall -O2
>>-fomit-frame-pointer
>>-Wmissing-prototypes
>>-Wstrict-prototypes
>>
>>So, add them as they were verified and used before adding
>>Makefile.target and lets omit "-fomit-frame-pointer" as were proposed
>>while review, as no sense in such optimization for samples.
>>
>>Signed-off-by: Ivan Khoronzhuk <[email protected]>
>[...]
>
>MBR, Sergei

--
Regards,
Ivan Khoronzhuk

2019-10-11 11:17:57

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

On 10/11/2019 12:57 PM, Ivan Khoronzhuk wrote:

>>> While compiling natively, the host's cflags and ldflags are equal to
>>> ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it
>>> should have own, used for target arch. While verification, for arm,
>>
>> While verifying.
> While verification stage.

While *in* verification stage, "while" doesn't combine with nouns w/o
a preposition.

>>> arm64 and x86_64 the following flags were used always:
>>>
>>> -Wall -O2
>>> -fomit-frame-pointer
>>> -Wmissing-prototypes
>>> -Wstrict-prototypes
>>>
>>> So, add them as they were verified and used before adding
>>> Makefile.target and lets omit "-fomit-frame-pointer" as were proposed
>>> while review, as no sense in such optimization for samples.
>>>
>>> Signed-off-by: Ivan Khoronzhuk <[email protected]>
>> [...]

MBR, Sergei

2019-10-12 21:34:58

by Ivan Khoronzhuk

[permalink] [raw]
Subject: Re: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

On Fri, Oct 11, 2019 at 02:16:05PM +0300, Sergei Shtylyov wrote:
>On 10/11/2019 12:57 PM, Ivan Khoronzhuk wrote:
>
>>>> While compiling natively, the host's cflags and ldflags are equal to
>>>> ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it
>>>> should have own, used for target arch. While verification, for arm,
>>>
>>> While verifying.
>> While verification stage.
>
> While *in* verification stage, "while" doesn't combine with nouns w/o
>a preposition.


Sergei, better add me in cc list when msg is to me I can miss it.

Regarding the language lesson, thanks, I will keep it in mind next
time, but the issue is not rude, if it's an issue at all, so I better
leave it as is, as not reasons to correct it w/o code changes and
everyone is able to understand it.

>
>>>> arm64 and x86_64 the following flags were used always:
>>>>
>>>> -Wall -O2
>>>> -fomit-frame-pointer
>>>> -Wmissing-prototypes
>>>> -Wstrict-prototypes
>>>>
>>>> So, add them as they were verified and used before adding
>>>> Makefile.target and lets omit "-fomit-frame-pointer" as were proposed
>>>> while review, as no sense in such optimization for samples.
>>>>
>>>> Signed-off-by: Ivan Khoronzhuk <[email protected]>
>>> [...]
>
>MBR, Sergei

--
Regards,
Ivan Khoronzhuk

2019-10-13 17:08:32

by Sergei Shtylyov

[permalink] [raw]
Subject: Re: [PATCH v5 bpf-next 09/15] samples/bpf: use own flags but not HOSTCFLAGS

On 13.10.2019 0:26, Ivan Khoronzhuk wrote:

>>>>> While compiling natively, the host's cflags and ldflags are equal to
>>>>> ones used from HOSTCFLAGS and HOSTLDFLAGS. When cross compiling it
>>>>> should have own, used for target arch. While verification, for arm,
>>>>
>>>>   While verifying.
>>> While verification stage.
>>
>>   While *in* verification stage, "while" doesn't combine with nouns w/o
>> a preposition.
>
>
> Sergei, better add me in cc list when msg is to me I can miss it.

Hm, the earlier mails were addressed to you but no the last one --
not sure what happened there, sorry.

> Regarding the language lesson, thanks, I will keep it in mind next
> time, but the issue is not rude, if it's an issue at all, so I better
> leave it as is, as not reasons to correct it w/o code changes and
> everyone is able to understand it.

Up to you. and the maintainer(s)...

>>>>> arm64 and x86_64 the following flags were used always:
>>>>>
>>>>> -Wall -O2
>>>>> -fomit-frame-pointer
>>>>> -Wmissing-prototypes
>>>>> -Wstrict-prototypes
>>>>>
>>>>> So, add them as they were verified and used before adding
>>>>> Makefile.target and lets omit "-fomit-frame-pointer" as were proposed
>>>>> while review, as no sense in such optimization for samples.
>>>>>
>>>>> Signed-off-by: Ivan Khoronzhuk <[email protected]>
>>>> [...]

MBR, Sergei