xref: /linux/kernel/bpf/Makefile (revision 35f301dd4551fa731db4834f915e8351838f6f19)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2f89b7755SAlexei Starovoitovobj-y := core.o
3080b6f40SArd Biesheuvelifneq ($(CONFIG_BPF_JIT_ALWAYS_ON),y)
4080b6f40SArd Biesheuvel# ___bpf_prog_run() needs GCSE disabled on x86; see 3193c0836f203 for details
5080b6f40SArd Biesheuvelcflags-nogcse-$(CONFIG_X86)$(CONFIG_CC_IS_GCC) := -fno-gcse
6080b6f40SArd Biesheuvelendif
7c40845e3SArnd BergmannCFLAGS_core.o += -Wno-override-init $(cflags-nogcse-yy)
8b2197755SDaniel Borkmann
935f96de0SAndrii Nakryikoobj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o tnum.o log.o token.o
104294a0a7SAndrii Nakryikoobj-$(CONFIG_BPF_SYSCALL) += bpf_iter.o map_iter.o task_iter.o prog_iter.o link_iter.o
119330986cSJoanne Koongobj-$(CONFIG_BPF_SYSCALL) += hashtab.o arraymap.o percpu_freelist.o bpf_lru_list.o lpm_trie.o map_in_map.o bloom_filter.o
12457f4436SAndrii Nakryikoobj-$(CONFIG_BPF_SYSCALL) += local_storage.o queue_stack_maps.o ringbuf.o
13a10787e6SSong Liuobj-$(CONFIG_BPF_SYSCALL) += bpf_local_storage.o bpf_task_storage.o
148ea63684SKP Singhobj-${CONFIG_BPF_LSM}	  += bpf_inode_storage.o
15053c8e1fSDaniel Borkmannobj-$(CONFIG_BPF_SYSCALL) += disasm.o mprog.o
16fec56f58SAlexei Starovoitovobj-$(CONFIG_BPF_JIT) += trampoline.o
177c8199e2SAlexei Starovoitovobj-$(CONFIG_BPF_SYSCALL) += btf.o memalloc.o
1831746031SAlexei Starovoitovifeq ($(CONFIG_MMU)$(CONFIG_64BIT),yy)
19b7953797SAlexei Starovoitovobj-$(CONFIG_BPF_SYSCALL) += arena.o range_tree.o
2031746031SAlexei Starovoitovendif
2175ccbef6SBjörn Töpelobj-$(CONFIG_BPF_JIT) += dispatcher.o
22546ac1ffSJohn Fastabendifeq ($(CONFIG_NET),y)
236bdc9c4cSJohn Fastabendobj-$(CONFIG_BPF_SYSCALL) += devmap.o
246710e112SJesper Dangaard Brouerobj-$(CONFIG_BPF_SYSCALL) += cpumap.o
25ab3f0063SJakub Kicinskiobj-$(CONFIG_BPF_SYSCALL) += offload.o
26b27f7bb5SJakub Sitnickiobj-$(CONFIG_BPF_SYSCALL) += net_namespace.o
27e420bed0SDaniel Borkmannobj-$(CONFIG_BPF_SYSCALL) += tcx.o
285f103c5dSJohn Fastabendendif
29d5a3b1f6SAlexei Starovoitovifeq ($(CONFIG_PERF_EVENTS),y)
30d5a3b1f6SAlexei Starovoitovobj-$(CONFIG_BPF_SYSCALL) += stackmap.o
31d5a3b1f6SAlexei Starovoitovendif
32d4ccaf58SHao Luoifeq ($(CONFIG_CGROUPS),y)
33c4bcfb38SYonghong Songobj-$(CONFIG_BPF_SYSCALL) += cgroup_iter.o bpf_cgrp_storage.o
34d4ccaf58SHao Luoendif
3530070984SDaniel Mackobj-$(CONFIG_CGROUP_BPF) += cgroup.o
365dc4c4b7SMartin KaFai Lauifeq ($(CONFIG_INET),y)
375dc4c4b7SMartin KaFai Lauobj-$(CONFIG_BPF_SYSCALL) += reuseport_array.o
385dc4c4b7SMartin KaFai Lauendif
39341dfcf8SAndrii Nakryikoifeq ($(CONFIG_SYSFS),y)
40341dfcf8SAndrii Nakryikoobj-$(CONFIG_DEBUG_INFO_BTF) += sysfs_btf.o
41341dfcf8SAndrii Nakryikoendif
4227ae7997SMartin KaFai Lauifeq ($(CONFIG_BPF_JIT),y)
4327ae7997SMartin KaFai Lauobj-$(CONFIG_BPF_SYSCALL) += bpf_struct_ops.o
44516f4d33SDavid Vernetobj-$(CONFIG_BPF_SYSCALL) += cpumask.o
45fc611f47SKP Singhobj-${CONFIG_BPF_LSM} += bpf_lsm.o
4627ae7997SMartin KaFai Lauendif
47ac2f438cSVadim Fedorenkoifneq ($(CONFIG_CRYPTO),)
483e1c6f35SVadim Fedorenkoobj-$(CONFIG_BPF_SYSCALL) += crypto.o
493e1c6f35SVadim Fedorenkoendif
50d71fa5c9SAlexei Starovoitovobj-$(CONFIG_BPF_PRELOAD) += preload/
5129db4beaSAlexei Starovoitov
5229db4beaSAlexei Starovoitovobj-$(CONFIG_BPF_SYSCALL) += relo_core.o
538646db23SAlan Maguireobj-$(CONFIG_BPF_SYSCALL) += btf_iter.o
548646db23SAlan Maguireobj-$(CONFIG_BPF_SYSCALL) += btf_relocate.o
554971266eSNamhyung Kimobj-$(CONFIG_BPF_SYSCALL) += kmem_cache_iter.o
56*c83508daSPriya Bala Govindasamy
57*c83508daSPriya Bala GovindasamyCFLAGS_REMOVE_percpu_freelist.o = $(CC_FLAGS_FTRACE)
58*c83508daSPriya Bala GovindasamyCFLAGS_REMOVE_bpf_lru_list.o = $(CC_FLAGS_FTRACE)
59*c83508daSPriya Bala GovindasamyCFLAGS_REMOVE_queue_stack_maps.o = $(CC_FLAGS_FTRACE)
60*c83508daSPriya Bala GovindasamyCFLAGS_REMOVE_lpm_trie.o = $(CC_FLAGS_FTRACE)
61*c83508daSPriya Bala GovindasamyCFLAGS_REMOVE_ringbuf.o = $(CC_FLAGS_FTRACE)
62