Skip to content

Commit 34f6e38

Browse files
DanielTimLeeAlexei Starovoitov
authored andcommitted
samples/bpf: fix warning with ignored-attributes
Currently, compiling the bpf programs will result the warning with the ignored attribute as follows. This commit fixes the warning by adding cf-protection option. In file included from ./arch/x86/include/asm/linkage.h:6: ./arch/x86/include/asm/ibt.h:77:8: warning: 'nocf_check' attribute ignored; use -fcf-protection to enable the attribute [-Wignored-attributes] extern __noendbr u64 ibt_save(bool disable); ^ ./arch/x86/include/asm/ibt.h:32:34: note: expanded from macro '__noendbr' ^ Signed-off-by: Daniel T. Lee <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 5bebd3e commit 34f6e38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

samples/bpf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ $(obj)/%.o: $(src)/%.c
440440
-Wno-gnu-variable-sized-type-not-at-end \
441441
-Wno-address-of-packed-member -Wno-tautological-compare \
442442
-Wno-unknown-warning-option $(CLANG_ARCH_ARGS) \
443-
-fno-asynchronous-unwind-tables \
443+
-fno-asynchronous-unwind-tables -fcf-protection \
444444
-I$(srctree)/samples/bpf/ -include asm_goto_workaround.h \
445445
-O2 -emit-llvm -Xclang -disable-llvm-passes -c $< -o - | \
446446
$(OPT) -O2 -mtriple=bpf-pc-linux | $(LLVM_DIS) | \

0 commit comments

Comments
 (0)