[1/2] eal/arm: fix gcc build for optimization level 0

Message ID 20201127080903.26817-2-ruifeng.wang@arm.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series gcc build fix |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Ruifeng Wang Nov. 27, 2020, 8:09 a.m. UTC
  Gcc build with '-O0' on platforms with RTE_ARM_FEATURE_ATOMICS set
failed for:
 ../lib/librte_efd/rte_efd.c
 Assembler messages:
3866: Error: selected processor does not support `crc32cb w0,w0,w1'
3890: Error: selected processor does not support `crc32ch w0,w0,w1'
3914: Error: selected processor does not support `crc32cw w0,w0,w1'
3938: Error: selected processor does not support `crc32cx w0,w0,x1'

This was caused by an architecture specifier added for Clang.
Unlike Clang, Gcc considers each inline assembly block to be dependent
and therefor, the architecture specifier impacts assemble of some
blocks require certain extension support.

Removed the architecture for Gcc to fix the issue.

Fixes: 8fce34cd0a6a ("eal/arm: fix clang build of native target")

Reported-by: Feifei Wang <feifei.wang2@arm.com>
Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 lib/librte_eal/arm/include/rte_atomic_64.h | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

David Marchand Nov. 27, 2020, 8:39 a.m. UTC | #1
On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
>
> Gcc build with '-O0' on platforms with RTE_ARM_FEATURE_ATOMICS set
> failed for:
>  ../lib/librte_efd/rte_efd.c
>  Assembler messages:
> 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
> 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
> 3914: Error: selected processor does not support `crc32cw w0,w0,w1'
> 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
>
> This was caused by an architecture specifier added for Clang.
> Unlike Clang, Gcc considers each inline assembly block to be dependent
> and therefor, the architecture specifier impacts assemble of some
> blocks require certain extension support.

I reproduced this error with -O0 for config/arm/arm64_octeontx2_linux_gcc.
The patch looks simple enough and it only affects ARM builds.

Jerin,
Are you okay with this change for 20.11?
Or should we wait 21.02?

Ruifeng,
Looking at the kernel, I see no distinction with gcc/clang, so I'd say
the kernel has the same issue, or is there something else that differs
in dpdk?
Besides, the kernel patch previously mentioned had a followup fix.
  
Jerin Jacob Nov. 27, 2020, 8:51 a.m. UTC | #2
On Fri, Nov 27, 2020 at 2:09 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
> >
> > Gcc build with '-O0' on platforms with RTE_ARM_FEATURE_ATOMICS set
> > failed for:
> >  ../lib/librte_efd/rte_efd.c
> >  Assembler messages:
> > 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
> > 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
> > 3914: Error: selected processor does not support `crc32cw w0,w0,w1'
> > 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
> >
> > This was caused by an architecture specifier added for Clang.
> > Unlike Clang, Gcc considers each inline assembly block to be dependent
> > and therefor, the architecture specifier impacts assemble of some
> > blocks require certain extension support.
>
> I reproduced this error with -O0 for config/arm/arm64_octeontx2_linux_gcc.
> The patch looks simple enough and it only affects ARM builds.
>
> Jerin,
> Are you okay with this change for 20.11?
> Or should we wait 21.02?

I could reproduce the issue with meson  build -Dbuildtype=debug
--cross-file config/arm/arm64_octeontx2_linux_gcc

This fix is OK. Request to merge for 20.11

Acked-by: Jerin Jacob <jerinj@marvell.com>


>
> Ruifeng,
> Looking at the kernel, I see no distinction with gcc/clang, so I'd say
> the kernel has the same issue, or is there something else that differs
> in dpdk?
> Besides, the kernel patch previously mentioned had a followup fix.
>
>
> --
> David Marchand
>
  
