bpf: Replace deprecated -target with --target= for ClangThe -target option has been deprecated since clang 3.4 in 2013. Therefore, usethe preferred --target=bpf form instead. This also matches how
bpf: Replace deprecated -target with --target= for ClangThe -target option has been deprecated since clang 3.4 in 2013. Therefore, usethe preferred --target=bpf form instead. This also matches how we use --target=in scripts/Makefile.clang.Signed-off-by: Fangrui Song <maskray@google.com>Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>Acked-by: Yonghong Song <yhs@fb.com>Acked-by: Quentin Monnet <quentin@isovalent.com>Link: https://github.com/llvm/llvm-project/commit/274b6f0c87a6a1798de0a68135afc7f95def6277Link: https://lore.kernel.org/bpf/20230624001856.1903733-1-maskray@google.com
show more ...
samples/bpf: Change _kern suffix to .bpf with syscall tracing programCurrently old compile rule (CLANG-bpf) doesn't contains VMLINUX_H defineflag which is essential for the bpf program that includ
samples/bpf: Change _kern suffix to .bpf with syscall tracing programCurrently old compile rule (CLANG-bpf) doesn't contains VMLINUX_H defineflag which is essential for the bpf program that includes "vmlinux.h".Also old compile rule doesn't directly specify the compile target as bpf,instead it uses bunch of extra options with clang followed by long chainof commands. (e.g. clang | opt | llvm-dis | llc)In Makefile, there is already new compile rule which is more simple andneat. And it also has -D__VMLINUX_H__ option. By just changing the _kernsuffix to .bpf will inherit the benefit of the new CLANG-BPF compiletarget.Also, this commit adds dummy gnu/stub.h to the samples/bpf directory.As commit 1c2dd16add7e ("selftests/bpf: get rid of -D__x86_64__") noted,compiling with 'clang -target bpf' will raise an error with stubs.hunless workaround (-D__x86_64) is used. This commit solves this problemby adding dummy stub.h to make /usr/include/features.h to follow theexpected path as the same way selftests/bpf dealt with.Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>Signed-off-by: Andrii Nakryiko <andrii@kernel.org>Link: https://lore.kernel.org/bpf/20221224071527.2292-4-danieltimlee@gmail.com