[dpdk-dev] [PATCH v3] build: fix SVE compile error with gcc8.3

Thomas Monjalon thomas at monjalon.net
Wed Jun 23 10:05:37 CEST 2021


21/05/2021 03:53, Chengwen Feng:
> If the target machine has SVE feature (e.g. "-march=armv8.2-a+sve'),
> and the compiler are 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 <arm_sve.h>
> 	       ^~~~~~~~~~~
> 	compilation terminated.
> 
> The root cause is that gcc8.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
> 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
> <arm_sve.h>, user should include it when writing ACLE SVE code.
> 
> Fixes: 67b68824a82d ("lpm/arm: support SVE")
> 
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> ---
> --- a/config/arm/meson.build
> +++ b/config/arm/meson.build
> +if (cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != '' and
> +        cc.check_header('arm_sve.h'))
> +    dpdk_conf.set('CC_SVE_ACLE_SUPPORT', 1)

Any defined flag should start with RTE_.
I suggest RTE_HAS_SVE_ACLE.

Please add a comment before defining this flag to explain what it is.




More information about the dev mailing list