Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4054158pxb; Tue, 26 Jan 2021 11:07:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSEN7QrDFxVXuy6b791nbZUuHuVerZhRw6HZo1DQlz+sufhmh0HKS1cf6HGhLhIcIxr87P X-Received: by 2002:a05:6402:b6f:: with SMTP id cb15mr5656370edb.277.1611688066542; Tue, 26 Jan 2021 11:07:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611688066; cv=none; d=google.com; s=arc-20160816; b=DolSz1+/gvXOe5STw2loVZNKmm7PgyTe1JcwBmJoEdqCeAxGvb/BkKKzWjAJbhFRst beo2W+r7tQgEynyI/o+ITK7B3VDEneWLncDF2+GSTwgWe6zkv0Upx2G0yTR4FSwh8MLO BfyQvRvLOO5rvkcOU8MLxnt+G7yTtxs4x1weln0S06+Q1r7A6TAmTYWKDMlLi8R8eW6U reobAhnKRfrxFjA9P3fQMNxiU5UXtmhZKLq3k96Fv+Rj0HVJS983lT1Ml+d76vYUVN1p TWNTTt+PSnlKbw+GM/Rlcp+JkumnWV+yUJaqjDt2O416tgO92bnNzxnv6DmlavszFM/f 3J5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=UuF43E8EnUln3vZwwElZft3nZO7UMfmCg0Zs0Yp3vQE=; b=CWRLq0lsU9sJE2PY+PvNiFFkRZj8gx6++AHPk7TO+0KMw6stubh305QMOsdvb6OPhj shHrs7CYu/IAZrwTyTgFT2qBI84hIEOfw7UA0CLu921PX2ki9XzpPITwn9SWm/tN0eqU JOyLng4Qb/mqn8tleureZLtX3+5uNOX0Ypz7aaVUkSj5DqO7bsVzAkB+yF6ohEuMawhK gPPfR/aeQMyqJHz9ozBV0rKMonJXvJqYn4q5re4sWAiwuVRVxemOyPxvcdmPwr+2A6cJ 0VO1auzyyUcEBTbYrS16yP71TcDfjbI5pvDpiTtSsSt4DRhvsFp0KZttwN3bfriSkZ8J zBTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kl4si4486924ejc.341.2021.01.26.11.07.19; Tue, 26 Jan 2021 11:07:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405819AbhAZOKv (ORCPT + 99 others); Tue, 26 Jan 2021 09:10:51 -0500 Received: from mail.loongson.cn ([114.242.206.163]:49896 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391768AbhAZOGi (ORCPT ); Tue, 26 Jan 2021 09:06:38 -0500 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxRb2nIRBg_DsNAA--.17412S2; Tue, 26 Jan 2021 22:05:28 +0800 (CST) From: Tiezhu Yang To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Nathan Chancellor , Nick Desaulniers Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, clang-built-linux@googlegroups.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: [PATCH bpf-next] samples/bpf: Add include dir for MIPS Loongson64 to fix build errors Date: Tue, 26 Jan 2021 22:05:25 +0800 Message-Id: <1611669925-25315-1-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-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VjvjDU0xZFpf9x0JUWlksUUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There exists many build errors when make M=samples/bpf on the Loongson platform, this issue is MIPS related, x86 compiles just fine. Here are some errors: CLANG-bpf samples/bpf/sockex2_kern.o In file included from samples/bpf/sockex2_kern.c:2: In file included from ./include/uapi/linux/in.h:24: In file included from ./include/linux/socket.h:8: In file included from ./include/linux/uio.h:8: In file included from ./include/linux/kernel.h:11: In file included from ./include/linux/bitops.h:32: In file included from ./arch/mips/include/asm/bitops.h:19: In file included from ./arch/mips/include/asm/barrier.h:11: ./arch/mips/include/asm/addrspace.h:13:10: fatal error: 'spaces.h' file not found ^~~~~~~~~~ 1 error generated. CLANG-bpf samples/bpf/sockex2_kern.o In file included from samples/bpf/sockex2_kern.c:2: In file included from ./include/uapi/linux/in.h:24: In file included from ./include/linux/socket.h:8: In file included from ./include/linux/uio.h:8: In file included from ./include/linux/kernel.h:11: In file included from ./include/linux/bitops.h:32: In file included from ./arch/mips/include/asm/bitops.h:22: In file included from ./arch/mips/include/asm/cpu-features.h:13: In file included from ./arch/mips/include/asm/cpu-info.h:15: In file included from ./include/linux/cache.h:6: ./arch/mips/include/asm/cache.h:12:10: fatal error: 'kmalloc.h' file not found ^~~~~~~~~~~ 1 error generated. CLANG-bpf samples/bpf/sockex2_kern.o In file included from samples/bpf/sockex2_kern.c:2: In file included from ./include/uapi/linux/in.h:24: In file included from ./include/linux/socket.h:8: In file included from ./include/linux/uio.h:8: In file included from ./include/linux/kernel.h:11: In file included from ./include/linux/bitops.h:32: In file included from ./arch/mips/include/asm/bitops.h:22: ./arch/mips/include/asm/cpu-features.h:15:10: fatal error: 'cpu-feature-overrides.h' file not found ^~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. $ find arch/mips/include/asm -name spaces.h | sort arch/mips/include/asm/mach-ar7/spaces.h ... arch/mips/include/asm/mach-generic/spaces.h ... arch/mips/include/asm/mach-loongson64/spaces.h ... arch/mips/include/asm/mach-tx49xx/spaces.h $ find arch/mips/include/asm -name kmalloc.h | sort arch/mips/include/asm/mach-generic/kmalloc.h arch/mips/include/asm/mach-ip32/kmalloc.h arch/mips/include/asm/mach-tx49xx/kmalloc.h $ find arch/mips/include/asm -name cpu-feature-overrides.h | sort arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h ... arch/mips/include/asm/mach-generic/cpu-feature-overrides.h ... arch/mips/include/asm/mach-loongson64/cpu-feature-overrides.h ... arch/mips/include/asm/mach-tx49xx/cpu-feature-overrides.h In the arch/mips/Makefile, there exists the following board-dependent options: include arch/mips/Kbuild.platforms cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic So we can do the similar things in samples/bpf/Makefile, just add platform specific and generic include dir for MIPS Loongson64 to fix the build errors. Signed-off-by: Tiezhu Yang --- samples/bpf/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 362f314..45ceca4 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -185,6 +185,10 @@ endif ifeq ($(ARCH), mips) TPROGS_CFLAGS += -D__SANE_USERSPACE_TYPES__ +ifdef CONFIG_MACH_LOONGSON64 +BPF_EXTRA_CFLAGS += -I$(srctree)/arch/mips/include/asm/mach-loongson64 +BPF_EXTRA_CFLAGS += -I$(srctree)/arch/mips/include/asm/mach-generic +endif endif TPROGS_CFLAGS += -Wall -O2 -- 2.1.0