netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn@kernel.org>
To: Andrii Nakryiko <andrii@kernel.org>,
	Mykola Lysenko <mykolal@fb.com>,
	bpf@vger.kernel.org, netdev@vger.kernel.org
Cc: "Björn Töpel" <bjorn@rivosinc.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org
Subject: [PATCH bpf-next 2/2] selftests/bpf: Honor $(O) when figuring out paths
Date: Wed,  5 Jul 2023 13:39:26 +0200	[thread overview]
Message-ID: <20230705113926.751791-3-bjorn@kernel.org> (raw)
In-Reply-To: <20230705113926.751791-1-bjorn@kernel.org>

From: Björn Töpel <bjorn@rivosinc.com>

When building the kselftests out-of-tree, e.g.
  | make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \
  |   O=/tmp/kselftest headers
  | make ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- \
  |  O=/tmp/kselftest HOSTCC=gcc FORMAT= \
  |  SKIP_TARGETS="arm64 ia64 powerpc sparc64 x86 sgx" \
  |  -C tools/testing/selftests gen_tar

the kselftest build would not pick up the correct GENDIR path, and
therefore not including autoconf.h.

Correct that by taking $(O) into consideration when figuring out the
GENDIR path.

Signed-off-by: Björn Töpel <bjorn@rivosinc.com>
---
 tools/testing/selftests/bpf/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index ad6b585e0d7c..daccc1b8573a 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -12,7 +12,11 @@ BPFDIR := $(LIBDIR)/bpf
 TOOLSINCDIR := $(TOOLSDIR)/include
 BPFTOOLDIR := $(TOOLSDIR)/bpf/bpftool
 APIDIR := $(TOOLSINCDIR)/uapi
+ifneq ($(O),)
+GENDIR := $(O)/include/generated
+else
 GENDIR := $(abspath ../../../../include/generated)
+endif
 GENHDR := $(GENDIR)/autoconf.h
 HOSTPKG_CONFIG := pkg-config
 
-- 
2.39.2


  parent reply	other threads:[~2023-07-05 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 11:39 [PATCH bpf-next 0/2] BPF kselftest cross-build/RISC-V fixes Björn Töpel
2023-07-05 11:39 ` [PATCH bpf-next 1/2] selftests/bpf: Add F_NEEDS_EFFICIENT_UNALIGNED_ACCESS to some tests Björn Töpel
2023-07-05 11:39 ` Björn Töpel [this message]
2023-07-05 12:38 ` [PATCH bpf-next 0/2] BPF kselftest cross-build/RISC-V fixes Daniel Borkmann
2023-07-05 13:45   ` Björn Töpel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230705113926.751791-3-bjorn@kernel.org \
    --to=bjorn@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bjorn@rivosinc.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).