Skip to content

Commit 1dd7622

Browse files
legionusAlexei Starovoitov
authored andcommitted
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: Masahiro Yamada <[email protected]> Tested-by: Oleg Nesterov <[email protected]> Tested-by: Alan Maguire <[email protected]> Signed-off-by: Alexey Gladkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 7c5f7b1 commit 1dd7622

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

kernel/bpf/Makefile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,3 @@ obj-$(CONFIG_BPF_PRELOAD) += preload/
5252
obj-$(CONFIG_BPF_SYSCALL) += relo_core.o
5353
obj-$(CONFIG_BPF_SYSCALL) += btf_iter.o
5454
obj-$(CONFIG_BPF_SYSCALL) += btf_relocate.o
55-
56-
# Some source files are common to libbpf.
57-
vpath %.c $(srctree)/kernel/bpf:$(srctree)/tools/lib/bpf
58-
59-
$(obj)/%.o: %.c FORCE
60-
$(call if_changed_rule,cc_o_c)

kernel/bpf/btf_iter.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
2+
#include "../../tools/lib/bpf/btf_iter.c"

kernel/bpf/btf_relocate.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
2+
#include "../../tools/lib/bpf/btf_relocate.c"

kernel/bpf/relo_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
2+
#include "../../tools/lib/bpf/relo_core.c"

0 commit comments

Comments
 (0)