David Marchand Nov. 27, 2020, 9:25 a.m. UTC | #3
On Fri, Nov 27, 2020 at 9:51 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>
> On Fri, Nov 27, 2020 at 2:09 PM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
> > >
> > > Gcc build with '-O0' on platforms with RTE_ARM_FEATURE_ATOMICS set
> > > failed for:
> > >  ../lib/librte_efd/rte_efd.c
> > >  Assembler messages:
> > > 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
> > > 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
> > > 3914: Error: selected processor does not support `crc32cw w0,w0,w1'
> > > 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
> > >
> > > This was caused by an architecture specifier added for Clang.
> > > Unlike Clang, Gcc considers each inline assembly block to be dependent
> > > and therefor, the architecture specifier impacts assemble of some
> > > blocks require certain extension support.
> >
> > I reproduced this error with -O0 for config/arm/arm64_octeontx2_linux_gcc.
> > The patch looks simple enough and it only affects ARM builds.
> >
> > Jerin,
> > Are you okay with this change for 20.11?
> > Or should we wait 21.02?
>
> I could reproduce the issue with meson  build -Dbuildtype=debug
> --cross-file config/arm/arm64_octeontx2_linux_gcc
>
> This fix is OK. Request to merge for 20.11
>
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Ruifeng, Andrew,

I get a compilation error with this patch on sfc using gcc and
config/arm/arm64_octeontx2_linux_gcc config + --buildtype=debug and/or
-Dc_args=-O0 .

aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture
8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802

FAILED: drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o
aarch64-linux-gnu-gcc
-Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
-Idrivers/common/sfc_efx/base -I../../dpdk/drivers/common/sfc_efx/base
-Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
-I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include
-I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include
-I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/arm/include
-I../../dpdk/lib/librte_eal/arm/include -Ilib/librte_eal/common
-I../../dpdk/lib/librte_eal/common -Ilib/librte_eal
-I../../dpdk/lib/librte_eal -Ilib/librte_kvargs
-I../../dpdk/lib/librte_kvargs
-Ilib/librte_telemetry/../librte_metrics
-I../../dpdk/lib/librte_telemetry/../librte_metrics
-Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Werror -g -include rte_config.h -Wextra -Wcast-qual
-Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs
-Wold-style-definition -Wpointer-arith -Wsign-compare
-Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-not-aligned
-Wno-missing-field-initializers -D_GNU_SOURCE -fPIC
-march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API
-DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-optimization
-Waggregate-return -Wbad-function-cast -Wno-sign-compare
-Wno-unused-parameter -Wno-unused-variable -Wno-empty-body
-Wno-unused-but-set-variable -MD -MQ
'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o' -MF
'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o.d' -o
'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o' -c
../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c
In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
                 from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
                 from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
                 from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
                 from
../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
                 from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
                 from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
                 from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
                 from ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c:7:
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
‘__cas_128_relaxed’:
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20: error:
function returns an aggregate [-Werror=aggregate-return]
 __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp")
                    ^~~~~~~~~~~~~~~~~
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
definition of macro ‘__ATOMIC128_CAS_OP’
 cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
 ^~~~~~~~~~~
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
‘__cas_128_acquire’:
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:82:20: error:
function returns an aggregate [-Werror=aggregate-return]
 __ATOMIC128_CAS_OP(__cas_128_acquire, "caspa")
                    ^~~~~~~~~~~~~~~~~
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
definition of macro ‘__ATOMIC128_CAS_OP’
 cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
 ^~~~~~~~~~~
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
‘__cas_128_release’:
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:83:20: error:
function returns an aggregate [-Werror=aggregate-return]
 __ATOMIC128_CAS_OP(__cas_128_release, "caspl")
                    ^~~~~~~~~~~~~~~~~
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
definition of macro ‘__ATOMIC128_CAS_OP’
 cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
 ^~~~~~~~~~~
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
‘__cas_128_acq_rel’:
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:84:20: error:
function returns an aggregate [-Werror=aggregate-return]
 __ATOMIC128_CAS_OP(__cas_128_acq_rel, "caspal")
                    ^~~~~~~~~~~~~~~~~
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
definition of macro ‘__ATOMIC128_CAS_OP’
 cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
 ^~~~~~~~~~~
cc1: all warnings being treated as errors


If I waive those warnings:
- next to fail is net/igc (fixed by next patch so ok)
- and then next to fail is net/sfc.
  
Jerin Jacob Nov. 27, 2020, 9:33 a.m. UTC | #4
On Fri, Nov 27, 2020 at 2:56 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Fri, Nov 27, 2020 at 9:51 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
> >
> > On Fri, Nov 27, 2020 at 2:09 PM David Marchand
> > <david.marchand@redhat.com> wrote:
> > >
> > > On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
> > > >
> > > > Gcc build with '-O0' on platforms with RTE_ARM_FEATURE_ATOMICS set
> > > > failed for:
> > > >  ../lib/librte_efd/rte_efd.c
> > > >  Assembler messages:
> > > > 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
> > > > 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
> > > > 3914: Error: selected processor does not support `crc32cw w0,w0,w1'
> > > > 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
> > > >
> > > > This was caused by an architecture specifier added for Clang.
> > > > Unlike Clang, Gcc considers each inline assembly block to be dependent
> > > > and therefor, the architecture specifier impacts assemble of some
> > > > blocks require certain extension support.
> > >
> > > I reproduced this error with -O0 for config/arm/arm64_octeontx2_linux_gcc.
> > > The patch looks simple enough and it only affects ARM builds.
> > >
> > > Jerin,
> > > Are you okay with this change for 20.11?
> > > Or should we wait 21.02?
> >
> > I could reproduce the issue with meson  build -Dbuildtype=debug
> > --cross-file config/arm/arm64_octeontx2_linux_gcc
> >
> > This fix is OK. Request to merge for 20.11
> >
> > Acked-by: Jerin Jacob <jerinj@marvell.com>
>
> Ruifeng, Andrew,
>
> I get a compilation error with this patch on sfc using gcc and
> config/arm/arm64_octeontx2_linux_gcc config + --buildtype=debug and/or
> -Dc_args=-O0 .
>
> aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture
> 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802
>
> FAILED: drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o
> aarch64-linux-gnu-gcc
> -Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
> -Idrivers/common/sfc_efx/base -I../../dpdk/drivers/common/sfc_efx/base
> -Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
> -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include
> -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include
> -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/arm/include
> -I../../dpdk/lib/librte_eal/arm/include -Ilib/librte_eal/common
> -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal
> -I../../dpdk/lib/librte_eal -Ilib/librte_kvargs
> -I../../dpdk/lib/librte_kvargs
> -Ilib/librte_telemetry/../librte_metrics
> -I../../dpdk/lib/librte_telemetry/../librte_metrics
> -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry
> -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
> -Winvalid-pch -Werror -g -include rte_config.h -Wextra -Wcast-qual
> -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
> -Wmissing-declarations -Wmissing-prototypes -Wnested-externs
> -Wold-style-definition -Wpointer-arith -Wsign-compare
> -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-not-aligned
> -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC
> -march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API
> -DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-optimization
> -Waggregate-return -Wbad-function-cast -Wno-sign-compare
> -Wno-unused-parameter -Wno-unused-variable -Wno-empty-body
> -Wno-unused-but-set-variable -MD -MQ
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o' -MF
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o.d' -o
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o' -c
> ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c
> In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
>                  from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
>                  from
> ../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
>                  from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
>                  from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
>                  from ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c:7:
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> ‘__cas_128_relaxed’:
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20: error:
> function returns an aggregate [-Werror=aggregate-return]
>  __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp")
>                     ^~~~~~~~~~~~~~~~~
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> definition of macro ‘__ATOMIC128_CAS_OP’
>  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
>  ^~~~~~~~~~~
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> ‘__cas_128_acquire’:
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:82:20: error:
> function returns an aggregate [-Werror=aggregate-return]
>  __ATOMIC128_CAS_OP(__cas_128_acquire, "caspa")
>                     ^~~~~~~~~~~~~~~~~
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> definition of macro ‘__ATOMIC128_CAS_OP’
>  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
>  ^~~~~~~~~~~
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> ‘__cas_128_release’:
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:83:20: error:
> function returns an aggregate [-Werror=aggregate-return]
>  __ATOMIC128_CAS_OP(__cas_128_release, "caspl")
>                     ^~~~~~~~~~~~~~~~~
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> definition of macro ‘__ATOMIC128_CAS_OP’
>  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
>  ^~~~~~~~~~~
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> ‘__cas_128_acq_rel’:
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:84:20: error:
> function returns an aggregate [-Werror=aggregate-return]
>  __ATOMIC128_CAS_OP(__cas_128_acq_rel, "caspal")
>                     ^~~~~~~~~~~~~~~~~
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> definition of macro ‘__ATOMIC128_CAS_OP’
>  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
>  ^~~~~~~~~~~
> cc1: all warnings being treated as errors
>
>
> If I waive those warnings:
> - next to fail is net/igc (fixed by next patch so ok)
> - and then next to fail is net/sfc.

