]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
samples/bpf: build with -D__TARGET_ARCH_$(SRCARCH)
authorIlya Leoshkevich <iii@linux.ibm.com>
Mon, 15 Jul 2019 09:11:03 +0000 (11:11 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 15 Jul 2019 21:13:17 +0000 (23:13 +0200)
While $ARCH can be relatively flexible (see Makefile and
tools/scripts/Makefile.arch), $SRCARCH always corresponds to a directory
name under arch/.

Therefore, build samples with -D__TARGET_ARCH_$(SRCARCH), since that
matches the expectations of bpf_helpers.h.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Vasily Gorbik <gor@linux.ibm.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
samples/bpf/Makefile

index f90daadfbc89cd59f3df0824864b2f872e66a293..1d9be26b4edd79b2ad0f4661411790d9e71d45dd 100644 (file)
@@ -284,7 +284,7 @@ $(obj)/%.o: $(src)/%.c
        $(Q)$(CLANG) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) -I$(obj) \
                -I$(srctree)/tools/testing/selftests/bpf/ \
                -D__KERNEL__ -D__BPF_TRACING__ -Wno-unused-value -Wno-pointer-sign \
-               -D__TARGET_ARCH_$(ARCH) -Wno-compare-distinct-pointer-types \
+               -D__TARGET_ARCH_$(SRCARCH) -Wno-compare-distinct-pointer-types \
                -Wno-gnu-variable-sized-type-not-at-end \
                -Wno-address-of-packed-member -Wno-tautological-compare \
                -Wno-unknown-warning-option $(CLANG_ARCH_ARGS) \