config/arm: fix SVE build with GCC 8.3
authorChengwen Feng <fengchengwen@huawei.com>
Mon, 28 Jun 2021 02:57:50 +0000 (10:57 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 9 Jul 2021 20:25:24 +0000 (22:25 +0200)
commit5aa9189d745ff0c3de925992ada88a277957215e
treeeb76f0c65cf208a1c96e114790d7917f22e1c7ab
parentcac2a49b4ae5e24078b43b2f8b7cd083f74620b9
config/arm: fix SVE build with GCC 8.3

If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'),
and the compiler is gcc-8.3, it will produce this error:
In file included from lib/eal/common/eal_common_options.c:38:
lib/eal/arm/include/rte_vect.h:13:10: fatal error:
arm_sve.h: No such file or directory
#include <arm_sve.h>
       ^~~~~~~~~~~

The root cause is that gcc-8.3 supports 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
RTE_HAS_SVE_ACLE macro.
b) Use the RTE_HAS_SVE_ACLE macro to include SVE header file.

[1] ACLE:  Arm C Language Extensions, the SVE ACLE header file is
<arm_sve.h>, user should include it when writing ACLE SVE code.

Fixes: 67b68824a82d ("lpm/arm: support SVE")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Ruifeng Wang <ruifeng.wang@arm.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
config/arm/meson.build
lib/eal/arm/include/rte_vect.h
lib/lpm/rte_lpm.h