Commit 1c9ca7e9 authored by Anders Roxell's avatar Anders Roxell Committed by Daniel Borkmann

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: 81f77fd0 ("bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID")
Signed-off-by: default avatarAnders Roxell <anders.roxell@linaro.org>
Acked-by: default avatarYonghong Song <yhs@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent b1655857
...@@ -16,9 +16,7 @@ LDLIBS += -lcap -lelf -lrt -lpthread ...@@ -16,9 +16,7 @@ LDLIBS += -lcap -lelf -lrt -lpthread
TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read
all: $(TEST_CUSTOM_PROGS) all: $(TEST_CUSTOM_PROGS)
$(TEST_CUSTOM_PROGS): urandom_read $(TEST_CUSTOM_PROGS): $(OUTPUT)/%: %.c
urandom_read: urandom_read.c
$(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id $(CC) -o $(TEST_CUSTOM_PROGS) -static $< -Wl,--build-id
# Order correspond to 'make run_tests' order # Order correspond to 'make run_tests' order
......
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