Skip to content

Commit

Permalink
samples/bpf: Partially fixes the bpf.o build
Browse files Browse the repository at this point in the history
Do not build lib/bpf/bpf.o with this Makefile but use the one from the
library directory.  This avoid making a buggy bpf.o file (e.g. missing
symbols).

This patch is useful if some code (e.g. Landlock tests) needs both the
bpf.o (from tools/lib/bpf) and the bpf_load.o (from samples/bpf).

Signed-off-by: Mickaël Salaün <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
  • Loading branch information
l0kod authored and borkmann committed Jan 26, 2018
1 parent 771fc60 commit c25ef6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion samples/bpf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,16 @@ CLANG_ARCH_ARGS = -target $(ARCH)
endif

# Trick to allow make to be run from this directory
all:
all: $(LIBBPF)
$(MAKE) -C ../../ $(CURDIR)/

clean:
$(MAKE) -C ../../ M=$(CURDIR) clean
@rm -f *~

$(LIBBPF): FORCE
$(MAKE) -C $(dir $@) $(notdir $@)

$(obj)/syscall_nrs.s: $(src)/syscall_nrs.c
$(call if_changed_dep,cc_s_c)

Expand Down

0 comments on commit c25ef6a

Please sign in to comment.