On Wed, May 19, 2021 at 1:57 PM Chengwen Feng <fengcheng...@huawei.com> wrote: > > Compile error with gcc8.3 and crossfile arm64_thunderx2_linux_gcc: > ../drivers/net/hns3/hns3_rxtx_vec_sve.c > cc1: error: switch ‘-mcpu=armv8.1-a’ conflicts with > ‘-march=armv8.2-a’ switch [-Werror] > ../drivers/net/hns3/hns3_rxtx_vec_sve.c:5:10: fatal error: > arm_sve.h: No such file or directory > 5 | #include <arm_sve.h> > > The root cause is that gcc8.3 supports SVE, but it doesn't support > compile ACLE[1] SVE code, and the hns3_rxtx_vec_sve.c was written > by ACLE SVE code.
Quite confusing. What is the difference between the two? > > This patch also filters out '-march=' '-mcpu' '-mtune' when compile > with hns3_rxtx_vec_sve.c. > > [1] ACLE: Arm C Language Extensions, user should include <arm_sve.h> > when writing ACLE SVE code. > > Fixes: 203fbaf8813d ("net/hns3: refactor SVE code compile method") > > Signed-off-by: Chengwen Feng <fengcheng...@huawei.com> > --- > v2: > * fix check tool error > --- > drivers/net/hns3/meson.build | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/hns3/meson.build b/drivers/net/hns3/meson.build > index 8563d70..5f9af9b 100644 > --- a/drivers/net/hns3/meson.build > +++ b/drivers/net/hns3/meson.build > @@ -39,16 +39,22 @@ if arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64') > # compile SVE when: > # a. support SVE in minimum instruction set baseline > # b. it's not minimum instruction set, but compiler support > - if cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != '' > + if cc.get_define('__ARM_FEATURE_SVE', args: machine_args) != '' and > cc.check_header('arm_sve.h') The rte_vect.h arm header unconditionally includes arm_sve.h if __ARM_FEATURE_SVE is defined [1]. So it is surprising to see such a check being added. 1: https://git.dpdk.org/dpdk/tree/lib/eal/arm/include/rte_vect.h#n12 -- David Marchand