* [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable
@ 2018-10-08 8:22 Jiri Olsa
2018-10-08 8:22 ` [PATCH 2/2] bpftool: Allow add linker flags via EXTRA_LDFLAGS variable Jiri Olsa
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jiri Olsa @ 2018-10-08 8:22 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann; +Cc: lkml, netdev
Adding EXTRA_CFLAGS allowing user to specify extra flags
for CFLAGS variable.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/bpf/bpftool/Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 74288a2197ab..5bfa07e3f2f7 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -46,6 +46,10 @@ CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
-I$(srctree)/tools/lib/bpf \
-I$(srctree)/tools/perf
CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
+ifneq ($(EXTRA_CFLAGS),)
+CFLAGS += $(EXTRA_CFLAGS)
+endif
+
LIBS = -lelf -lbfd -lopcodes $(LIBBPF)
INSTALL ?= install
--
2.17.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] bpftool: Allow add linker flags via EXTRA_LDFLAGS variable
2018-10-08 8:22 [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable Jiri Olsa
@ 2018-10-08 8:22 ` Jiri Olsa
2018-10-08 21:02 ` Song Liu
2018-10-08 21:02 ` [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable Song Liu
2018-10-11 8:29 ` Daniel Borkmann
2 siblings, 1 reply; 5+ messages in thread
From: Jiri Olsa @ 2018-10-08 8:22 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann; +Cc: lkml, netdev
Adding EXTRA_LDFLAGS allowing user to specify extra flags
for LD_FLAGS variable. Also adding LDFLAGS to build command
line.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/bpf/bpftool/Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 5bfa07e3f2f7..dac7eff4c7e5 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -49,6 +49,9 @@ CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
ifneq ($(EXTRA_CFLAGS),)
CFLAGS += $(EXTRA_CFLAGS)
endif
+ifneq ($(EXTRA_LDFLAGS),)
+LDFLAGS += $(EXTRA_LDFLAGS)
+endif
LIBS = -lelf -lbfd -lopcodes $(LIBBPF)
@@ -94,7 +97,7 @@ $(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c
$(QUIET_CC)$(COMPILE.c) -MMD -o $@ $<
$(OUTPUT)bpftool: $(OBJS) $(LIBBPF)
- $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+ $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
$(OUTPUT)%.o: %.c
$(QUIET_CC)$(COMPILE.c) -MMD -o $@ $<
--
2.17.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable
2018-10-08 8:22 [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable Jiri Olsa
2018-10-08 8:22 ` [PATCH 2/2] bpftool: Allow add linker flags via EXTRA_LDFLAGS variable Jiri Olsa
@ 2018-10-08 21:02 ` Song Liu
2018-10-11 8:29 ` Daniel Borkmann
2 siblings, 0 replies; 5+ messages in thread
From: Song Liu @ 2018-10-08 21:02 UTC (permalink / raw)
To: Jiri Olsa; +Cc: Alexei Starovoitov, Daniel Borkmann, open list, Networking
On Mon, Oct 8, 2018 at 1:24 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> Adding EXTRA_CFLAGS allowing user to specify extra flags
> for CFLAGS variable.
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
> ---
> tools/bpf/bpftool/Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index 74288a2197ab..5bfa07e3f2f7 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -46,6 +46,10 @@ CFLAGS += -DPACKAGE='"bpftool"' -D__EXPORTED_HEADERS__ \
> -I$(srctree)/tools/lib/bpf \
> -I$(srctree)/tools/perf
> CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
> +ifneq ($(EXTRA_CFLAGS),)
> +CFLAGS += $(EXTRA_CFLAGS)
> +endif
> +
> LIBS = -lelf -lbfd -lopcodes $(LIBBPF)
>
> INSTALL ?= install
> --
> 2.17.2
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] bpftool: Allow add linker flags via EXTRA_LDFLAGS variable
2018-10-08 8:22 ` [PATCH 2/2] bpftool: Allow add linker flags via EXTRA_LDFLAGS variable Jiri Olsa
@ 2018-10-08 21:02 ` Song Liu
0 siblings, 0 replies; 5+ messages in thread
From: Song Liu @ 2018-10-08 21:02 UTC (permalink / raw)
To: Jiri Olsa; +Cc: Alexei Starovoitov, Daniel Borkmann, open list, Networking
On Mon, Oct 8, 2018 at 1:23 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> Adding EXTRA_LDFLAGS allowing user to specify extra flags
> for LD_FLAGS variable. Also adding LDFLAGS to build command
> line.
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
> ---
> tools/bpf/bpftool/Makefile | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index 5bfa07e3f2f7..dac7eff4c7e5 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -49,6 +49,9 @@ CFLAGS += -DBPFTOOL_VERSION='"$(BPFTOOL_VERSION)"'
> ifneq ($(EXTRA_CFLAGS),)
> CFLAGS += $(EXTRA_CFLAGS)
> endif
> +ifneq ($(EXTRA_LDFLAGS),)
> +LDFLAGS += $(EXTRA_LDFLAGS)
> +endif
>
> LIBS = -lelf -lbfd -lopcodes $(LIBBPF)
>
> @@ -94,7 +97,7 @@ $(OUTPUT)disasm.o: $(srctree)/kernel/bpf/disasm.c
> $(QUIET_CC)$(COMPILE.c) -MMD -o $@ $<
>
> $(OUTPUT)bpftool: $(OBJS) $(LIBBPF)
> - $(QUIET_LINK)$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
> + $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
>
> $(OUTPUT)%.o: %.c
> $(QUIET_CC)$(COMPILE.c) -MMD -o $@ $<
> --
> 2.17.2
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable
2018-10-08 8:22 [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable Jiri Olsa
2018-10-08 8:22 ` [PATCH 2/2] bpftool: Allow add linker flags via EXTRA_LDFLAGS variable Jiri Olsa
2018-10-08 21:02 ` [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable Song Liu
@ 2018-10-11 8:29 ` Daniel Borkmann
2 siblings, 0 replies; 5+ messages in thread
From: Daniel Borkmann @ 2018-10-11 8:29 UTC (permalink / raw)
To: Jiri Olsa, Alexei Starovoitov; +Cc: lkml, netdev
On 10/08/2018 10:22 AM, Jiri Olsa wrote:
> Adding EXTRA_CFLAGS allowing user to specify extra flags
> for CFLAGS variable.
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Both applied to bpf-next, thanks Jiri!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-10-11 8:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-08 8:22 [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable Jiri Olsa
2018-10-08 8:22 ` [PATCH 2/2] bpftool: Allow add linker flags via EXTRA_LDFLAGS variable Jiri Olsa
2018-10-08 21:02 ` Song Liu
2018-10-08 21:02 ` [PATCH 1/2] bpftool: Allow to add compiler flags via EXTRA_CFLAGS variable Song Liu
2018-10-11 8:29 ` Daniel Borkmann
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).