Regarding the net/sfc build, Could try clean build.(I got the warning first,
after the clean build, it is OK)



>
>
> --
> David Marchand
>
  
Ruifeng Wang Nov. 27, 2020, 9:36 a.m. UTC | #5
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, November 27, 2020 4:39 PM
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; jerinj@marvell.com
> Cc: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; dev
> <dev@dpdk.org>; nd <nd@arm.com>; Feifei Wang <Feifei.Wang2@arm.com>
> Subject: Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization
> level 0
> 
> On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang <ruifeng.wang@arm.com>
> wrote:
> >
> > Gcc build with '-O0' on platforms with RTE_ARM_FEATURE_ATOMICS set
> > failed for:
> >  ../lib/librte_efd/rte_efd.c
> >  Assembler messages:
> > 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
> > 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
> > 3914: Error: selected processor does not support `crc32cw w0,w0,w1'
> > 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
> >
> > This was caused by an architecture specifier added for Clang.
> > Unlike Clang, Gcc considers each inline assembly block to be dependent
> > and therefor, the architecture specifier impacts assemble of some
> > blocks require certain extension support.
> 
> I reproduced this error with -O0 for config/arm/arm64_octeontx2_linux_gcc.
> The patch looks simple enough and it only affects ARM builds.
> 
> Jerin,
> Are you okay with this change for 20.11?
> Or should we wait 21.02?
> 
> Ruifeng,
> Looking at the kernel, I see no distinction with gcc/clang, so I'd say the kernel
> has the same issue, or is there something else that differs in dpdk?
> Besides, the kernel patch previously mentioned had a followup fix.

The kernel follow up fix looks like a better way to reconcile Gcc and Clang.
I'll reroll with the same approach.
> 
> 
> --
> David Marchand
  
Andrew Rybchenko Nov. 27, 2020, 9:39 a.m. UTC | #6
On 11/27/20 12:25 PM, David Marchand wrote:
> On Fri, Nov 27, 2020 at 9:51 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>>
>> On Fri, Nov 27, 2020 at 2:09 PM David Marchand
>> <david.marchand@redhat.com> wrote:
>>>
>>> On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
>>>>
>>>> Gcc build with '-O0' on platforms with RTE_ARM_FEATURE_ATOMICS set
>>>> failed for:
>>>>  ../lib/librte_efd/rte_efd.c
>>>>  Assembler messages:
>>>> 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
>>>> 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
>>>> 3914: Error: selected processor does not support `crc32cw w0,w0,w1'
>>>> 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
>>>>
>>>> This was caused by an architecture specifier added for Clang.
>>>> Unlike Clang, Gcc considers each inline assembly block to be dependent
>>>> and therefor, the architecture specifier impacts assemble of some
>>>> blocks require certain extension support.
>>>
>>> I reproduced this error with -O0 for config/arm/arm64_octeontx2_linux_gcc.
>>> The patch looks simple enough and it only affects ARM builds.
>>>
>>> Jerin,
>>> Are you okay with this change for 20.11?
>>> Or should we wait 21.02?
>>
>> I could reproduce the issue with meson  build -Dbuildtype=debug
>> --cross-file config/arm/arm64_octeontx2_linux_gcc
>>
>> This fix is OK. Request to merge for 20.11
>>
>> Acked-by: Jerin Jacob <jerinj@marvell.com>
> 
> Ruifeng, Andrew,
> 
> I get a compilation error with this patch on sfc using gcc and
> config/arm/arm64_octeontx2_linux_gcc config + --buildtype=debug and/or
> -Dc_args=-O0 .
> 
> aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture
> 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802
> 
> FAILED: drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o
> aarch64-linux-gnu-gcc
> -Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
> -Idrivers/common/sfc_efx/base -I../../dpdk/drivers/common/sfc_efx/base
> -Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
> -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include
> -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include
> -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/arm/include
> -I../../dpdk/lib/librte_eal/arm/include -Ilib/librte_eal/common
> -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal
> -I../../dpdk/lib/librte_eal -Ilib/librte_kvargs
> -I../../dpdk/lib/librte_kvargs
> -Ilib/librte_telemetry/../librte_metrics
> -I../../dpdk/lib/librte_telemetry/../librte_metrics
> -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry
> -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
> -Winvalid-pch -Werror -g -include rte_config.h -Wextra -Wcast-qual
> -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
> -Wmissing-declarations -Wmissing-prototypes -Wnested-externs
> -Wold-style-definition -Wpointer-arith -Wsign-compare
> -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-not-aligned
> -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC
> -march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API
> -DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-optimization
> -Waggregate-return -Wbad-function-cast -Wno-sign-compare
> -Wno-unused-parameter -Wno-unused-variable -Wno-empty-body
> -Wno-unused-but-set-variable -MD -MQ
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o' -MF
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o.d' -o
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o' -c
> ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c
> In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
>                  from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
>                  from
> ../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
>                  from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
>                  from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
>                  from ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c:7:

...

> If I waive those warnings:
> - next to fail is net/igc (fixed by next patch so ok)
> - and then next to fail is net/sfc.

As I understand it is not common/sfc_efx specific issue since it is
simply header inclusion. I guess it is the just first
one to build. I have no good ideas what to do with it.
So, help from ARM experts would be appreciated.

Andrew.
  
