Re: [dpdk-dev] [PATCH v5 2/2] net/hns3: refactor SVE code compile method
From: fengchengwen <hidden>
Date: 2021-05-19 13:35:19
On 2021/5/19 20:37, David Marchand wrote:
On Wed, May 19, 2021 at 2:17 PM fengchengwen [off-list ref] wrote:quoted
We also found compile error with gcc8.3 with arm64_kunpeng930_linux_gcc (-march=-march=armv8.2-a+crypto+sve): 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. [126/2250] Compiling C object lib/librte_net.a.p/net_rte_net_crc.c.o the corresponding code: #ifdef __ARM_FEATURE_SVE #include <arm_sve.h> #endif this is because gcc8.3 defined __ARM_FEATURE_SVE but it can't compile ACLE SVE code.Afaiu, gcc 8.3 does not define __ARM_FEATURE_SVE: $ aarch64-linux-gnu-gcc --version aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ aarch64-linux-gnu-gcc - -pipe -E -P -D_FILE_OFFSET_BITS=64 -P -O0 -march=armv8-a+crc <<EOFquoted
#ifndef __ARM_FEATURE_SVE # define __ARM_FEATURE_SVE #endif "MESON_GET_DEFINE_DELIMITER" __ARM_FEATURE_SVE EOF"MESON_GET_DEFINE_DELIMITER"
You should add sve in '-march' parameter, the same gcc version's output: ./aarch64-linux-gnu-gcc --version aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ./aarch64-linux-gnu-gcc -march=armv8.2-a+sve -dM -E - </dev/null 2>&1 | grep SVE #define __ARM_FEATURE_SVE 1 #define __ARM_FEATURE_SVE_BITS 0 ./aarch64-linux-gnu-gcc -march=armv8-a+sve -dM -E - </dev/null 2>&1 | grep SVE #define __ARM_FEATURE_SVE 1 #define __ARM_FEATURE_SVE_BITS 0