Commit 1dd7622e authored by Alexey Gladkov's avatar Alexey Gladkov Committed by Alexei Starovoitov
Browse files

bpf: Remove custom build rule



According to the documentation, when building a kernel with the C=2
parameter, all source files should be checked. But this does not happen
for the kernel/bpf/ directory.

$ touch kernel/bpf/core.o
$ make C=2 CHECK=true kernel/bpf/core.o

Outputs:

  CHECK   scripts/mod/empty.c
  CALL    scripts/checksyscalls.sh
  DESCEND objtool
  INSTALL libsubcmd_headers
  CC      kernel/bpf/core.o

As can be seen the compilation is done, but CHECK is not executed. This
happens because kernel/bpf/Makefile has defined its own rule for
compilation and forgotten the macro that does the check.

There is no need to duplicate the build code, and this rule can be
removed to use generic rules.

Acked-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Tested-by: default avatarOleg Nesterov <oleg@redhat.com>
Tested-by: default avatarAlan Maguire <alan.maguire@oracle.com>
Signed-off-by: default avatarAlexey Gladkov <legion@kernel.org>
Link: https://lore.kernel.org/r/20240830074350.211308-1-legion@kernel.org


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 7c5f7b16
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -52,9 +52,3 @@ obj-$(CONFIG_BPF_PRELOAD) += preload/
obj-$(CONFIG_BPF_SYSCALL) += relo_core.o
obj-$(CONFIG_BPF_SYSCALL) += btf_iter.o
obj-$(CONFIG_BPF_SYSCALL) += btf_relocate.o

# Some source files are common to libbpf.
vpath %.c $(srctree)/kernel/bpf:$(srctree)/tools/lib/bpf

$(obj)/%.o: %.c FORCE
	$(call if_changed_rule,cc_o_c)

kernel/bpf/btf_iter.c

0 → 100644
+2 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
#include "../../tools/lib/bpf/btf_iter.c"
+2 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
#include "../../tools/lib/bpf/btf_relocate.c"

kernel/bpf/relo_core.c

0 → 100644
+2 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
#include "../../tools/lib/bpf/relo_core.c"