David Marchand Nov. 27, 2020, 9:45 a.m. UTC | #7
On Fri, Nov 27, 2020 at 10:34 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
>
> On Fri, Nov 27, 2020 at 2:56 PM David Marchand
> <david.marchand@redhat.com> wrote:
> >
> > On Fri, Nov 27, 2020 at 9:51 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
> > >
> > > On Fri, Nov 27, 2020 at 2:09 PM David Marchand
> > > <david.marchand@redhat.com> wrote:
> > > >
> > > > On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang <ruifeng.wang@arm.com> wrote:
> > > > >
> > > > > Gcc build with '-O0' on platforms with RTE_ARM_FEATURE_ATOMICS set
> > > > > failed for:
> > > > >  ../lib/librte_efd/rte_efd.c
> > > > >  Assembler messages:
> > > > > 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
> > > > > 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
> > > > > 3914: Error: selected processor does not support `crc32cw w0,w0,w1'
> > > > > 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
> > > > >
> > > > > This was caused by an architecture specifier added for Clang.
> > > > > Unlike Clang, Gcc considers each inline assembly block to be dependent
> > > > > and therefor, the architecture specifier impacts assemble of some
> > > > > blocks require certain extension support.
> > > >
> > > > I reproduced this error with -O0 for config/arm/arm64_octeontx2_linux_gcc.
> > > > The patch looks simple enough and it only affects ARM builds.
> > > >
> > > > Jerin,
> > > > Are you okay with this change for 20.11?
> > > > Or should we wait 21.02?
> > >
> > > I could reproduce the issue with meson  build -Dbuildtype=debug
> > > --cross-file config/arm/arm64_octeontx2_linux_gcc
> > >
> > > This fix is OK. Request to merge for 20.11
> > >
> > > Acked-by: Jerin Jacob <jerinj@marvell.com>
> >
> > Ruifeng, Andrew,
> >
> > I get a compilation error with this patch on sfc using gcc and
> > config/arm/arm64_octeontx2_linux_gcc config + --buildtype=debug and/or
> > -Dc_args=-O0 .
> >
> > aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture
> > 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802
> >
> > FAILED: drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o
> > aarch64-linux-gnu-gcc
> > -Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
> > -Idrivers/common/sfc_efx/base -I../../dpdk/drivers/common/sfc_efx/base
> > -Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
> > -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include
> > -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include
> > -I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/arm/include
> > -I../../dpdk/lib/librte_eal/arm/include -Ilib/librte_eal/common
> > -I../../dpdk/lib/librte_eal/common -Ilib/librte_eal
> > -I../../dpdk/lib/librte_eal -Ilib/librte_kvargs
> > -I../../dpdk/lib/librte_kvargs
> > -Ilib/librte_telemetry/../librte_metrics
> > -I../../dpdk/lib/librte_telemetry/../librte_metrics
> > -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry
> > -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
> > -Winvalid-pch -Werror -g -include rte_config.h -Wextra -Wcast-qual
> > -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
> > -Wmissing-declarations -Wmissing-prototypes -Wnested-externs
> > -Wold-style-definition -Wpointer-arith -Wsign-compare
> > -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-not-aligned
> > -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC
> > -march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API
> > -DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-optimization
> > -Waggregate-return -Wbad-function-cast -Wno-sign-compare
> > -Wno-unused-parameter -Wno-unused-variable -Wno-empty-body
> > -Wno-unused-but-set-variable -MD -MQ
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o' -MF
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o.d' -o
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o' -c
> > ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c
> > In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
> >                  from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
> >                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
> >                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
> >                  from
> > ../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
> >                  from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
> >                  from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
> >                  from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
> >                  from ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c:7:
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > ‘__cas_128_relaxed’:
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20: error:
> > function returns an aggregate [-Werror=aggregate-return]
> >  __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp")
> >                     ^~~~~~~~~~~~~~~~~
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > definition of macro ‘__ATOMIC128_CAS_OP’
> >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
> >  ^~~~~~~~~~~
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > ‘__cas_128_acquire’:
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:82:20: error:
> > function returns an aggregate [-Werror=aggregate-return]
> >  __ATOMIC128_CAS_OP(__cas_128_acquire, "caspa")
> >                     ^~~~~~~~~~~~~~~~~
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > definition of macro ‘__ATOMIC128_CAS_OP’
> >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
> >  ^~~~~~~~~~~
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > ‘__cas_128_release’:
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:83:20: error:
> > function returns an aggregate [-Werror=aggregate-return]
> >  __ATOMIC128_CAS_OP(__cas_128_release, "caspl")
> >                     ^~~~~~~~~~~~~~~~~
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > definition of macro ‘__ATOMIC128_CAS_OP’
> >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
> >  ^~~~~~~~~~~
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > ‘__cas_128_acq_rel’:
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:84:20: error:
> > function returns an aggregate [-Werror=aggregate-return]
> >  __ATOMIC128_CAS_OP(__cas_128_acq_rel, "caspal")
> >                     ^~~~~~~~~~~~~~~~~
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > definition of macro ‘__ATOMIC128_CAS_OP’
> >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)      \
> >  ^~~~~~~~~~~
> > cc1: all warnings being treated as errors
> >
> >
> > If I waive those warnings:
> > - next to fail is net/igc (fixed by next patch so ok)
> > - and then next to fail is net/sfc.
>
> Regarding the net/sfc build, Could try clean build.(I got the warning first,
> after the clean build, it is OK)

That's what I first thought too, then I noticed that
test-meson-builds.sh had switched back my build dir to debugoptimized.


From scratch:

The Meson build system
Version: 0.52.0
Source dir: /home/dmarchan/dpdk
Build dir: /home/dmarchan/builds/build-arm64-octeontx2
Build type: cross build
Program cat found: YES (/usr/bin/cat)
Project name: DPDK
Project version: 20.11.0-rc5
Appending CFLAGS from environment: '-Werror'
C compiler for the build machine: ccache gcc (gcc 9.3.1 "gcc (GCC)
9.3.1 20200408 (Red Hat 9.3.1-2)")
C linker for the build machine: GNU ld.bfd 2.32-33
C compiler for the host machine: aarch64-linux-gnu-gcc (gcc 8.2.1
"aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture
8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802")
C linker for the host machine: GNU ld.bfd 8.2-2019
Build machine cpu family: x86_64
Build machine cpu: x86_64
Host machine cpu family: aarch64
Host machine cpu: armv8-a
Target machine cpu family: aarch64
Target machine cpu: armv8-a
...
Option buildtype is: debug [default: release]
Option default_library is: shared [default: static]
Found ninja-1.9.0 at /usr/bin/ninja
ninja: Entering directory `/home/dmarchan/builds/build-arm64-octeontx2'
[479/2558] Compiling C object
'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'.
FAILED: drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o
aarch64-linux-gnu-gcc
-Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
-Idrivers/common/sfc_efx/base -I../../dpdk/drivers/common/sfc_efx/base
-Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
-I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include
-I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include
-I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/arm/include
-I../../dpdk/lib/librte_eal/arm/include -Ilib/librte_eal/common
-I../../dpdk/lib/librte_eal/common -Ilib/librte_eal
-I../../dpdk/lib/librte_eal -Ilib/librte_kvargs
-I../../dpdk/lib/librte_kvargs
-Ilib/librte_telemetry/../librte_metrics
-I../../dpdk/lib/librte_telemetry/../librte_metrics
-Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry
-fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Werror -g -include rte_config.h -Wextra -Wcast-qual
-Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs
-Wold-style-definition -Wpointer-arith -Wsign-compare
-Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-not-aligned
-Wno-missing-field-initializers -D_GNU_SOURCE -fPIC
-march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API
-DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-optimization
-Waggregate-return -Wbad-function-cast -Wno-sign-compare
-Wno-unused-parameter -Wno-unused-variable -Wno-empty-body
-Wno-unused-but-set-variable -MD -MQ
'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'
-MF 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o.d'
-o 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'
-c ../../dpdk/drivers/common/sfc_efx/base/efx_bootcfg.c
In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
                 from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
                 from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
                 from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
                 from
