From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A912BA0A02; Fri, 21 May 2021 03:57:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8F90E40143; Fri, 21 May 2021 03:57:34 +0200 (CEST) Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by mails.dpdk.org (Postfix) with ESMTP id 6559940041 for ; Fri, 21 May 2021 03:57:33 +0200 (CEST) Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FmV6D12RgzBvPp; Fri, 21 May 2021 09:54:44 +0800 (CST) Received: from dggpeml500024.china.huawei.com (7.185.36.10) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 21 May 2021 09:57:32 +0800 Received: from [127.0.0.1] (10.40.190.165) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 21 May 2021 09:57:31 +0800 To: Bruce Richardson CC: , , , , , , References: <1621495007-28387-1-git-send-email-fengchengwen@huawei.com> <1621510812-45405-1-git-send-email-fengchengwen@huawei.com> From: fengchengwen Message-ID: Date: Fri, 21 May 2021 09:57:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.40.190.165] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpeml500024.china.huawei.com (7.185.36.10) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH v2] build: fix SVE compile error with gcc8.3 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix in v3, also with minor changes, thanks On 2021/5/20 21:09, Bruce Richardson wrote: > On Thu, May 20, 2021 at 07:40:12PM +0800, Chengwen Feng wrote: >> If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'), >> and the compiler is gcc8.3, it will compile error: >> In file included from ../dpdk-next-net/lib/eal/common/ >> eal_common_options.c:38: >> ../dpdk-next-net/lib/eal/arm/include/rte_vect.h:13:10: fatal >> error: arm_sve.h: No such file or directory >> #include >> ^~~~~~~~~~~ >> compilation terminated. >> >> The root cause is that gcc8.3 support SVE (the macro __ARM_FEATURE_SVE >> was 1), but it doesn't support SVE ACLE [1]. >> >> The solution: >> a) Detect compiler whether support SVE ACLE, if support then define >> CC_SVE_ACLE_SUPPORT macro. >> b) Use the CC_SVE_ACLE_SUPPORT macro to include SVE header file. >> >> [1] ACLE: Arm C Language Extensions, the SVE ACLE header file is >> , user should include it when writing ACLE SVE code. >> >> Fixes: 67b68824a82d ("lpm/arm: support SVE") >> >> Signed-off-by: Chengwen Feng >> --- >> v2: >> * modify title start with 'build' >> > > One minor comment inline below. > /Bruce >> --- >> config/arm/meson.build | 5 +++++ >> lib/eal/arm/include/rte_vect.h | 2 +- >> lib/lpm/rte_lpm.h | 2 +- >> 3 files changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/config/arm/meson.build b/config/arm/meson.build >> index e83a56e..bff70e4 100644 >> --- a/config/arm/meson.build >> +++ b/config/arm/meson.build >> @@ -480,6 +480,11 @@ if (cc.get_define('__ARM_NEON', args: machine_args) != '' or >> compile_time_cpuflags += ['RTE_CPUFLAG_NEON'] >> endif >> >> +if (cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != '' and >> + cc.check_header('arm_sve.h')) > Please double-indent this line. It looks like part of the condition body > as-is. > > > . >