diff mbox series

[B,SRU,4/5] selftests: fix bpf build/test workflow regression when KBUILD_OUTPUT is set

Message ID 20211105104534.149987-5-po-hsu.lin@canonical.com
State New
Headers show
Series Fix kselftest/net test build for the upcoming granularity improvement | expand

Commit Message

Po-Hsu Lin Nov. 5, 2021, 10:45 a.m. UTC
From: Shuah Khan <skhan@linuxfoundation.org>

BugLink: https://bugs.launchpad.net/bugs/1949889

commit 8ce72dc32578 ("selftests: fix headers_install circular dependency")
broke bpf build/test workflow. When KBUILD_OUTPUT is set, bpf objects end
up in KBUILD_OUTPUT build directory instead of in ../selftests/bpf.

The following bpf workflow breaks when it can't find the test_verifier:

cd tools/testing/selftests/bpf; make; ./test_verifier;

Fix it to set OUTPUT only when it is undefined in lib.mk. It didn't need
to be set in the first place.

Fixes: 8ce72dc32578 ("selftests: fix headers_install circular dependency")
Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
(cherry picked from commit 27d79a2b2bf0dbec1cc3d8ea269db4d5a0dac2f3)
Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 tools/testing/selftests/lib.mk | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 8873a31..a895338 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -7,15 +7,9 @@  CC := $(CROSS_COMPILE)gcc
 endif
 
 ifeq (0,$(MAKELEVEL))
-    ifneq ($(O),)
-	OUTPUT := $(O)
-    else
-	ifneq ($(KBUILD_OUTPUT),)
-		OUTPUT := $(KBUILD_OUTPUT)
-	else
-		OUTPUT := $(shell pwd)
-		DEFAULT_INSTALL_HDR_PATH := 1
-	endif
+    ifeq ($(OUTPUT),)
+	OUTPUT := $(shell pwd)
+	DEFAULT_INSTALL_HDR_PATH := 1
     endif
 endif