../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
                 from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
                 from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
                 from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
                 from ../../dpdk/drivers/common/sfc_efx/base/efx_bootcfg.c:7:
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
‘__cas_128_relaxed’:
../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20: error:
function returns an aggregate [-Werror=aggregate-return]
 __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp")
...
  
Ruifeng Wang Nov. 27, 2020, 10:05 a.m. UTC | #8
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Friday, November 27, 2020 5:45 PM
> To: Jerin Jacob <jerinjacobk@gmail.com>
> Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>; jerinj@marvell.com; Honnappa
> Nagarahalli <Honnappa.Nagarahalli@arm.com>; dev <dev@dpdk.org>; nd
> <nd@arm.com>; Feifei Wang <Feifei.Wang2@arm.com>
> Subject: Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization
> level 0
> 
> On Fri, Nov 27, 2020 at 10:34 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
> >
> > On Fri, Nov 27, 2020 at 2:56 PM David Marchand
> > <david.marchand@redhat.com> wrote:
> > >
> > > On Fri, Nov 27, 2020 at 9:51 AM Jerin Jacob <jerinjacobk@gmail.com>
> wrote:
> > > >
> > > > On Fri, Nov 27, 2020 at 2:09 PM David Marchand
> > > > <david.marchand@redhat.com> wrote:
> > > > >
> > > > > On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang
> <ruifeng.wang@arm.com> wrote:
> > > > > >
> > > > > > Gcc build with '-O0' on platforms with
> RTE_ARM_FEATURE_ATOMICS
> > > > > > set failed for:
> > > > > >  ../lib/librte_efd/rte_efd.c
> > > > > >  Assembler messages:
> > > > > > 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
> > > > > > 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
> > > > > > 3914: Error: selected processor does not support `crc32cw
> w0,w0,w1'
> > > > > > 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
> > > > > >
> > > > > > This was caused by an architecture specifier added for Clang.
> > > > > > Unlike Clang, Gcc considers each inline assembly block to be
> > > > > > dependent and therefor, the architecture specifier impacts
> > > > > > assemble of some blocks require certain extension support.
> > > > >
> > > > > I reproduced this error with -O0 for
> config/arm/arm64_octeontx2_linux_gcc.
> > > > > The patch looks simple enough and it only affects ARM builds.
> > > > >
> > > > > Jerin,
> > > > > Are you okay with this change for 20.11?
> > > > > Or should we wait 21.02?
> > > >
> > > > I could reproduce the issue with meson  build -Dbuildtype=debug
> > > > --cross-file config/arm/arm64_octeontx2_linux_gcc
> > > >
> > > > This fix is OK. Request to merge for 20.11
> > > >
> > > > Acked-by: Jerin Jacob <jerinj@marvell.com>
> > >
> > > Ruifeng, Andrew,
> > >
> > > I get a compilation error with this patch on sfc using gcc and
> > > config/arm/arm64_octeontx2_linux_gcc config + --buildtype=debug
> > > and/or
> > > -Dc_args=-O0 .
> > >
> > > aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture
> > > 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802
> > >
> > > FAILED:
> > > drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o
> > > aarch64-linux-gnu-gcc
> > > -Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
> > > -Idrivers/common/sfc_efx/base
> > > -I../../dpdk/drivers/common/sfc_efx/base
> > > -Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
> > > -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include
> > > -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include
> > > -I../../dpdk/lib/librte_eal/linux/include
> > > -Ilib/librte_eal/arm/include -I../../dpdk/lib/librte_eal/arm/include
> > > -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common
> > > -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_kvargs
> > > -I../../dpdk/lib/librte_kvargs
> > > -Ilib/librte_telemetry/../librte_metrics
> > > -I../../dpdk/lib/librte_telemetry/../librte_metrics
> > > -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry
> > > -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
> > > -Winvalid-pch -Werror -g -include rte_config.h -Wextra -Wcast-qual
> > > -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
> > > -Wmissing-declarations -Wmissing-prototypes -Wnested-externs
> > > -Wold-style-definition -Wpointer-arith -Wsign-compare
> > > -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-not-aligned
> > > -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC
> > > -march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API
> > > -DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-
> optimization
> > > -Waggregate-return -Wbad-function-cast -Wno-sign-compare
> > > -Wno-unused-parameter -Wno-unused-variable -Wno-empty-body
> > > -Wno-unused-but-set-variable -MD -MQ
> > > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o'
> > > -MF
> > >
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o.d'
> > > -o
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o'
> > > -c ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c
> > > In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
> > >                  from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
> > >                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
> > >                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
> > >                  from
> > > ../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
> > >                  from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
> > >                  from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
> > >                  from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
> > >                  from ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c:7:
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > > ‘__cas_128_relaxed’:
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20: error:
> > > function returns an aggregate [-Werror=aggregate-return]
> > > __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp")
> > >                     ^~~~~~~~~~~~~~~~~
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > > definition of macro ‘__ATOMIC128_CAS_OP’
> > >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)
> \
> > >  ^~~~~~~~~~~
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > > ‘__cas_128_acquire’:
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:82:20: error:
> > > function returns an aggregate [-Werror=aggregate-return]
> > > __ATOMIC128_CAS_OP(__cas_128_acquire, "caspa")
> > >                     ^~~~~~~~~~~~~~~~~
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > > definition of macro ‘__ATOMIC128_CAS_OP’
> > >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)
> \
> > >  ^~~~~~~~~~~
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > > ‘__cas_128_release’:
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:83:20: error:
> > > function returns an aggregate [-Werror=aggregate-return]
> > > __ATOMIC128_CAS_OP(__cas_128_release, "caspl")
> > >                     ^~~~~~~~~~~~~~~~~
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > > definition of macro ‘__ATOMIC128_CAS_OP’
> > >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)
> \
> > >  ^~~~~~~~~~~
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > > ‘__cas_128_acq_rel’:
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:84:20: error:
> > > function returns an aggregate [-Werror=aggregate-return]
> > > __ATOMIC128_CAS_OP(__cas_128_acq_rel, "caspal")
> > >                     ^~~~~~~~~~~~~~~~~
> > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > > definition of macro ‘__ATOMIC128_CAS_OP’
> > >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)
> \
> > >  ^~~~~~~~~~~
> > > cc1: all warnings being treated as errors
> > >
> > >
> > > If I waive those warnings:
> > > - next to fail is net/igc (fixed by next patch so ok)
> > > - and then next to fail is net/sfc.
> >
> > Regarding the net/sfc build, Could try clean build.(I got the warning
> > first, after the clean build, it is OK)
> 
> That's what I first thought too, then I noticed that test-meson-builds.sh had
> switched back my build dir to debugoptimized.
> 
> 
> From scratch:
> 
> The Meson build system
> Version: 0.52.0
> Source dir: /home/dmarchan/dpdk
> Build dir: /home/dmarchan/builds/build-arm64-octeontx2
> Build type: cross build
> Program cat found: YES (/usr/bin/cat)
> Project name: DPDK
> Project version: 20.11.0-rc5
> Appending CFLAGS from environment: '-Werror'
> C compiler for the build machine: ccache gcc (gcc 9.3.1 "gcc (GCC)
> 9.3.1 20200408 (Red Hat 9.3.1-2)")
> C linker for the build machine: GNU ld.bfd 2.32-33 C compiler for the host
> machine: aarch64-linux-gnu-gcc (gcc 8.2.1 "aarch64-linux-gnu-gcc (GNU
> Toolchain for the A-profile Architecture
> 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802") C linker for the host machine:
> GNU ld.bfd 8.2-2019 Build machine cpu family: x86_64 Build machine cpu:
> x86_64 Host machine cpu family: aarch64 Host machine cpu: armv8-a Target
> machine cpu family: aarch64 Target machine cpu: armv8-a ...
> Option buildtype is: debug [default: release] Option default_library is: shared
> [default: static] Found ninja-1.9.0 at /usr/bin/ninja
> ninja: Entering directory `/home/dmarchan/builds/build-arm64-octeontx2'
> [479/2558] Compiling C object
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'.
> FAILED:
> drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o
> aarch64-linux-gnu-gcc
> -Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
> -Idrivers/common/sfc_efx/base -I../../dpdk/drivers/common/sfc_efx/base
> -Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
> -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -
> I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -
> I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/arm/include -
> I../../dpdk/lib/librte_eal/arm/include -Ilib/librte_eal/common -
> I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -
> Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -
> Ilib/librte_telemetry/../librte_metrics
> -I../../dpdk/lib/librte_telemetry/../librte_metrics
> -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -fdiagnostics-
> color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -g -
> include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -
> Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-
> prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -
> Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-
> not-aligned -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC -
> march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API -
> DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-optimization -
> Waggregate-return -Wbad-function-cast -Wno-sign-compare -Wno-unused-
> parameter -Wno-unused-variable -Wno-empty-body -Wno-unused-but-set-
> variable -MD -MQ
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'
> -MF
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o.
> d'
> -o
> 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'
> -c ../../dpdk/drivers/common/sfc_efx/base/efx_bootcfg.c
> In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
>                  from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
>                  from
> ../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
>                  from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
>                  from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
>                  from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
>                  from ../../dpdk/drivers/common/sfc_efx/base/efx_bootcfg.c:7:
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> ‘__cas_128_relaxed’:
> ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20: error:
> function returns an aggregate [-Werror=aggregate-return]
> __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp") ...

