Skip to content

Commit 1c9ca7e

Browse files
roxellborkmann
authored andcommitted
selftests: bpf: fix urandom_read build issue
gcc complains that urandom_read gets built twice. gcc -o tools/testing/selftests/bpf/urandom_read -static urandom_read.c -Wl,--build-id gcc -Wall -O2 -I../../../include/uapi -I../../../lib -I../../../lib/bpf -I../../../../include/generated -I../../../include urandom_read.c urandom_read -lcap -lelf -lrt -lpthread -o tools/testing/selftests/bpf/urandom_read gcc: fatal error: input file ‘tools/testing/selftests/bpf/urandom_read’ is the same as output file compilation terminated. ../lib.mk:110: recipe for target 'tools/testing/selftests/bpf/urandom_read' failed To fix this issue remove the urandom_read target and so target TEST_CUSTOM_PROGS gets used. Fixes: 81f77fd ("bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID") Signed-off-by: Anders Roxell <[email protected]> Acked-by: Yonghong Song <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
1 parent b165585 commit 1c9ca7e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tools/testing/selftests/bpf/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ LDLIBS += -lcap -lelf -lrt -lpthread
1616
TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read
1717
all: $(TEST_CUSTOM_PROGS)
1818

19-
$(TEST_CUSTOM_PROGS): urandom_read
20-
21-
urandom_read: urandom_read.c
19+
$(TEST_CUSTOM_PROGS): $(OUTPUT)/%: %.c
2220
$(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id
2321

2422
# Order correspond to 'make run_tests' order

0 commit comments

Comments
 (0)