Commit e8f1f34a authored by Zi Shen Lim's avatar Zi Shen Lim Committed by David S. Miller

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 d498f871 ("bpf: Rebuild bpf.o for any
dependency update").

  Update target so dependency on BPFOBJ is restored.

2. Introduced commit 2047f1d8 ("selftests: Fix the .c linking rule")
which fixes order of LDLIBS.

  Commit d02d8986 ("bpf: Always test unprivileged programs") added
libcap dependency into CFLAGS. Use LDLIBS instead to fix linking of
test_verifier.

3. Introduced commit d83c3ba0 ("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: default avatarZi Shen Lim <zlim.lnx@gmail.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Tested-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
Tested-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4ef1b286
LIBDIR := ../../../lib LIBDIR := ../../../lib
BPFOBJ := $(LIBDIR)/bpf/bpf.o BPFDIR := $(LIBDIR)/bpf
CFLAGS += -Wall -O2 -lcap -I../../../include/uapi -I$(LIBDIR) $(BPFOBJ) CFLAGS += -Wall -O2 -I../../../include/uapi -I$(LIBDIR)
LDLIBS += -lcap
TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_lpm_map
TEST_PROGS := test_kmod.sh TEST_PROGS := test_kmod.sh
all: $(TEST_GEN_PROGS) include ../lib.mk
BPFOBJ := $(OUTPUT)/bpf.o
$(TEST_GEN_PROGS): $(BPFOBJ)
.PHONY: all clean force .PHONY: force
# force a rebuild of BPFOBJ when its dependencies are updated # force a rebuild of BPFOBJ when its dependencies are updated
force: force:
$(BPFOBJ): force $(BPFOBJ): force
$(MAKE) -C $(dir $(BPFOBJ)) $(MAKE) -C $(BPFDIR) OUTPUT=$(OUTPUT)/
$(test_objs): $(BPFOBJ)
include ../lib.mk
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment