Skip to content

Commit e8f1f34

Browse files
zlimdavem330
authored andcommitted
selftests/bpf: fix broken build, take 2
Merge of 'linux-kselftest-4.11-rc1': 1. Partially removed use of 'test_objs' target, breaking force rebuild of BPFOBJ, introduced in commit d498f87 ("bpf: Rebuild bpf.o for any dependency update"). Update target so dependency on BPFOBJ is restored. 2. Introduced commit 2047f1d ("selftests: Fix the .c linking rule") which fixes order of LDLIBS. Commit d02d898 ("bpf: Always test unprivileged programs") added libcap dependency into CFLAGS. Use LDLIBS instead to fix linking of test_verifier. 3. Introduced commit d83c3ba ("selftests: Fix selftests build to just build, not run tests"). Reordering the Makefile allows us to remove the 'all' target. Tested both: selftests/bpf$ make and selftests$ make TARGETS=bpf on Ubuntu 16.04.2. Signed-off-by: Zi Shen Lim <[email protected]> Acked-by: Daniel Borkmann <[email protected]> Tested-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Tested-by: Alexei Starovoitov <[email protected]> Acked-by: Shuah Khan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4ef1b28 commit e8f1f34

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
LIBDIR := ../../../lib
2-
BPFOBJ := $(LIBDIR)/bpf/bpf.o
2+
BPFDIR := $(LIBDIR)/bpf
33

4-
CFLAGS += -Wall -O2 -lcap -I../../../include/uapi -I$(LIBDIR) $(BPFOBJ)
4+
CFLAGS += -Wall -O2 -I../../../include/uapi -I$(LIBDIR)
5+
LDLIBS += -lcap
56

67
TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map
78

89
TEST_PROGS := test_kmod.sh
910

10-
all: $(TEST_GEN_PROGS)
11+
include ../lib.mk
12+
13+
BPFOBJ := $(OUTPUT)/bpf.o
14+
15+
$(TEST_GEN_PROGS): $(BPFOBJ)
1116

12-
.PHONY: all clean force
17+
.PHONY: force
1318

1419
# force a rebuild of BPFOBJ when its dependencies are updated
1520
force:
1621

1722
$(BPFOBJ): force
18-
$(MAKE) -C $(dir $(BPFOBJ))
19-
20-
$(test_objs): $(BPFOBJ)
21-
22-
include ../lib.mk
23+
$(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/

0 commit comments

Comments
 (0)