linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	kafai@fb.com, songliubraving@fb.com, yhs@fb.com,
	john.fastabend@gmail.com, kpsingh@kernel.org,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Hui Zhu <teawaterz@linux.alibaba.com>
Subject: [PATCH] samples/bpf/Makefile: Create tools/testing/selftests/bpf dir
Date: Mon, 14 Dec 2020 18:56:54 +0800	[thread overview]
Message-ID: <20201214105654.5048-1-teawater@gmail.com> (raw)

From: Hui Zhu <teawaterz@linux.alibaba.com>

Got an error when I built samples/bpf in a separate directory:
make O=../bk/ defconfig
make -j64 bzImage
make headers_install
make V=1 M=samples/bpf
...
...
make -C /home/teawater/kernel/linux/samples/bpf/../..//tools/build
CFLAGS= LDFLAGS= fixdep
make -f
/home/teawater/kernel/linux/samples/bpf/../..//tools/build/Makefile.build
dir=. obj=fixdep
make all_cmd
Warning: Kernel ABI header at 'tools/include/uapi/linux/netlink.h'
differs from latest version at 'include/uapi/linux/netlink.h'
Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h'
differs from latest version at 'include/uapi/linux/if_link.h'
  gcc
-Wp,-MD,samples/bpf/../../tools/testing/selftests/bpf/.cgroup_helpers.o.d
-Wall -O2 -Wmissing-prototypes -Wstrict-prototypes -I./usr/include
-I/home/teawater/kernel/linux/tools/testing/selftests/bpf/
-I/home/teawater/kernel/linux/tools/lib/
-I/home/teawater/kernel/linux/tools/include
-I/home/teawater/kernel/linux/tools/perf -DHAVE_ATTR_TEST=0  -c -o
samples/bpf/../../tools/testing/selftests/bpf/cgroup_helpers.o
/home/teawater/kernel/linux/samples/bpf/../../tools/testing/selftests/bpf/cgroup_helpers.c
/home/teawater/kernel/linux/samples/bpf/../../tools/testing/selftests/bpf/cgroup_helpers.c:315:1:
fatal error: opening dependency file
samples/bpf/../../tools/testing/selftests/bpf/.cgroup_helpers.o.d: No
such file or directory

ls -al samples/bpf/../../tools/testing/selftests/bpf/
ls: cannot access 'samples/bpf/../../tools/testing/selftests/bpf/': No
such file or directory

There is no samples/bpf/../../tools/testing/selftests/bpf/ causing a
compilation error.

This commit add a "make -p" before build files in
samples/bpf/../../tools/testing/selftests/bpf/ to handle the issue.

Signed-off-by: Hui Zhu <teawaterz@linux.alibaba.com>
---
 samples/bpf/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index aeebf5d12f32..5b940eedf2e8 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -262,6 +262,7 @@ clean:
 
 $(LIBBPF): FORCE
 # Fix up variables inherited from Kbuild that tools/ build system won't like
+	mkdir -p $(obj)/../../tools/testing/selftests/bpf/
 	$(MAKE) -C $(dir $@) RM='rm -rf' EXTRA_CFLAGS="$(TPROGS_CFLAGS)" \
 		LDFLAGS=$(TPROGS_LDFLAGS) srctree=$(BPF_SAMPLES_PATH)/../../ O=
 
-- 
2.17.1


             reply	other threads:[~2020-12-14 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 10:56 Hui Zhu [this message]
2020-12-15 22:08 ` [PATCH] samples/bpf/Makefile: Create tools/testing/selftests/bpf dir Andrii Nakryiko

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=20201214105654.5048-1-teawater@gmail.com \
    --to=teawater@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=teawaterz@linux.alibaba.com \
    --cc=yhs@fb.com \
    /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).