I can see similar warning message (function returns an aggregate) when doing "-O0" build.
Since "-Werror=aggregate-return" is used, error will be reported.
This is because '__cas_128_xxx' return aggregated data type I think.
Inline the functions should resolve the issue. But it could cause register corruption as discussed
when the code was added:
http://patches.dpdk.org/patch/55580/

No quick solution I can think of.
> 
> 
> --
> David Marchand
  
Jerin Jacob Nov. 27, 2020, 10:28 a.m. UTC | #9
On Fri, Nov 27, 2020 at 3:35 PM Ruifeng Wang <Ruifeng.Wang@arm.com> wrote:
>
> > -----Original Message-----
> > From: David Marchand <david.marchand@redhat.com>
> > Sent: Friday, November 27, 2020 5:45 PM
> > To: Jerin Jacob <jerinjacobk@gmail.com>
> > Cc: Ruifeng Wang <Ruifeng.Wang@arm.com>; Andrew Rybchenko
> > <andrew.rybchenko@oktetlabs.ru>; jerinj@marvell.com; Honnappa
> > Nagarahalli <Honnappa.Nagarahalli@arm.com>; dev <dev@dpdk.org>; nd
> > <nd@arm.com>; Feifei Wang <Feifei.Wang2@arm.com>
> > Subject: Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization
> > level 0
> >
> > On Fri, Nov 27, 2020 at 10:34 AM Jerin Jacob <jerinjacobk@gmail.com> wrote:
> > >
> > > On Fri, Nov 27, 2020 at 2:56 PM David Marchand
> > > <david.marchand@redhat.com> wrote:
> > > >
> > > > On Fri, Nov 27, 2020 at 9:51 AM Jerin Jacob <jerinjacobk@gmail.com>
> > wrote:
> > > > >
> > > > > On Fri, Nov 27, 2020 at 2:09 PM David Marchand
> > > > > <david.marchand@redhat.com> wrote:
> > > > > >
> > > > > > On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang
> > <ruifeng.wang@arm.com> wrote:
> > > > > > >
> > > > > > > Gcc build with '-O0' on platforms with
> > RTE_ARM_FEATURE_ATOMICS
> > > > > > > set failed for:
> > > > > > >  ../lib/librte_efd/rte_efd.c
> > > > > > >  Assembler messages:
> > > > > > > 3866: Error: selected processor does not support `crc32cb w0,w0,w1'
> > > > > > > 3890: Error: selected processor does not support `crc32ch w0,w0,w1'
> > > > > > > 3914: Error: selected processor does not support `crc32cw
> > w0,w0,w1'
> > > > > > > 3938: Error: selected processor does not support `crc32cx w0,w0,x1'
> > > > > > >
> > > > > > > This was caused by an architecture specifier added for Clang.
> > > > > > > Unlike Clang, Gcc considers each inline assembly block to be
> > > > > > > dependent and therefor, the architecture specifier impacts
> > > > > > > assemble of some blocks require certain extension support.
> > > > > >
> > > > > > I reproduced this error with -O0 for
> > config/arm/arm64_octeontx2_linux_gcc.
> > > > > > The patch looks simple enough and it only affects ARM builds.
> > > > > >
> > > > > > Jerin,
> > > > > > Are you okay with this change for 20.11?
> > > > > > Or should we wait 21.02?
> > > > >
> > > > > I could reproduce the issue with meson  build -Dbuildtype=debug
> > > > > --cross-file config/arm/arm64_octeontx2_linux_gcc
> > > > >
> > > > > This fix is OK. Request to merge for 20.11
> > > > >
> > > > > Acked-by: Jerin Jacob <jerinj@marvell.com>
> > > >
> > > > Ruifeng, Andrew,
> > > >
> > > > I get a compilation error with this patch on sfc using gcc and
> > > > config/arm/arm64_octeontx2_linux_gcc config + --buildtype=debug
> > > > and/or
> > > > -Dc_args=-O0 .
> > > >
> > > > aarch64-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture
> > > > 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802
> > > >
> > > > FAILED:
> > > > drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o
> > > > aarch64-linux-gnu-gcc
> > > > -Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
> > > > -Idrivers/common/sfc_efx/base
> > > > -I../../dpdk/drivers/common/sfc_efx/base
> > > > -Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
> > > > -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include
> > > > -I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include
> > > > -I../../dpdk/lib/librte_eal/linux/include
> > > > -Ilib/librte_eal/arm/include -I../../dpdk/lib/librte_eal/arm/include
> > > > -Ilib/librte_eal/common -I../../dpdk/lib/librte_eal/common
> > > > -Ilib/librte_eal -I../../dpdk/lib/librte_eal -Ilib/librte_kvargs
> > > > -I../../dpdk/lib/librte_kvargs
> > > > -Ilib/librte_telemetry/../librte_metrics
> > > > -I../../dpdk/lib/librte_telemetry/../librte_metrics
> > > > -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry
> > > > -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall
> > > > -Winvalid-pch -Werror -g -include rte_config.h -Wextra -Wcast-qual
> > > > -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security
> > > > -Wmissing-declarations -Wmissing-prototypes -Wnested-externs
> > > > -Wold-style-definition -Wpointer-arith -Wsign-compare
> > > > -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-not-aligned
> > > > -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC
> > > > -march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API
> > > > -DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-
> > optimization
> > > > -Waggregate-return -Wbad-function-cast -Wno-sign-compare
> > > > -Wno-unused-parameter -Wno-unused-variable -Wno-empty-body
> > > > -Wno-unused-but-set-variable -MD -MQ
> > > > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o'
> > > > -MF
> > > >
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o.d'
> > > > -o
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o'
> > > > -c ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c
> > > > In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
> > > >                  from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
> > > >                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
> > > >                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
> > > >                  from
> > > > ../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
> > > >                  from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
> > > >                  from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
> > > >                  from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
> > > >                  from ../../dpdk/drivers/common/sfc_efx/base/efx_crc32.c:7:
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > > > ‘__cas_128_relaxed’:
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20: error:
> > > > function returns an aggregate [-Werror=aggregate-return]
> > > > __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp")
> > > >                     ^~~~~~~~~~~~~~~~~
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > > > definition of macro ‘__ATOMIC128_CAS_OP’
> > > >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)
> > \
> > > >  ^~~~~~~~~~~
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > > > ‘__cas_128_acquire’:
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:82:20: error:
> > > > function returns an aggregate [-Werror=aggregate-return]
> > > > __ATOMIC128_CAS_OP(__cas_128_acquire, "caspa")
> > > >                     ^~~~~~~~~~~~~~~~~
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > > > definition of macro ‘__ATOMIC128_CAS_OP’
> > > >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)
> > \
> > > >  ^~~~~~~~~~~
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > > > ‘__cas_128_release’:
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:83:20: error:
> > > > function returns an aggregate [-Werror=aggregate-return]
> > > > __ATOMIC128_CAS_OP(__cas_128_release, "caspl")
> > > >                     ^~~~~~~~~~~~~~~~~
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > > > definition of macro ‘__ATOMIC128_CAS_OP’
> > > >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)
> > \
> > > >  ^~~~~~~~~~~
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > > > ‘__cas_128_acq_rel’:
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:84:20: error:
> > > > function returns an aggregate [-Werror=aggregate-return]
> > > > __ATOMIC128_CAS_OP(__cas_128_acq_rel, "caspal")
> > > >                     ^~~~~~~~~~~~~~~~~
> > > > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:57:1: note: in
> > > > definition of macro ‘__ATOMIC128_CAS_OP’
> > > >  cas_op_name(rte_int128_t *dst, rte_int128_t old, rte_int128_t updated)
> > \
> > > >  ^~~~~~~~~~~
> > > > cc1: all warnings being treated as errors
> > > >
> > > >
> > > > If I waive those warnings:
> > > > - next to fail is net/igc (fixed by next patch so ok)
> > > > - and then next to fail is net/sfc.
> > >
> > > Regarding the net/sfc build, Could try clean build.(I got the warning
> > > first, after the clean build, it is OK)
> >
> > That's what I first thought too, then I noticed that test-meson-builds.sh had
> > switched back my build dir to debugoptimized.
> >
> >
> > From scratch:
> >
> > The Meson build system
> > Version: 0.52.0
> > Source dir: /home/dmarchan/dpdk
> > Build dir: /home/dmarchan/builds/build-arm64-octeontx2
> > Build type: cross build
> > Program cat found: YES (/usr/bin/cat)
> > Project name: DPDK
> > Project version: 20.11.0-rc5
> > Appending CFLAGS from environment: '-Werror'
> > C compiler for the build machine: ccache gcc (gcc 9.3.1 "gcc (GCC)
> > 9.3.1 20200408 (Red Hat 9.3.1-2)")
> > C linker for the build machine: GNU ld.bfd 2.32-33 C compiler for the host
> > machine: aarch64-linux-gnu-gcc (gcc 8.2.1 "aarch64-linux-gnu-gcc (GNU
> > Toolchain for the A-profile Architecture
> > 8.2-2019.01 (arm-rel-8.28)) 8.2.1 20180802") C linker for the host machine:
> > GNU ld.bfd 8.2-2019 Build machine cpu family: x86_64 Build machine cpu:
> > x86_64 Host machine cpu family: aarch64 Host machine cpu: armv8-a Target
> > machine cpu family: aarch64 Target machine cpu: armv8-a ...
> > Option buildtype is: debug [default: release] Option default_library is: shared
> > [default: static] Found ninja-1.9.0 at /usr/bin/ninja
> > ninja: Entering directory `/home/dmarchan/builds/build-arm64-octeontx2'
> > [479/2558] Compiling C object
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'.
> > FAILED:
> > drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o
> > aarch64-linux-gnu-gcc
> > -Idrivers/common/sfc_efx/base/932d09a@@sfc_base@sta
> > -Idrivers/common/sfc_efx/base -I../../dpdk/drivers/common/sfc_efx/base
> > -Idrivers/common/sfc_efx -I../../dpdk/drivers/common/sfc_efx -I.
> > -I../../dpdk/ -Iconfig -I../../dpdk/config -Ilib/librte_eal/include -
> > I../../dpdk/lib/librte_eal/include -Ilib/librte_eal/linux/include -
> > I../../dpdk/lib/librte_eal/linux/include -Ilib/librte_eal/arm/include -
> > I../../dpdk/lib/librte_eal/arm/include -Ilib/librte_eal/common -
> > I../../dpdk/lib/librte_eal/common -Ilib/librte_eal -I../../dpdk/lib/librte_eal -
> > Ilib/librte_kvargs -I../../dpdk/lib/librte_kvargs -
> > Ilib/librte_telemetry/../librte_metrics
> > -I../../dpdk/lib/librte_telemetry/../librte_metrics
> > -Ilib/librte_telemetry -I../../dpdk/lib/librte_telemetry -fdiagnostics-
> > color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -g -
> > include rte_config.h -Wextra -Wcast-qual -Wdeprecated -Wformat -
> > Wformat-nonliteral -Wformat-security -Wmissing-declarations -Wmissing-
> > prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -
> > Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-packed-
> > not-aligned -Wno-missing-field-initializers -D_GNU_SOURCE -fPIC -
> > march=armv8.2-a+crc+crypto+lse -DALLOW_EXPERIMENTAL_API -
> > DALLOW_INTERNAL_API -Wno-format-truncation -Wdisabled-optimization -
> > Waggregate-return -Wbad-function-cast -Wno-sign-compare -Wno-unused-
> > parameter -Wno-unused-variable -Wno-empty-body -Wno-unused-but-set-
> > variable -MD -MQ
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'
> > -MF
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o.
> > d'
> > -o
> > 'drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_bootcfg.c.o'
> > -c ../../dpdk/drivers/common/sfc_efx/base/efx_bootcfg.c
> > In file included from ../../dpdk/lib/librte_eal/arm/include/rte_atomic.h:9,
> >                  from ../../dpdk/lib/librte_eal/include/generic/rte_pause.h:19,
> >                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause_64.h:19,
> >                  from ../../dpdk/lib/librte_eal/arm/include/rte_pause.h:13,
> >                  from
> > ../../dpdk/lib/librte_eal/include/generic/rte_spinlock.h:25,
> >                  from ../../dpdk/lib/librte_eal/arm/include/rte_spinlock.h:17,
> >                  from ../../dpdk/drivers/common/sfc_efx/efsys.h:15,
> >                  from ../../dpdk/drivers/common/sfc_efx/base/efx.h:11,
> >                  from ../../dpdk/drivers/common/sfc_efx/base/efx_bootcfg.c:7:
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h: In function
> > ‘__cas_128_relaxed’:
> > ../../dpdk/lib/librte_eal/arm/include/rte_atomic_64.h:81:20: error:
> > function returns an aggregate [-Werror=aggregate-return]
> > __ATOMIC128_CAS_OP(__cas_128_relaxed, "casp") ...
>
> I can see similar warning message (function returns an aggregate) when doing "-O0" build.
> Since "-Werror=aggregate-return" is used, error will be reported.
> This is because '__cas_128_xxx' return aggregated data type I think.
> Inline the functions should resolve the issue. But it could cause register corruption as discussed
> when the code was added:
> http://patches.dpdk.org/patch/55580/
>
> No quick solution I can think of.

Yes. We may need to return two separate uint64_t by taking as the pointer.
It will be NOT a candidate for 20.11.

In my setup:
meson --buildtype=debug build --cross-file config/arm/arm64_octeontx2_linux_gcc
ninja -C build

Shows the warnings for "warning: function returns an aggregate
[-Waggregate-return]", Since
warning not treated as the error it links.
I think, for this release, The current[1] minor changes are OK as it
improves the situation.
http://patches.dpdk.org/project/dpdk/list/?submitter=Ruifeng








> >
> >
> > --
> > David Marchand
>
  

Patch

diff --git a/lib/librte_eal/arm/include/rte_atomic_64.h b/lib/librte_eal/arm/include/rte_atomic_64.h
index 7fcd17466..467d32a45 100644
--- a/lib/librte_eal/arm/include/rte_atomic_64.h
+++ b/lib/librte_eal/arm/include/rte_atomic_64.h
@@ -46,7 +46,11 @@  rte_atomic_thread_fence(int memorder)
 /*------------------------ 128 bit atomic operations -------------------------*/
 
 #if defined(__ARM_FEATURE_ATOMICS) || defined(RTE_ARM_FEATURE_ATOMICS)
+#if defined(RTE_CC_CLANG)
 #define __LSE_PREAMBLE	".arch armv8-a+lse\n"
+#else
+#define __LSE_PREAMBLE	""
+#endif
 
 #define __ATOMIC128_CAS_OP(cas_op_name, op_string)                          \
 static __rte_noinline rte_int128_t                                          \