Skip to content

Commit 5aa9189

Browse files
fengchengwentmonjalo
authored andcommitted
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: 67b6882 ("lpm/arm: support SVE") Cc: [email protected] Signed-off-by: Chengwen Feng <[email protected]> Acked-by: Ruifeng Wang <[email protected]> Signed-off-by: Thomas Monjalon <[email protected]>
1 parent cac2a49 commit 5aa9189

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

config/arm/meson.build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,9 @@ endif
524524

525525
if cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != ''
526526
compile_time_cpuflags += ['RTE_CPUFLAG_SVE']
527+
if (cc.check_header('arm_sve.h'))
528+
dpdk_conf.set('RTE_HAS_SVE_ACLE', 1)
529+
endif
527530
endif
528531

529532
if cc.get_define('__ARM_FEATURE_CRC32', args: machine_args) != ''

lib/eal/arm/include/rte_vect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "generic/rte_vect.h"
1010
#include "rte_debug.h"
1111
#include "arm_neon.h"
12-
#ifdef __ARM_FEATURE_SVE
12+
#ifdef RTE_HAS_SVE_ACLE
1313
#include <arm_sve.h>
1414
#endif
1515

lib/lpm/rte_lpm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],
402402
uint32_t defv);
403403

404404
#if defined(RTE_ARCH_ARM)
405-
#ifdef __ARM_FEATURE_SVE
405+
#ifdef RTE_HAS_SVE_ACLE
406406
#include "rte_lpm_sve.h"
407407
#else
408408
#include "rte_lpm_neon.h"

0 commit comments

Comments
 (0)