> My understanding of the check on building_out_of_srctree in > tools/bpf/Makefile (from commit 55d554f5d140's description) is that it > fixes the build from "make TARGETS=bpf kselftest", not from "make -C > tools/bpf". > Trying again "make ARCH=x86 -C tools/bpf/bpftool bootstrap" at the root > of the Linux repo, not building out-of-tree, this works fine for me, > without the need for your patch. I'm trying to understand what you > setup is and what creates the failure that you observe (and that I can't > reproduce), so I'd like more context if possible. Are you just running > that command from the root of the tree? If that's the case, what values > do you observe for $(srctree) and $(building_out_of_srctree) when > entering bpftool's Makefile? I do the same thing and I get this error, srctree is set to ".". I have no clue what's different about my environment that would cause this error. This is a Fedora Rawhide image and I'm using the master branch from Linus's repo (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git) Cheers, Daan On Mon, 11 Nov 2024 at 16:39, Quentin Monnet <qmo@xxxxxxxx> wrote: > > 2024-11-11 15:02 UTC+0100 ~ Daan De Meyer <daan.j.demeyer@xxxxxxxxx> > > This allows building bpftool directly via "make -C tools/bpf/bpftool". > > > > Without this change, building bpftool via "make -C tools/bpf/bpftool" > > fails with the following error: > > > > """ > > + make ARCH=x86 -C tools/bpf/bpftool bootstrap > > Makefile:127: tools/build/Makefile.feature: No such file or directory > > make[3]: *** No rule to make target 'tools/build/Makefile.feature'. Stop. > > error: Bad exit status from /var/tmp/rpm-tmp.3p0IcJ (%build) > > """ > > > > This is the same workaround that is also applied in tools/bpf/Makefile. > > > My understanding of the check on building_out_of_srctree in > tools/bpf/Makefile (from commit 55d554f5d140's description) is that it > fixes the build from "make TARGETS=bpf kselftest", not from "make -C > tools/bpf". > > Trying again "make ARCH=x86 -C tools/bpf/bpftool bootstrap" at the root > of the Linux repo, not building out-of-tree, this works fine for me, > without the need for your patch. I'm trying to understand what your > setup is and what creates the failure that you observe (and that I can't > reproduce), so I'd like more context if possible. Are you just running > that command from the root of the tree? If that's the case, what values > do you observe for $(srctree) and $(building_out_of_srctree) when > entering bpftool's Makefile? > > Your v2 also still misses your sign-off, and please remember as well to > add all relevant maintainers in copy of your email. > > > > --- > > tools/bpf/bpftool/Makefile | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile > > index ba927379eb20..7c7d731077c9 100644 > > --- a/tools/bpf/bpftool/Makefile > > +++ b/tools/bpf/bpftool/Makefile > > @@ -2,6 +2,12 @@ > > include ../../scripts/Makefile.include > > > > ifeq ($(srctree),) > > +update_srctree := 1 > > +endif > > +ifndef building_out_of_srctree > > +update_srctree := 1 > > +endif > > +ifeq ($(update_srctree),1) > > srctree := $(patsubst %/,%,$(dir $(CURDIR))) > > srctree := $(patsubst %/,%,$(dir $(srctree))) > > srctree := $(patsubst %/,%,$(dir $(srctree))) >