Makefile 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. # SPDX-License-Identifier: GPL-2.0
  2. BPF_SAMPLES_PATH ?= $(abspath $(src))
  3. TOOLS_PATH := $(BPF_SAMPLES_PATH)/../../tools
  4. pound := \#
  5. # List of programs to build
  6. tprogs-y := test_lru_dist
  7. tprogs-y += sock_example
  8. tprogs-y += fds_example
  9. tprogs-y += sockex1
  10. tprogs-y += sockex2
  11. tprogs-y += sockex3
  12. tprogs-y += tracex1
  13. tprogs-y += tracex3
  14. tprogs-y += tracex4
  15. tprogs-y += tracex5
  16. tprogs-y += tracex6
  17. tprogs-y += tracex7
  18. tprogs-y += test_probe_write_user
  19. tprogs-y += trace_output
  20. tprogs-y += lathist
  21. tprogs-y += offwaketime
  22. tprogs-y += spintest
  23. tprogs-y += map_perf_test
  24. tprogs-y += test_overhead
  25. tprogs-y += test_cgrp2_array_pin
  26. tprogs-y += test_cgrp2_attach
  27. tprogs-y += test_cgrp2_sock
  28. tprogs-y += test_cgrp2_sock2
  29. tprogs-y += xdp_router_ipv4
  30. tprogs-y += test_current_task_under_cgroup
  31. tprogs-y += trace_event
  32. tprogs-y += sampleip
  33. tprogs-y += tc_l2_redirect
  34. tprogs-y += lwt_len_hist
  35. tprogs-y += xdp_tx_iptunnel
  36. tprogs-y += test_map_in_map
  37. tprogs-y += per_socket_stats_example
  38. tprogs-y += syscall_tp
  39. tprogs-y += cpustat
  40. tprogs-y += xdp_adjust_tail
  41. tprogs-y += xdp_fwd
  42. tprogs-y += task_fd_query
  43. tprogs-y += ibumad
  44. tprogs-y += hbm
  45. # Libbpf dependencies
  46. LIBBPF_SRC = $(TOOLS_PATH)/lib/bpf
  47. LIBBPF_OUTPUT = $(abspath $(BPF_SAMPLES_PATH))/libbpf
  48. LIBBPF_DESTDIR = $(LIBBPF_OUTPUT)
  49. LIBBPF_INCLUDE = $(LIBBPF_DESTDIR)/include
  50. LIBBPF = $(LIBBPF_OUTPUT)/libbpf.a
  51. CGROUP_HELPERS := ../../tools/testing/selftests/bpf/cgroup_helpers.o
  52. TRACE_HELPERS := ../../tools/testing/selftests/bpf/trace_helpers.o
  53. XDP_SAMPLE := xdp_sample_user.o
  54. fds_example-objs := fds_example.o
  55. sockex1-objs := sockex1_user.o
  56. sockex2-objs := sockex2_user.o
  57. sockex3-objs := sockex3_user.o
  58. tracex1-objs := tracex1_user.o $(TRACE_HELPERS)
  59. tracex3-objs := tracex3_user.o
  60. tracex4-objs := tracex4_user.o
  61. tracex5-objs := tracex5_user.o $(TRACE_HELPERS)
  62. tracex6-objs := tracex6_user.o
  63. tracex7-objs := tracex7_user.o
  64. test_probe_write_user-objs := test_probe_write_user_user.o
  65. trace_output-objs := trace_output_user.o
  66. lathist-objs := lathist_user.o
  67. offwaketime-objs := offwaketime_user.o $(TRACE_HELPERS)
  68. spintest-objs := spintest_user.o $(TRACE_HELPERS)
  69. map_perf_test-objs := map_perf_test_user.o
  70. test_overhead-objs := test_overhead_user.o
  71. test_cgrp2_array_pin-objs := test_cgrp2_array_pin.o
  72. test_cgrp2_attach-objs := test_cgrp2_attach.o
  73. test_cgrp2_sock-objs := test_cgrp2_sock.o
  74. test_cgrp2_sock2-objs := test_cgrp2_sock2.o
  75. test_current_task_under_cgroup-objs := $(CGROUP_HELPERS) \
  76. test_current_task_under_cgroup_user.o
  77. trace_event-objs := trace_event_user.o $(TRACE_HELPERS)
  78. sampleip-objs := sampleip_user.o $(TRACE_HELPERS)
  79. tc_l2_redirect-objs := tc_l2_redirect_user.o
  80. lwt_len_hist-objs := lwt_len_hist_user.o
  81. xdp_tx_iptunnel-objs := xdp_tx_iptunnel_user.o
  82. test_map_in_map-objs := test_map_in_map_user.o
  83. per_socket_stats_example-objs := cookie_uid_helper_example.o
  84. syscall_tp-objs := syscall_tp_user.o
  85. cpustat-objs := cpustat_user.o
  86. xdp_adjust_tail-objs := xdp_adjust_tail_user.o
  87. xdp_fwd-objs := xdp_fwd_user.o
  88. task_fd_query-objs := task_fd_query_user.o $(TRACE_HELPERS)
  89. ibumad-objs := ibumad_user.o
  90. hbm-objs := hbm.o $(CGROUP_HELPERS)
  91. xdp_router_ipv4-objs := xdp_router_ipv4_user.o $(XDP_SAMPLE)
  92. # Tell kbuild to always build the programs
  93. always-y := $(tprogs-y)
  94. always-y += sockex1_kern.o
  95. always-y += sockex2_kern.o
  96. always-y += sockex3_kern.o
  97. always-y += tracex1.bpf.o
  98. always-y += tracex3.bpf.o
  99. always-y += tracex4.bpf.o
  100. always-y += tracex5.bpf.o
  101. always-y += tracex6.bpf.o
  102. always-y += tracex7.bpf.o
  103. always-y += sock_flags.bpf.o
  104. always-y += test_probe_write_user.bpf.o
  105. always-y += trace_output.bpf.o
  106. always-y += tcbpf1_kern.o
  107. always-y += tc_l2_redirect_kern.o
  108. always-y += lathist_kern.o
  109. always-y += offwaketime.bpf.o
  110. always-y += spintest.bpf.o
  111. always-y += map_perf_test.bpf.o
  112. always-y += test_overhead_tp.bpf.o
  113. always-y += test_overhead_raw_tp.bpf.o
  114. always-y += test_overhead_kprobe.bpf.o
  115. always-y += parse_varlen.o parse_simple.o parse_ldabs.o
  116. always-y += test_cgrp2_tc.bpf.o
  117. always-y += test_current_task_under_cgroup.bpf.o
  118. always-y += trace_event_kern.o
  119. always-y += sampleip_kern.o
  120. always-y += lwt_len_hist.bpf.o
  121. always-y += xdp_tx_iptunnel_kern.o
  122. always-y += test_map_in_map.bpf.o
  123. always-y += tcp_synrto_kern.o
  124. always-y += tcp_rwnd_kern.o
  125. always-y += tcp_bufs_kern.o
  126. always-y += tcp_cong_kern.o
  127. always-y += tcp_iw_kern.o
  128. always-y += tcp_clamp_kern.o
  129. always-y += tcp_basertt_kern.o
  130. always-y += tcp_tos_reflect_kern.o
  131. always-y += tcp_dumpstats_kern.o
  132. always-y += xdp2skb_meta_kern.o
  133. always-y += syscall_tp_kern.o
  134. always-y += cpustat_kern.o
  135. always-y += xdp_adjust_tail_kern.o
  136. always-y += xdp_fwd_kern.o
  137. always-y += task_fd_query_kern.o
  138. always-y += ibumad_kern.o
  139. always-y += hbm_out_kern.o
  140. always-y += hbm_edt_kern.o
  141. TPROGS_CFLAGS = $(TPROGS_USER_CFLAGS)
  142. TPROGS_LDFLAGS = $(TPROGS_USER_LDFLAGS)
  143. ifeq ($(ARCH), arm)
  144. # Strip all except -D__LINUX_ARM_ARCH__ option needed to handle linux
  145. # headers when arm instruction set identification is requested.
  146. ARM_ARCH_SELECTOR := $(filter -D__LINUX_ARM_ARCH__%, $(KBUILD_CFLAGS))
  147. BPF_EXTRA_CFLAGS := $(ARM_ARCH_SELECTOR)
  148. TPROGS_CFLAGS += $(ARM_ARCH_SELECTOR)
  149. endif
  150. ifeq ($(ARCH), mips)
  151. TPROGS_CFLAGS += -D__SANE_USERSPACE_TYPES__
  152. ifdef CONFIG_MACH_LOONGSON64
  153. BPF_EXTRA_CFLAGS += -I$(srctree)/arch/mips/include/asm/mach-loongson64
  154. BPF_EXTRA_CFLAGS += -I$(srctree)/arch/mips/include/asm/mach-generic
  155. endif
  156. endif
  157. ifeq ($(ARCH), x86)
  158. BPF_EXTRA_CFLAGS += -fcf-protection
  159. endif
  160. TPROGS_CFLAGS += -Wall -O2
  161. TPROGS_CFLAGS += -Wmissing-prototypes
  162. TPROGS_CFLAGS += -Wstrict-prototypes
  163. TPROGS_CFLAGS += $(call try-run,\
  164. printf "int main() { return 0; }" |\
  165. $(CC) -Werror -fsanitize=bounds -x c - -o "$$TMP",-fsanitize=bounds,)
  166. TPROGS_CFLAGS += -I$(objtree)/usr/include
  167. TPROGS_CFLAGS += -I$(srctree)/tools/testing/selftests/bpf/
  168. TPROGS_CFLAGS += -I$(LIBBPF_INCLUDE)
  169. TPROGS_CFLAGS += -I$(srctree)/tools/include
  170. TPROGS_CFLAGS += -I$(srctree)/tools/perf
  171. TPROGS_CFLAGS += -I$(srctree)/tools/lib
  172. TPROGS_CFLAGS += -DHAVE_ATTR_TEST=0
  173. ifdef SYSROOT
  174. TPROGS_CFLAGS += --sysroot=$(SYSROOT)
  175. TPROGS_LDFLAGS := -L$(SYSROOT)/usr/lib
  176. endif
  177. TPROGS_LDLIBS += $(LIBBPF) -lelf -lz
  178. TPROGLDLIBS_xdp_router_ipv4 += -lm -pthread
  179. TPROGLDLIBS_tracex4 += -lrt
  180. TPROGLDLIBS_trace_output += -lrt
  181. TPROGLDLIBS_map_perf_test += -lrt
  182. TPROGLDLIBS_test_overhead += -lrt
  183. # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline:
  184. # make M=samples/bpf LLC=~/git/llvm-project/llvm/build/bin/llc CLANG=~/git/llvm-project/llvm/build/bin/clang
  185. LLC ?= llc
  186. CLANG ?= clang
  187. OPT ?= opt
  188. LLVM_DIS ?= llvm-dis
  189. LLVM_OBJCOPY ?= llvm-objcopy
  190. LLVM_READELF ?= llvm-readelf
  191. BTF_PAHOLE ?= pahole
  192. # Detect that we're cross compiling and use the cross compiler
  193. ifdef CROSS_COMPILE
  194. CLANG_ARCH_ARGS = --target=$(notdir $(CROSS_COMPILE:%-=%))
  195. endif
  196. # Don't evaluate probes and warnings if we need to run make recursively
  197. ifneq ($(src),)
  198. HDR_PROBE := $(shell printf "$(pound)include <linux/types.h>\n struct list_head { int a; }; int main() { return 0; }" | \
  199. $(CC) $(TPROGS_CFLAGS) $(TPROGS_LDFLAGS) -x c - \
  200. -o /dev/null 2>/dev/null && echo okay)
  201. ifeq ($(HDR_PROBE),)
  202. $(warning WARNING: Detected possible issues with include path.)
  203. $(warning WARNING: Please install kernel headers locally (make headers_install).)
  204. endif
  205. BTF_LLC_PROBE := $(shell $(LLC) -march=bpf -mattr=help 2>&1 | grep dwarfris)
  206. BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
  207. BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
  208. BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
  209. $(CLANG) --target=bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
  210. $(LLVM_READELF) -S ./llvm_btf_verify.o | grep BTF; \
  211. /bin/rm -f ./llvm_btf_verify.o)
  212. BPF_EXTRA_CFLAGS += -fno-stack-protector
  213. ifneq ($(BTF_LLVM_PROBE),)
  214. BPF_EXTRA_CFLAGS += -g
  215. else
  216. ifneq ($(and $(BTF_LLC_PROBE),$(BTF_PAHOLE_PROBE),$(BTF_OBJCOPY_PROBE)),)
  217. BPF_EXTRA_CFLAGS += -g
  218. LLC_FLAGS += -mattr=dwarfris
  219. DWARF2BTF = y
  220. endif
  221. endif
  222. endif
  223. # Trick to allow make to be run from this directory
  224. all:
  225. $(MAKE) -C ../../ M=$(CURDIR) BPF_SAMPLES_PATH=$(CURDIR)
  226. clean:
  227. $(MAKE) -C ../../ M=$(CURDIR) clean
  228. @find $(CURDIR) -type f -name '*~' -delete
  229. @$(RM) -r $(CURDIR)/libbpf $(CURDIR)/bpftool
  230. $(LIBBPF): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OUTPUT)
  231. # Fix up variables inherited from Kbuild that tools/ build system won't like
  232. $(MAKE) -C $(LIBBPF_SRC) RM='rm -rf' EXTRA_CFLAGS="$(TPROGS_CFLAGS)" \
  233. LDFLAGS="$(TPROGS_LDFLAGS)" srctree=$(BPF_SAMPLES_PATH)/../../ \
  234. O= OUTPUT=$(LIBBPF_OUTPUT)/ DESTDIR=$(LIBBPF_DESTDIR) prefix= \
  235. $@ install_headers
  236. BPFTOOLDIR := $(TOOLS_PATH)/bpf/bpftool
  237. BPFTOOL_OUTPUT := $(abspath $(BPF_SAMPLES_PATH))/bpftool
  238. DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)/bootstrap/bpftool
  239. BPFTOOL ?= $(DEFAULT_BPFTOOL)
  240. $(DEFAULT_BPFTOOL): $(wildcard $(BPFTOOLDIR)/*.[ch] $(BPFTOOLDIR)/Makefile) | $(BPFTOOL_OUTPUT)
  241. $(MAKE) -C $(BPFTOOLDIR) srctree=$(BPF_SAMPLES_PATH)/../../ \
  242. OUTPUT=$(BPFTOOL_OUTPUT)/ bootstrap
  243. $(LIBBPF_OUTPUT) $(BPFTOOL_OUTPUT):
  244. $(call msg,MKDIR,$@)
  245. $(Q)mkdir -p $@
  246. $(obj)/syscall_nrs.h: $(obj)/syscall_nrs.s FORCE
  247. $(call filechk,offsets,__SYSCALL_NRS_H__)
  248. targets += syscall_nrs.s
  249. clean-files += syscall_nrs.h
  250. FORCE:
  251. # Verify LLVM compiler tools are available and bpf target is supported by llc
  252. .PHONY: verify_cmds verify_target_bpf $(CLANG) $(LLC)
  253. verify_cmds: $(CLANG) $(LLC)
  254. @for TOOL in $^ ; do \
  255. if ! (which -- "$${TOOL}" > /dev/null 2>&1); then \
  256. echo "*** ERROR: Cannot find LLVM tool $${TOOL}" ;\
  257. exit 1; \
  258. else true; fi; \
  259. done
  260. verify_target_bpf: verify_cmds
  261. @if ! (${LLC} -march=bpf -mattr=help > /dev/null 2>&1); then \
  262. echo "*** ERROR: LLVM (${LLC}) does not support 'bpf' target" ;\
  263. echo " NOTICE: LLVM version >= 3.7.1 required" ;\
  264. exit 2; \
  265. else true; fi
  266. $(BPF_SAMPLES_PATH)/*.c: verify_target_bpf $(LIBBPF)
  267. $(src)/*.c: verify_target_bpf $(LIBBPF)
  268. libbpf_hdrs: $(LIBBPF)
  269. $(obj)/$(TRACE_HELPERS) $(obj)/$(CGROUP_HELPERS) $(obj)/$(XDP_SAMPLE): | libbpf_hdrs
  270. .PHONY: libbpf_hdrs
  271. $(obj)/xdp_router_ipv4_user.o: $(obj)/xdp_router_ipv4.skel.h
  272. $(obj)/tracex5.bpf.o: $(obj)/syscall_nrs.h
  273. $(obj)/hbm_out_kern.o: $(src)/hbm.h $(src)/hbm_kern.h
  274. $(obj)/hbm.o: $(src)/hbm.h
  275. $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h
  276. # Override includes for xdp_sample_user.o because $(srctree)/usr/include in
  277. # TPROGS_CFLAGS causes conflicts
  278. XDP_SAMPLE_CFLAGS += -Wall -O2 \
  279. -I$(src)/../../tools/include \
  280. -I$(src)/../../tools/include/uapi \
  281. -I$(LIBBPF_INCLUDE) \
  282. -I$(src)/../../tools/testing/selftests/bpf
  283. $(obj)/$(XDP_SAMPLE): TPROGS_CFLAGS = $(XDP_SAMPLE_CFLAGS) $(TPROGS_USER_CFLAGS)
  284. $(obj)/$(XDP_SAMPLE): $(src)/xdp_sample_user.h $(src)/xdp_sample_shared.h
  285. # Override includes for trace_helpers.o because __must_check won't be defined
  286. # in our include path.
  287. $(obj)/$(TRACE_HELPERS): TPROGS_CFLAGS := $(TPROGS_CFLAGS) -D__must_check=
  288. -include $(BPF_SAMPLES_PATH)/Makefile.target
  289. VMLINUX_BTF_PATHS ?= $(abspath $(if $(O),$(O)/vmlinux)) \
  290. $(abspath $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux)) \
  291. $(abspath ./vmlinux)
  292. VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS))))
  293. $(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL)
  294. ifeq ($(VMLINUX_H),)
  295. ifeq ($(VMLINUX_BTF),)
  296. $(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)",\
  297. build the kernel or set VMLINUX_BTF like "VMLINUX_BTF=/sys/kernel/btf/vmlinux" or VMLINUX_H variable)
  298. endif
  299. $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@
  300. else
  301. $(Q)cp "$(VMLINUX_H)" $@
  302. endif
  303. clean-files += vmlinux.h
  304. # Get Clang's default includes on this system, as opposed to those seen by
  305. # '--target=bpf'. This fixes "missing" files on some architectures/distros,
  306. # such as asm/byteorder.h, asm/socket.h, asm/sockios.h, sys/cdefs.h etc.
  307. #
  308. # Use '-idirafter': Don't interfere with include mechanics except where the
  309. # build would have failed anyways.
  310. define get_sys_includes
  311. $(shell $(1) -v -E - </dev/null 2>&1 \
  312. | sed -n '/<...> search starts here:/,/End of search list./{ s| \(/.*\)|-idirafter \1|p }') \
  313. $(shell $(1) -dM -E - </dev/null | grep '#define __riscv_xlen ' | sed 's/#define /-D/' | sed 's/ /=/')
  314. endef
  315. CLANG_SYS_INCLUDES = $(call get_sys_includes,$(CLANG))
  316. $(obj)/xdp_router_ipv4.bpf.o: $(obj)/xdp_sample.bpf.o
  317. $(obj)/%.bpf.o: $(src)/%.bpf.c $(obj)/vmlinux.h $(src)/xdp_sample.bpf.h $(src)/xdp_sample_shared.h
  318. @echo " CLANG-BPF " $@
  319. $(Q)$(CLANG) -g -O2 --target=bpf -D__TARGET_ARCH_$(SRCARCH) \
  320. -Wno-compare-distinct-pointer-types -I$(srctree)/include \
  321. -I$(srctree)/samples/bpf -I$(srctree)/tools/include \
  322. -I$(LIBBPF_INCLUDE) $(CLANG_SYS_INCLUDES) \
  323. -c $(filter %.bpf.c,$^) -o $@
  324. LINKED_SKELS := xdp_router_ipv4.skel.h
  325. clean-files += $(LINKED_SKELS)
  326. xdp_router_ipv4.skel.h-deps := xdp_router_ipv4.bpf.o xdp_sample.bpf.o
  327. LINKED_BPF_SRCS := $(patsubst %.bpf.o,%.bpf.c,$(foreach skel,$(LINKED_SKELS),$($(skel)-deps)))
  328. BPF_SRCS_LINKED := $(notdir $(wildcard $(src)/*.bpf.c))
  329. BPF_OBJS_LINKED := $(patsubst %.bpf.c,$(obj)/%.bpf.o, $(BPF_SRCS_LINKED))
  330. BPF_SKELS_LINKED := $(addprefix $(obj)/,$(LINKED_SKELS))
  331. $(BPF_SKELS_LINKED): $(BPF_OBJS_LINKED) $(BPFTOOL)
  332. @echo " BPF GEN-OBJ " $(@:.skel.h=)
  333. $(Q)$(BPFTOOL) gen object $(@:.skel.h=.lbpf.o) $(addprefix $(obj)/,$($(@F)-deps))
  334. @echo " BPF GEN-SKEL" $(@:.skel.h=)
  335. $(Q)$(BPFTOOL) gen skeleton $(@:.skel.h=.lbpf.o) name $(notdir $(@:.skel.h=)) > $@
  336. # asm/sysreg.h - inline assembly used by it is incompatible with llvm.
  337. # But, there is no easy way to fix it, so just exclude it since it is
  338. # useless for BPF samples.
  339. # below we use long chain of commands, clang | opt | llvm-dis | llc,
  340. # to generate final object file. 'clang' compiles the source into IR
  341. # with native target, e.g., x64, arm64, etc. 'opt' does bpf CORE IR builtin
  342. # processing (llvm12) and IR optimizations. 'llvm-dis' converts
  343. # 'opt' output to IR, and finally 'llc' generates bpf byte code.
  344. $(obj)/%.o: $(src)/%.c
  345. @echo " CLANG-bpf " $@
  346. $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(BPF_EXTRA_CFLAGS) \
  347. -I$(obj) -I$(srctree)/tools/testing/selftests/bpf/ \
  348. -I$(LIBBPF_INCLUDE) $(CLANG_SYS_INCLUDES) \
  349. -D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \
  350. -D__TARGET_ARCH_$(SRCARCH) -Wno-compare-distinct-pointer-types \
  351. -Wno-gnu-variable-sized-type-not-at-end \
  352. -Wno-address-of-packed-member -Wno-tautological-compare \
  353. -Wno-unknown-warning-option $(CLANG_ARCH_ARGS) \
  354. -fno-asynchronous-unwind-tables \
  355. -I$(srctree)/samples/bpf/ -include asm_goto_workaround.h \
  356. -O2 -emit-llvm -Xclang -disable-llvm-passes -c $< -o - | \
  357. $(OPT) -O2 -mtriple=bpf-pc-linux | $(LLVM_DIS) | \
  358. $(LLC) -march=bpf $(LLC_FLAGS) -filetype=obj -o $@
  359. ifeq ($(DWARF2BTF),y)
  360. $(BTF_PAHOLE) -J $@
  361. endif