gcc build fix
Subsystems (2)
cover gcc build fix
This series fixed issues found when building project with Gcc '-O0' option.
Ruifeng Wang (2):
eal/arm: fix gcc build for optimization level 0
net/igc: fix gcc build for optimization level 0
drivers/net/igc/base/meson.build | 3 ++- lib/librte_eal/arm/include/rte_atomic_64.h | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-)
Signature · 1 line
2.20.1
PATCH 1/2 eal/arm: fix gcc build for optimization level 0
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.
--- lib/librte_eal/arm/include/rte_atomic_64.h | 4 ++++ 1 file changed, 4 insertions(+)
lib/librte_eal/arm/include/rte_atomic_64.h +4 -0
@@ -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 \
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
Quoted 10 lines · Ruifeng Wang
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSset failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not supportcrc32cw w0,w0,w1' 3938: Error: selected processor does not supportcrc32cx w0,w0,x1'
Quoted 4 lines
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.
Signature · 1 line
David Marchand
Jerin Jacob
Acked-byRe: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
Quoted 17 lines · David Marchand
Quoted 10 lines · Ruifeng Wang
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSset failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not supportcrc32cw w0,w0,w1' 3938: Error: selected processor does not supportcrc32cx w0,w0,x1'Quoted 4 lines
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.
Quoted 6 lines
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
Quoted 11 lines
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
Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
Quoted 27 lines · Jerin Jacob
Quoted 17 lines · David Marchand
Quoted 10 lines · Ruifeng Wang
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSset failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not supportcrc32cw w0,w0,w1' 3938: Error: selected processor does not supportcrc32cx w0,w0,x1'Quoted 4 lines
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.
Quoted 6 lines
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?
Quoted 6 lines
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 <[email protected]>
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.
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
Quoted 129 lines · David Marchand
Quoted 27 lines · Jerin Jacob
Quoted 17 lines · David Marchand
Quoted 10 lines · Ruifeng Wang
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSset failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not supportcrc32cw w0,w0,w1' 3938: Error: selected processor does not supportcrc32cx w0,w0,x1'Quoted 4 lines
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.
Quoted 6 lines
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?Quoted 6 lines
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 <[email protected]>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.oaarch64-linux-gnu-gcc(quoted diff) +0
-25-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
Quoted 3 lines
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)
Quoted 5 lines
--
David Marchand
Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
Quoted 132 lines · Jerin Jacob
Quoted 129 lines · David Marchand
Quoted 27 lines · Jerin Jacob
Quoted 17 lines · David Marchand
Quoted 10 lines · Ruifeng Wang
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSset failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not supportcrc32cw w0,w0,w1' 3938: Error: selected processor does not supportcrc32cx w0,w0,x1'Quoted 4 lines
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.
Quoted 6 lines
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?Quoted 6 lines
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 <[email protected]>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.oaarch64-linux-gnu-gcc(quoted diff) +0
-25-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
Quoted 6 lines
Quoted 3 lines
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")
...
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
Quoted 239 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, November 27, 2020 5:45 PM
To: Jerin Jacob <[email protected]>
Cc: Ruifeng Wang <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; Honnappa Nagarahalli <[email protected]>; dev <[email protected]>; nd <[email protected]>; Feifei Wang <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0Quoted 5 lines · Jerin Jacob
Quoted 2 lines · David Marchand
On Fri, Nov 27, 2020 at 9:51 AM Jerin Jacob <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines · David Marchand
On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang
Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
set failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not support `crc32cww0,w0,w1'
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
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.
Quoted 41 lines
Quoted 41 lines
Quoted 6 lines
Quoted 5 lines
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?Quoted 6 lines
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 <[email protected]>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.oaarch64-linux-gnu-gcc(quoted diff) +0
-15-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 -WallQuoted 8 lines
Review
Quoted 8 lines
(quoted diff) +0
-8-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
Quoted 6 lines
Quoted 6 lines
(quoted diff) +0
-3-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'Quoted 1 line
Quoted 1 line
-o
'
drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o'Quoted 12 lines
Quoted 12 lines
-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 functionQuoted 8 lines
Quoted 8 lines
‘__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)\
Quoted 10 lines
Quoted 10 lines
^~~~~~~~~~~
../../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)\
Quoted 10 lines
Quoted 10 lines
^~~~~~~~~~~
../../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)\
Quoted 10 lines
Quoted 10 lines
^~~~~~~~~~~
../../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)\
Quoted 10 lines
Quoted 7 lines
^~~~~~~~~~~
cc1: all warnings being treated as errorsIf 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.shhad 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_64Build machine cpu:x86_64Host 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] Optiondefault_libraryis: 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.oaarch64-linux-gnu-gcc(quoted diff) +0
-4-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
(quoted diff) +0
-2-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:
Quoted 5 lines
../../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.
Quoted 4 lines
--
David Marchand
Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
Quoted 253 lines · Ruifeng Wang
Quoted 240 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, November 27, 2020 5:45 PM
To: Jerin Jacob <[email protected]>
Cc: Ruifeng Wang <[email protected]>; Andrew Rybchenko <[email protected]>; [email protected]; Honnappa Nagarahalli <[email protected]>; dev <[email protected]>; nd <[email protected]>; Feifei Wang <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0Quoted 5 lines · Jerin Jacob
Quoted 2 lines · David Marchand
On Fri, Nov 27, 2020 at 9:51 AM Jerin Jacob <[email protected]>
Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines · David Marchand
On Fri, Nov 27, 2020 at 9:10 AM Ruifeng Wang
Quoted 2 lines · <[email protected]> wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
set failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not support `crc32cww0,w0,w1'
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
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.
Quoted 41 lines
Quoted 41 lines
Quoted 6 lines
Quoted 5 lines
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?Quoted 6 lines
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 <[email protected]>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.oaarch64-linux-gnu-gcc(quoted diff) +0
-15-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 -WallQuoted 8 lines
Review
Quoted 8 lines
(quoted diff) +0
-8-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
Quoted 6 lines
Quoted 6 lines
(quoted diff) +0
-3-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'Quoted 1 line
Quoted 1 line
-o
'
drivers/common/sfc_efx/base/932d09a@@sfc_base@sta/efx_crc32.c.o'Quoted 12 lines
Quoted 12 lines
-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 functionQuoted 8 lines
Quoted 8 lines
‘__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)\
Quoted 10 lines
Quoted 10 lines
^~~~~~~~~~~
../../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)\
Quoted 10 lines
Quoted 10 lines
^~~~~~~~~~~
../../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)\
Quoted 10 lines
Quoted 10 lines
^~~~~~~~~~~
../../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)\
Quoted 10 lines
Quoted 7 lines
^~~~~~~~~~~
cc1: all warnings being treated as errorsIf 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.shhad 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_64Build machine cpu:x86_64Host 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] Optiondefault_libraryis: 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.oaarch64-linux-gnu-gcc(quoted diff) +0
-4-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
(quoted diff) +0
-2-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:Quoted 5 lines
../../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/
Quoted 1 line
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
Quoted 5 lines
Quoted 4 lines
--
David Marchand
Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
In reply to David MarchandQuoted 85 lines · David Marchand
Quoted 27 lines · Jerin Jacob
Quoted 17 lines · David Marchand
Quoted 10 lines · Ruifeng Wang
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSset failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not supportcrc32cw w0,w0,w1' 3938: Error: selected processor does not supportcrc32cx w0,w0,x1'Quoted 4 lines
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.
Quoted 6 lines
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?Quoted 6 lines
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 <[email protected]>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.oaarch64-linux-gnu-gcc(quoted diff) +0
-25-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:
...
Quoted 3 lines
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.
Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0
In reply to David MarchandQuoted 29 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, November 27, 2020 4:39 PM
To: Ruifeng Wang <[email protected]>; [email protected]
Cc: Honnappa Nagarahalli <[email protected]>; dev <[email protected]>; nd <[email protected]>; Feifei Wang <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 1/2] eal/arm: fix gcc build for optimization level 0Quoted 10 lines · Ruifeng Wang
Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSset failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not supportcrc32cw w0,w0,w1' 3938: Error: selected processor does not supportcrc32cx w0,w0,x1'Quoted 4 lines
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.
Quoted 8 lines
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.
Quoted 4 lines
--
David Marchand
PATCH 2/2 net/igc: fix gcc build for optimization level 0
In reply to Ruifeng WangGcc build with '-O0' failed for:
../drivers/net/igc/base/igc_api.c
Assembler messages:
29: Error: selected processor does not support casp x0,x1,x2,x3,[x4]' 82: Error: selected processor does not support caspa x0,x1,x2,x3,[x4]' 135: Error: selected processor does not support caspl x0,x1,x2,x3,[x4]' 188: Error: selected processor does not support caspal x0,x1,x2,x3,[x4]'
This is due to c_args not been passed to meson.
--- drivers/net/igc/base/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/igc/base/meson.build +2 -1
@@ -13,6 +13,7 @@ sources = [ ] base_lib = static_library('igc_base', sources, - dependencies: static_rte_eal) + dependencies: static_rte_eal, + c_args: cflags) base_objs = base_lib.extract_all_objects()
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH 2/2] net/igc: fix gcc build for optimization level 0
Quoted 9 lines · Ruifeng Wang
Gcc build with '-O0' failed for:
../drivers/net/igc/base/igc_api.c
Assembler messages:
29: Error: selected processor does not supportcasp x0,x1,x2,x3,[x4]' 82: Error: selected processor does not supportcaspa x0,x1,x2,x3,[x4]' 135: Error: selected processor does not supportcaspl x0,x1,x2,x3,[x4]' 188: Error: selected processor does not supportcaspal x0,x1,x2,x3,[x4]'
Quoted 7 lines
This is due to
c_argsnot been passed to meson.Fixes 8cb7c57d9b3c ("net/igc: support device initialization")Reported-by Feifei Wang <[email protected]>Signed-off-by Ruifeng Wang <[email protected]>
Able to reproduce the issue with meson build -Dbuildtype=debug --cross-file config/arm/arm64_octeontx2_linux_gcc and verified the build issue.
Quoted 20 lines
--- drivers/net/igc/base/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/igc/base/meson.build +2
-2@@ -13,6 +13,7 @@ sources = [ ] base_lib = static_library('igc_base', sources, - dependencies: static_rte_eal) + dependencies: static_rte_eal, + c_args: cflags) base_objs = base_lib.extract_all_objects() --2.20.1
Re: [dpdk-dev] [PATCH 2/2] net/igc: fix gcc build for optimization level 0
In reply to Ruifeng WangQuoted 9 lines · Ruifeng Wang
Gcc build with '-O0' failed for:
../drivers/net/igc/base/igc_api.c
Assembler messages:
29: Error: selected processor does not supportcasp x0,x1,x2,x3,[x4]' 82: Error: selected processor does not supportcaspa x0,x1,x2,x3,[x4]' 135: Error: selected processor does not supportcaspl x0,x1,x2,x3,[x4]' 188: Error: selected processor does not supportcaspal x0,x1,x2,x3,[x4]'
Quoted 7 lines
This is due to
c_argsnot been passed to meson.Fixes 8cb7c57d9b3c ("net/igc: support device initialization")Reported-by Feifei Wang <[email protected]>Signed-off-by Ruifeng Wang <[email protected]>
I did not get to reproduce it yet (get an error on first patch...).
The patch looks fine but I fear some compilation problems since a lot of base drivers filter cflags.
Still waiting for CI results...
Bruce,Ferruh,
Wdyt?
Signature · 1 line
David Marchand
Re: [dpdk-dev] [PATCH 2/2] net/igc: fix gcc build for optimization level 0
Quoted 19 lines · David Marchand
Quoted 9 lines · Ruifeng Wang
Gcc build with '-O0' failed for:
../drivers/net/igc/base/igc_api.c
Assembler messages:
29: Error: selected processor does not supportcasp x0,x1,x2,x3,[x4]' 82: Error: selected processor does not supportcaspa x0,x1,x2,x3,[x4]' 135: Error: selected processor does not supportcaspl x0,x1,x2,x3,[x4]' 188: Error: selected processor does not supportcaspal x0,x1,x2,x3,[x4]'Quoted 7 lines
This is due to
c_argsnot been passed to meson.Fixes 8cb7c57d9b3c ("net/igc: support device initialization")Reported-by Feifei Wang <[email protected]>Signed-off-by Ruifeng Wang <[email protected]>
Quoted 8 lines
I did not get to reproduce it yet (get an error on first patch...).
The patch looks fine but I fear some compilation problems since a lot of base drivers filter cflags.
Still waiting for CI results...Bruce,Ferruh,
Wdyt?
Comparing before/after patch on x86, gcc, static build, the only difference is:
-march=native -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API
-Wno-format-truncation
Which corresponds to drivers/meson.build:
default_cflags = machine_argsdefault_cflags += ['-DALLOW_EXPERIMENTAL_API']default_cflags += ['-DALLOW_INTERNAL_API']
if cc.has_argument('-Wno-format-truncation')
default_cflags += '-Wno-format-truncation'
endif
So little risk wrt warning flags.
Still I'd like to hear from Intel, thanks.
Signature · 1 line
David Marchand
Wang, Haiyue
Acked-byRe: [dpdk-dev] [PATCH 2/2] net/igc: fix gcc build for optimization level 0
Quoted 49 lines
-----Original Message-----
From: David Marchand <[email protected]>
Sent: Friday, November 27, 2020 20:14
To: Richardson, Bruce <[email protected]>; Yigit, Ferruh <[email protected]>
Cc: Guo, Jia <[email protected]>; Wang, Haiyue <[email protected]>; Zhang, AlvinX <[email protected]>; dev <[email protected]>; Honnappa Nagarahalli <[email protected]>; nd <[email protected]>; Ruifeng Wang <[email protected]>; Feifei Wang <[email protected]>
Subject: Re: [dpdk-dev] [PATCH 2/2] net/igc: fix gcc build for optimization level 0Quoted 19 lines · David Marchand
Quoted 9 lines · Ruifeng Wang
Gcc build with '-O0' failed for:
../drivers/net/igc/base/igc_api.c
Assembler messages:
29: Error: selected processor does not supportcasp x0,x1,x2,x3,[x4]' 82: Error: selected processor does not supportcaspa x0,x1,x2,x3,[x4]' 135: Error: selected processor does not supportcaspl x0,x1,x2,x3,[x4]' 188: Error: selected processor does not supportcaspal x0,x1,x2,x3,[x4]'Quoted 7 lines
This is due to
c_argsnot been passed to meson.Fixes 8cb7c57d9b3c ("net/igc: support device initialization")Reported-by Feifei Wang <[email protected]>Signed-off-by Ruifeng Wang <[email protected]>Quoted 8 lines
I did not get to reproduce it yet (get an error on first patch...).
The patch looks fine but I fear some compilation problems since a lot of base drivers filter cflags.
Still waiting for CI results...Bruce,Ferruh,
Wdyt?Comparing before/after patch on x86, gcc, static build, the only difference is:
-march=native -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API
-Wno-format-truncationWhich corresponds to
drivers/meson.build:
default_cflags=machine_argsdefault_cflags+= ['-DALLOW_EXPERIMENTAL_API']default_cflags+= ['-DALLOW_INTERNAL_API']
Quoted 8 lines
if
cc.has_argument('-Wno-format-truncation')default_cflags += '-Wno-format-truncation'endif
So little risk wrt warning flags.
Still I'd like to hear from Intel, thanks.
LGTM, after reading other Intel PMDs base meson design.
Quoted 2 lines
--
David Marchand
v2 cover gcc build fix
In reply to Ruifeng WangThis series fixed issues found when building project with Gcc '-O0' option.
Ruifeng Wang (2):
eal/arm: fix gcc build for optimization level 0
net/igc: fix gcc build for optimization level 0
drivers/net/igc/base/meson.build | 3 ++- lib/librte_eal/arm/include/rte_atomic_64.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
PATCH v2 1/2 eal/arm: fix gcc build for optimization level 0
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 therefore, the architecture specifier impacts assemble of some blocks require certain extension support.
Used arch_extension instead to not override architecture. Referred for [1] to fix the issue.
---
v2:
New approach to use arch_extension instead.
lib/librte_eal/arm/include/rte_atomic_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_eal/arm/include/rte_atomic_64.h +1 -1
@@ -46,7 +46,7 @@ rte_atomic_thread_fence(int memorder)/*------------------------ 128 bit atomic operations -------------------------*/ #if defined(__ARM_FEATURE_ATOMICS) || defined(RTE_ARM_FEATURE_ATOMICS ) -#define __LSE_PREAMBLE ".arch armv8-a+lse\n" +#define __LSE_PREAMBLE ".arch_extension lse\n"#define __ATOMIC128_CAS_OP (cas_op_name, op_string) \ static __rte_noinline rte_int128_t \
Signature · 1 line
2.20.1
Re: [dpdk-dev] [PATCH v2 1/2] eal/arm: fix gcc build for optimization level 0
Quoted 47 lines
-----Original Message-----
From: Ruifeng Wang <[email protected]>
Sent: Friday, November 27, 2020 6:15 PM
To: [email protected]; Ruifeng Wang <[email protected]>; Honnappa Nagarahalli <[email protected]>
Cc: [email protected]; nd <[email protected]>; Feifei Wang <[email protected]>
Subject: [PATCH v2 1/2] eal/arm: fix gcc build for optimization level 0Gcc build with '-O0' on platforms with
RTE_ARM_FEATURE_ATOMICSset failed for:
../lib/librte_efd/rte_efd.c
Assembler messages:
3866: Error: selected processor does not supportcrc32cb w0,w0,w1' 3890: Error: selected processor does not supportcrc32ch w0,w0,w1' 3914: Error: selected processor does not supportcrc32cw w0,w0,w1' 3938: Error: selected processor does not supportcrc32cx 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 therefore, the architecture specifier impacts assemble of some blocks require certain extension support.
Used
arch_extensioninstead to not override architecture. Referred for [1] to fix the issue.[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i
d=dd1f6308b28edf0452dd5dc7877992903ec61e69Fixes 8fce34cd0a6a ("eal/arm: fix clang build of native target")Reported-by Feifei Wang <[email protected]>Signed-off-by Ruifeng Wang <[email protected]>---
v2:
New approach to usearch_extensioninstead.lib/librte_eal/arm/include/rte_atomic_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/librte_eal/arm/include/rte_atomic_64.h +0
-0
lib/librte_eal/arm/include/rte_atomic_64.h rte_atomic_thread_fence(int memorder) · line 50
Quoted 6 lines
lib/librte_eal/arm/include/rte_atomic_64.h +1
-1@@ -46,7 +46,7 @@ rte_atomic_thread_fence(int memorder)/*------------------------ 128 bit atomic operations -------------------------*/ #if defined(__ARM_FEATURE_ATOMICS) || defined(RTE_ARM_FEATURE_ATOMICS ) -#define __LSE_PREAMBLE ".arch armv8-a+lse\n" +#define __LSE_PREAMBLE ".arch_extension lse\n"
This approach has issue on earlier version Clang (eg. clang-6). I think it is better to take approach in v1.
Quoted 5 lines
lib/librte_eal/arm/include/rte_atomic_64.h +0
-1#define __ATOMIC128_CAS_OP (cas_op_name, op_string) \ static __rte_noinline rte_int128_t \ --2.20.1
PATCH v2 2/2 net/igc: fix gcc build for optimization level 0
In reply to Ruifeng WangGcc build with '-O0' failed for:
../drivers/net/igc/base/igc_api.c
Assembler messages:
29: Error: selected processor does not support casp x0,x1,x2,x3,[x4]' 82: Error: selected processor does not support caspa x0,x1,x2,x3,[x4]' 135: Error: selected processor does not support caspl x0,x1,x2,x3,[x4]' 188: Error: selected processor does not support caspal x0,x1,x2,x3,[x4]'
This is due to c_args not been passed to meson.
--- drivers/net/igc/base/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/igc/base/meson.build +2 -1
@@ -13,6 +13,7 @@ sources = [ ] base_lib = static_library('igc_base', sources, - dependencies: static_rte_eal) + dependencies: static_rte_eal, + c_args: cflags) base_objs = base_lib.extract_all_objects()
Signature · 1 line
2.20.1
27/11/2020 11:15, Ruifeng Wang:
Quoted 6 lines
This series fixed issues found when building project with Gcc '-O0' option.
Ruifeng Wang (2):
eal/arm: fix gcc build for optimization level 0
net/igc: fix gcc build for optimization level 0
No comment on the v2?
Ruifeng, why nobody was Cc'ed? You don't want reviews?
I am not going to accept such last minute fix
if there is no strong proof this v2 is good.
Quoted 15 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Friday, November 27, 2020 9:36 PM
To: Ruifeng Wang <[email protected]>
Cc: [email protected]; Honnappa Nagarahalli <[email protected]>; nd <[email protected]>; [email protected]; [email protected]; [email protected]; Vimal Chungath <[email protected]>; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/2] gcc build fix27/11/2020 11:15, Ruifeng Wang:
Quoted 3 lines
This series fixed issues found when building project with Gcc '-O0' option.
Quoted 6 lines
Quoted 3 lines
Ruifeng Wang (2):
eal/arm: fix gcc build for optimization level 0
net/igc: fix gcc build for optimization level 0No comment on the v2?
Ruifeng, why nobody was Cc'ed? You don't want reviews?
Just used get-maintainer.sh to get Cc list. I should have added more people.
Quoted 3 lines
I am not going to accept such last minute fix if there is no strong proof this v2 is good.
v2 1/2 patch has issue on earlier version Clang (eg. clang-6). I think we should continue with v1 approach.
Quoted 1 line
27/11/2020 09:09, Ruifeng Wang:
Quoted 6 lines
This series fixed issues found when building project with Gcc '-O0' option.
Ruifeng Wang (2):
eal/arm: fix gcc build for optimization level 0
net/igc: fix gcc build for optimization level 0
Series v1 applied with Cc:stable, thanks.