diff options
-rw-r--r-- | samples/bpf/Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 79b4596b5f9a..edd638b5825f 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile | |||
@@ -67,10 +67,13 @@ HOSTLOADLIBES_lathist += -lelf | |||
67 | # point this to your LLVM backend with bpf support | 67 | # point this to your LLVM backend with bpf support |
68 | LLC=$(srctree)/tools/bpf/llvm/bld/Debug+Asserts/bin/llc | 68 | LLC=$(srctree)/tools/bpf/llvm/bld/Debug+Asserts/bin/llc |
69 | 69 | ||
70 | # asm/sysreg.h inline assmbly used by it is incompatible with llvm. | ||
71 | # But, ehere is not easy way to fix it, so just exclude it since it is | ||
72 | # useless for BPF samples. | ||
70 | $(obj)/%.o: $(src)/%.c | 73 | $(obj)/%.o: $(src)/%.c |
71 | clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ | 74 | clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ |
72 | -D__KERNEL__ -Wno-unused-value -Wno-pointer-sign \ | 75 | -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ |
73 | -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ | 76 | -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ |
74 | clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ | 77 | clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ |
75 | -D__KERNEL__ -Wno-unused-value -Wno-pointer-sign \ | 78 | -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unused-value -Wno-pointer-sign \ |
76 | -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=asm -o $@.s | 79 | -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=asm -o $@.s |