summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2018-10-08 10:22:59 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2018-10-11 10:24:53 +0200
commitc85061657e1c45d7063d718c7e21b880e3b1411e (patch)
treef86dd74bee200ceae06157066c6fc9cfeb478960
parent0ef6bf39f09832866fd581cbafafbad9b2469eb3 (diff)
bpftool: Allow add linker flags via EXTRA_LDFLAGS variable
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> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
-rw-r--r--tools/bpf/bpftool/Makefile5
1 files changed, 4 insertions, 1 deletions
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 $@ $<