mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
samples/bpf: Use own EXTRA_CFLAGS for clang commands
It can overlap with CFLAGS used for libraries built with gcc if not now then in next patches. Correct it here for simplicity. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Andrii Nakryiko <andriin@fb.com> Link: https://lore.kernel.org/bpf/20191011002808.28206-5-ivan.khoronzhuk@linaro.org
This commit is contained in:
parent
518c13401e
commit
2a560df7c1
@ -218,10 +218,10 @@ BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
|
|||||||
/bin/rm -f ./llvm_btf_verify.o)
|
/bin/rm -f ./llvm_btf_verify.o)
|
||||||
|
|
||||||
ifneq ($(BTF_LLVM_PROBE),)
|
ifneq ($(BTF_LLVM_PROBE),)
|
||||||
EXTRA_CFLAGS += -g
|
BPF_EXTRA_CFLAGS += -g
|
||||||
else
|
else
|
||||||
ifneq ($(and $(BTF_LLC_PROBE),$(BTF_PAHOLE_PROBE),$(BTF_OBJCOPY_PROBE)),)
|
ifneq ($(and $(BTF_LLC_PROBE),$(BTF_PAHOLE_PROBE),$(BTF_OBJCOPY_PROBE)),)
|
||||||
EXTRA_CFLAGS += -g
|
BPF_EXTRA_CFLAGS += -g
|
||||||
LLC_FLAGS += -mattr=dwarfris
|
LLC_FLAGS += -mattr=dwarfris
|
||||||
DWARF2BTF = y
|
DWARF2BTF = y
|
||||||
endif
|
endif
|
||||||
@ -280,8 +280,9 @@ $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h
|
|||||||
# useless for BPF samples.
|
# useless for BPF samples.
|
||||||
$(obj)/%.o: $(src)/%.c
|
$(obj)/%.o: $(src)/%.c
|
||||||
@echo " CLANG-bpf " $@
|
@echo " CLANG-bpf " $@
|
||||||
$(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \
|
$(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(BPF_EXTRA_CFLAGS) \
|
||||||
-I$(srctree)/tools/testing/selftests/bpf/ -I$(srctree)/tools/lib/bpf/ \
|
-I$(obj) -I$(srctree)/tools/testing/selftests/bpf/ \
|
||||||
|
-I$(srctree)/tools/lib/bpf/ \
|
||||||
-D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \
|
-D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \
|
||||||
-D__TARGET_ARCH_$(SRCARCH) -Wno-compare-distinct-pointer-types \
|
-D__TARGET_ARCH_$(SRCARCH) -Wno-compare-distinct-pointer-types \
|
||||||
-Wno-gnu-variable-sized-type-not-at-end \
|
-Wno-gnu-variable-sized-type-not-at-end \
|
||||||
|
Loading…
Reference in New Issue
Block a user