mk: fix unsupported flag error on armhf architercture
PATCH 1/2 mk: fix unsupported flag error on armhf architercture
The older version (e.g. version 7.4.0 ) of GNU C compiler for the armhf architecture doesn't support the flag '-Wno-address-of-packed-member', so remove this flag for aarch32.
--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)
mk/toolchain/gcc/rte.vars.mk +2 -0
@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation endif # disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endif export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
Signature · 1 line
2.7.4
PATCH 2/2 doc: add aarch32 build guidance
Add a guidance for aarch64 natively build 32-bit aarch32 DPDK.
--- .../linux_gsg/cross_build_dpdk_for_arm64.rst | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-)
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +30 -6
@@ -1,15 +1,15 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2018 ARM Corporation. -Cross compile DPDK for ARM64 -============================ -This chapter describes how to cross compile DPDK for ARM64 from x86 build hosts. +Cross compile DPDK for aarch64 and aarch32 +========================================== +This chapter describes how to cross-compile DPDK for aarch64 from x86 and compile 32-bit aarch32 DPDK from aarch64 build hosts. .. note:: - Whilst it is recommended to natively build DPDK on ARM64 (just - like with x86), it is also possible to cross-build DPDK for ARM64. An - ARM64 cross compile GNU toolchain is used for this. + Whilst it is recommended to natively build DPDK on aarch64 (just + like with x86), it is also possible to cross-build DPDK for aarch64. An + aarch64 cross compile GNU toolchain is used for this. Obtain the cross tool chain ---------------------------
@@ -133,3 +133,27 @@ command:: meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc ninja -C arm64-build + +Compiling DPDK for aarch32/armv7 on aarch64 host +------------------------------------------ + +Some aarch64 platforms support EL0 aarch32 mode, so the 32-bit aarch32 +applications and the legacy 32-bit armv7 applications can run in this mode. +With the GNU C compiler for the armhf architecture toolchain +gcc-arm-linux-gnueabihf, it can generate aarch32 binary on aarch64 natively. + +For Example, in 64-bit Debian, we can use the following command to build 32-bit armv7 DPDK on aarch64 natively: + +Install cross compile toolchain for the armhf architecure. +command:: + + dpkg --add-architecture armhf + apt-get update + apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make binutils + +Build DPDK arm-armv7a-linuxapp-gcc executables. +command:: + + cd <dpdk_folder> + make config CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc + make -j CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc RTE_DEVEL_BUILD=n
Signature · 1 line
2.7.4
Re: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidance
11/11/2019 11:34, Phil Yang:
Quoted 11 lines
Add a guidance for aarch64 natively build 32-bit aarch32 DPDK.
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- .../linux_gsg/cross_build_dpdk_for_arm64.rst | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-)
What is the status of this patch? The patch 1/2 was rejected. There are new works around aarch32. Is it still relevant?
Re: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidance
Quoted 21 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Monday, May 25, 2020 5:21 AM
To: Phil Yang <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu <[email protected]>; Joyce Kong <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidance11/11/2019 11:34, Phil Yang:
Quoted 10 lines
Add a guidance for aarch64 natively build 32-bit aarch32 DPDK.
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- .../linux_gsg/cross_build_dpdk_for_arm64.rst | 36
Quoted 7 lines
++++++++++++++++++----
Quoted 1 line
1 file changed, 30 insertions(+), 6 deletions(-)What is the status of this patch?
The patch 1/2 was rejected.
There are new works around aarch32.
Is it still relevant?
Thank you for your kindly reminder.
Yes. It is relevant.
This document is intended to guide the user to cross-compile aarch32 DPDK.
Usually the cross-compile host is x86, but cross-compiling on aarch64 is convenient as well, but not everyone knows how to do it. So it is helpful to provide relevant reference documents.
Thanks,
Phil
Re: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidance
In reply to Phil YangQuoted 87 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Phil Yang
Sent: Monday, November 11, 2019 6:34 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidanceAdd a guidance for aarch64 natively build 32-bit aarch32 DPDK.
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- .../linux_gsg/cross_build_dpdk_for_arm64.rst | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-)doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +0
-3@@ -1,15 +1,15 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2018 ARM Corporation. -Cross compile DPDK for ARM64 -============================ -This chapter describes how to cross compile DPDK for ARM64 from x86 buildhosts.
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +3
-0+Cross compile DPDK for aarch64 and aarch32 +========================================== +This chapter describes how to cross-compile DPDK for aarch64 from x86 andcompile 32-bit aarch32 DPDK from aarch64 build hosts.
.. note::
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +13
-3- Whilst it is recommended to natively build DPDK on ARM64 (just - like with x86), it is also possible to cross-build DPDK for ARM64. An - ARM64 cross compile GNU toolchain is used for this. + Whilst it is recommended to natively build DPDK on aarch64 (just + like with x86), it is also possible to cross-build DPDK for aarch64. An + aarch64 cross compile GNU toolchain is used for this. Obtain the cross tool chain ---------------------------@@ -133,3 +133,27 @@ command:: meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc ninja -C arm64-build + +Compiling DPDK for aarch32/armv7 on aarch64 host +------------------------------------------ + +Some aarch64 platforms support EL0 aarch32 mode, so the 32-bit aarch32 +applications and the legacy 32-bit armv7 applications can run in this mode. +With the GNU C compiler for the armhf architecture toolchain +gcc-arm-linux-gnueabihf, it can generate aarch32 binary on aarch64 natively. + +For Example, in 64-bit Debian, we can use the following command to build32-bit armv7 DPDK on aarch64 natively:
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +14
-0+ +Install cross compile toolchain for the armhf architecure. +command:: + + dpkg --add-architecture armhf + apt-get update + apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make +binutils + +Build DPDK arm-armv7a-linuxapp-gcc executables. +command:: + + cd <dpdk_folder> + make config CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +2
-1+ make -j CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc +RTE_DEVEL_BUILD=n --
Quoted 1 line
2.7.4
Re: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidance
Hi Jerin,
Your insight would be much appreciated.
Thanks,
Phil
Quoted 103 lines
-----Original Message-----
From: Ruifeng Wang <[email protected]>
Sent: Wednesday, May 27, 2020 4:29 PM
To: Phil Yang <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Joyce Kong <[email protected]>; nd <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidanceQuoted 30 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Phil Yang
Sent: Monday, November 11, 2019 6:34 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidanceAdd a guidance for aarch64 natively build 32-bit aarch32 DPDK.
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- .../linux_gsg/cross_build_dpdk_for_arm64.rst | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-)doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +0
-0doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst line 6
Quoted 6 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +0
-3@@ -1,15 +1,15 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2018 ARM Corporation. -Cross compile DPDK for ARM64 -============================ -This chapter describes how to cross compile DPDK for ARM64 from x86build
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
Quoted 4 lines
hosts.
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +3
-0+Cross compile DPDK for aarch64 and aarch32 +========================================== +This chapter describes how to cross-compile DPDK for aarch64 from x86and
Quoted 15 lines
compile 32-bit aarch32 DPDK from aarch64 build hosts.
.. note::
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +3
-3- Whilst it is recommended to natively build DPDK on ARM64 (just - like with x86), it is also possible to cross-build DPDK for ARM64. An - ARM64 cross compile GNU toolchain is used for this. + Whilst it is recommended to natively build DPDK on aarch64 (just + like with x86), it is also possible to cross-build DPDK for aarch64. An + aarch64 cross compile GNU toolchain is used for this. Obtain the cross tool chain ---------------------------@@ -133,3 +133,27 @@ command::doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst command:: · line 143
Quoted 10 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +8
-0meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc ninja -C arm64-build + +Compiling DPDK for aarch32/armv7 on aarch64 host +------------------------------------------ + +Some aarch64 platforms support EL0 aarch32 mode, so the 32-bit aarch32 +applications and the legacy 32-bit armv7 applications can run in this mode. +With the GNU C compiler for the armhf architecture toolchain +gcc-arm-linux-gnueabihf, it can generate aarch32 binary on aarch64natively.
Quoted 21 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +2
-0+ +For Example, in 64-bit Debian, we can use the following command to build32-bit armv7 DPDK on aarch64 natively:
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +14
-0+ +Install cross compile toolchain for the armhf architecure. +command:: + + dpkg --add-architecture armhf + apt-get update + apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make +binutils + +Build DPDK arm-armv7a-linuxapp-gcc executables. +command:: + + cd <dpdk_folder> + make config CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +2
-1+ make -j CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc +RTE_DEVEL_BUILD=n --Quoted 1 line
2.7.4
Acked-by Ruifeng Wang <[email protected]>
Re: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidance
Quoted 87 lines · Phil Yang
Hi Jerin,
Your insight would be much appreciated.
Thanks,
PhilQuoted 79 lines
-----Original Message-----
From: Ruifeng Wang <[email protected]>
Sent: Wednesday, May 27, 2020 4:29 PM
To: Phil Yang <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Joyce Kong <[email protected]>; nd <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidanceQuoted 30 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Phil Yang
Sent: Monday, November 11, 2019 6:34 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH 2/2] doc: add aarch32 build guidanceAdd a guidance for aarch64 natively build 32-bit aarch32 DPDK.
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- .../linux_gsg/cross_build_dpdk_for_arm64.rst | 36 ++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-)doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +0
-0doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst line 6
Quoted 6 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +0
-3@@ -1,15 +1,15 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright(c) 2018 ARM Corporation. -Cross compile DPDK for ARM64 -============================ -This chapter describes how to cross compile DPDK for ARM64 from x86build
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
Quoted 4 lines
hosts.
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +3
-0+Cross compile DPDK for aarch64 and aarch32 +========================================== +This chapter describes how to cross-compile DPDK for aarch64 from x86and
Quoted 15 lines
compile 32-bit aarch32 DPDK from aarch64 build hosts.
.. note::
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +3
-3- Whilst it is recommended to natively build DPDK on ARM64 (just - like with x86), it is also possible to cross-build DPDK for ARM64. An - ARM64 cross compile GNU toolchain is used for this. + Whilst it is recommended to natively build DPDK on aarch64 (just + like with x86), it is also possible to cross-build DPDK for aarch64. An + aarch64 cross compile GNU toolchain is used for this. Obtain the cross tool chain ---------------------------@@ -133,3 +133,27 @@ command::doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst command:: · line 143
Quoted 10 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +8
-0meson arm64-build --cross-file config/arm/arm64_armv8_linux_gcc ninja -C arm64-build + +Compiling DPDK for aarch32/armv7 on aarch64 host +------------------------------------------ + +Some aarch64 platforms support EL0 aarch32 mode, so the 32-bit aarch32 +applications and the legacy 32-bit armv7 applications can run in this mode. +With the GNU C compiler for the armhf architecture toolchain +gcc-arm-linux-gnueabihf, it can generate aarch32 binary on aarch64natively.
Quoted 2 lines
Quoted 2 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst command:: · line 145
Quoted 2 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +2
-0+ +For Example, in 64-bit Debian, we can use the following command to build
I think, "we" usage should be removed from the doc.
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
32-bit armv7 DPDK on aarch64 natively:
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +9
-0+ +Install cross compile toolchain for the armhf architecure. +command:: + + dpkg --add-architecture armhf + apt-get update + apt-get install -y gcc gcc-arm-linux-gnueabihf libc6:armhf make +binutils +
Quoted 8 lines
Quoted 8 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst
Quoted 8 lines
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +5
-0+Build DPDK arm-armv7a-linuxapp-gcc executables. +command:: + + cd <dpdk_folder> + make config CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc
doc/guides/linux_gsg/cross_build_dpdk_for_arm64.rst +2
-0+ make -j CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc +RTE_DEVEL_BUILD=n
make based build is deprecated, Please change this to meson.
The rest looks good to me.
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
--
2.7.4Acked-by Ruifeng Wang <[email protected]>
Quoted 20 lines · Phil Yang
The older version (e.g. version 7.4.0 ) of GNU C compiler for the armhf architecture doesn't support the flag '-Wno-address-of-packed-member', so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed member pointer")Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)mk/toolchain/gcc/rte.vars.mk +0
-0
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-truncation · line 106
Quoted 7 lines
mk/toolchain/gcc/rte.vars.mk +2
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation endif # disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endif
You don't need to do this, as gcc will not complain about this unknown flag unless you have other issues in your code.[1] I think it's better to keep the code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the option is not recognized. However, if the -Wno- form is used, the behavior is slightly
different: no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present."
Quoted 47 lines
-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Monday, November 11, 2019 6:47 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error on armhf architerctureQuoted 20 lines · Phil Yang
The older version (e.g. version 7.4.0 ) of GNU C compiler for the armhf architecture doesn't support the flag '-Wno-address-of-packed-member', so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed member pointer")Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)mk/toolchain/gcc/rte.vars.mk +0
-0mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-truncation · line 106
Quoted 7 lines
mk/toolchain/gcc/rte.vars.mk +2
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation endif # disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endifYou don't need to do this, as gcc will not complain about this unknown flag unless you have other issues in your code.[1] I think it's better to keep the code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
Quoted 8 lines
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the option is not recognized. However, if the -Wno- form is used, the behavior is slightly
different: no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present."
Thanks, Bruce.
There are thousands of warnings with alignment when compiling for ARMv7 (ARMv7 supports unaligned memory access). Without this new flag, the build system works fine for ARMv7. So I add this conditional for ARMv7 only. I agree with you we should clean up the code, but it needs a lot of effort to achieve that. This patch is going to make the ARMv7 target build successfully during this period.
Thanks,
Phil
12/11/2019 06:25, Phil Yang (Arm Technology China):
Quoted 45 lines
From: Bruce Richardson <[email protected]>
Quoted 35 lines · Phil Yang
Quoted 20 lines
The older version (e.g. version 7.4.0 ) of GNU C compiler for the armhf architecture doesn't support the flag '-Wno-address-of-packed-member', so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed member pointer")Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)mk/toolchain/gcc/rte.vars.mk +0
-0mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-truncation · line 106
Quoted 7 lines
mk/toolchain/gcc/rte.vars.mk +2
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation endif # disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endifYou don't need to do this, as gcc will not complain about this unknown flag unless you have other issues in your code.[1] I think it's better to keep the code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
Quoted 8 lines
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the option is not recognized. However, if the -Wno- form is used, the behavior is slightly
different: no diagnostic is produced for -Wno-unknown-warning unless other diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that an unrecognized option is present."
Quoted 6 lines
Thanks, Bruce.
There are thousands of warnings with alignment when compiling for ARMv7 (ARMv7 supports unaligned memory access). Without this new flag, the build system works fine for ARMv7. So I add this conditional for ARMv7 only. I agree with you we should clean up the code, but it needs a lot of effort to achieve that. This patch is going to make the ARMv7 target build successfully during this period.
I would go the opposite direction.
I think we should remove all warnings disablement like "-Wno-something", and clean the code.
If you want to allow building ARMv7, you can just allow warnings as not errors. So we will still see something is wrong but it won't prevent from building.
Quoted 71 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, November 12, 2019 2:03 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: Bruce Richardson <[email protected]>; [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error on armhf architercture12/11/2019 06:25, Phil Yang (Arm Technology China):
Quoted 4 lines
From: Bruce Richardson <[email protected]>
Quoted 3 lines · Phil Yang
Quoted 2 lines
The older version (e.g. version 7.4.0 ) of GNU C compiler for the armhf architecture doesn't support the flag '-Wno-address-of-packed-
member',
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed member pointer")Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>Quoted 5 lines
Quoted 5 lines
Review
Quoted 5 lines
--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/mk/toolchain/gcc/rte.vars.mkQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
index 9fc7041..ec0cbbf 100644
mk/toolchain/gcc/rte.vars.mk +0
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation endifQuoted 6 lines
Quoted 6 lines
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-truncation · line 106
Quoted 5 lines
mk/toolchain/gcc/rte.vars.mk +2
-0# disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endifYou don't need to do this, as gcc will not complain about this unknown
flag
Quoted 1 line
Quoted 1 line
unless you have other issues in your code.[1] I think it's better to keep
the
Quoted 8 lines
Quoted 8 lines
code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the option isnot
Quoted 2 lines
Quoted 2 lines
recognized. However, if the -Wno- form is used, the behavior is slightly
different: no diagnostic is produced for -Wno-unknown-warning unlessother
Quoted 2 lines
Quoted 2 lines
diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that
an
Quoted 5 lines
Quoted 1 line
unrecognized option is present."
Thanks, Bruce.
There are thousands of warnings with alignment when compiling for
ARMv7 (ARMv7 supports unaligned memory access).
Quoted 1 line
Without this new flag, the build system works fine for ARMv7. So I add this
conditional for ARMv7 only.
Quoted 8 lines
Quoted 1 line
I agree with you we should clean up the code, but it needs a lot of effort to
achieve that.
Quoted 1 line
This patch is going to make the ARMv7 target build successfully during this
period.
I would go the opposite direction.
I think we should remove all warnings disablement like "-Wno-something", and clean the code.
Thanks, Thomas.
I think it is a compiler issue rather than a code defect in this case, as It cannot recognize the '-Waddress-of-packed-member' flag. "arm-linux-gnueabihf-gcc: error: unrecognized command line option '-Waddress-of-packed-member'"
Quoted 4 lines
If you want to allow building ARMv7, you can just allow warnings as not errors.
So we will still see something is wrong but it won't prevent from building.
Yes. We did this already, all the alignment issues are emitted as warnings on ARMv7. Please see these two commits:79fa5c2a9992 ("mk: ignore alignment errors for ARMv7")6433c19105e8 ("mk: generalize strict alignment warning handling")
Quoted 2 lines
12/11/2019 07:40, Phil Yang (Arm Technology China):
Quoted 86 lines
Quoted 71 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, November 12, 2019 2:03 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: Bruce Richardson <[email protected]>; [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error on armhf architercture12/11/2019 06:25, Phil Yang (Arm Technology China):
Quoted 4 lines
From: Bruce Richardson <[email protected]>
Quoted 3 lines · Phil Yang
Quoted 2 lines
The older version (e.g. version 7.4.0 ) of GNU C compiler for the armhf architecture doesn't support the flag '-Wno-address-of-packed-
member',
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed member pointer")Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>Quoted 5 lines
Quoted 5 lines
Review
Quoted 5 lines
--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/mk/toolchain/gcc/rte.vars.mkQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
index 9fc7041..ec0cbbf 100644
mk/toolchain/gcc/rte.vars.mk +0
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation endifQuoted 6 lines
Quoted 6 lines
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-truncation · line 106
Quoted 5 lines
mk/toolchain/gcc/rte.vars.mk +2
-0# disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endifYou don't need to do this, as gcc will not complain about this unknown
flag
Quoted 1 line
Quoted 1 line
unless you have other issues in your code.[1] I think it's better to keep
the
Quoted 8 lines
Quoted 8 lines
code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the option isnot
Quoted 2 lines
Quoted 2 lines
recognized. However, if the -Wno- form is used, the behavior is slightly
different: no diagnostic is produced for -Wno-unknown-warning unlessother
Quoted 2 lines
Quoted 2 lines
diagnostics are being produced. This allows the use of new -Wno- options with old compilers, but if something goes wrong, the compiler warns that
an
Quoted 5 lines
Quoted 1 line
unrecognized option is present."
Thanks, Bruce.
There are thousands of warnings with alignment when compiling for
ARMv7 (ARMv7 supports unaligned memory access).
Quoted 1 line
Without this new flag, the build system works fine for ARMv7. So I add this
conditional for ARMv7 only.
Quoted 8 lines
Quoted 1 line
I agree with you we should clean up the code, but it needs a lot of effort to
achieve that.
Quoted 1 line
This patch is going to make the ARMv7 target build successfully during this
period.
I would go the opposite direction.
I think we should remove all warnings disablement like "-Wno-something", and clean the code.Thanks, Thomas.
I think it is a compiler issue rather than a code defect in this case, as It cannot recognize the '-Waddress-of-packed-member' flag. "arm-linux-gnueabihf-gcc: error: unrecognized command line option '-Waddress-of-packed-member'"
Quoted 1 line
Quoted 8 lines
Quoted 3 lines
If you want to allow building ARMv7, you can just allow warnings as not errors.
So we will still see something is wrong but it won't prevent from building.Yes. We did this already, all the alignment issues are emitted as warnings on ARMv7. Please see these two commits:
79fa5c2a9992("mk: ignore alignment errors for ARMv7")6433c19105e8("mk: generalize strict alignment warning handling")
I don't know what to do with this patch. I think it is not how it should work, but you say your compiler has a real bug.
Can you confirm which compiler is it? Does it prevent to compile even with -Wno-error ?
Any other opinion?
Quoted 120 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, November 27, 2019 1:02 AM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: [email protected]; Bruce Richardson <[email protected]>; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error on armhf architercture12/11/2019 07:40, Phil Yang (Arm Technology China):
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, November 12, 2019 2:03 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: Bruce Richardson <[email protected]>; [email protected]; [email protected]; [email protected]; HonnappaNagarahalli
Quoted 4 lines
Quoted 4 lines
<[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error onarmhf
Quoted 6 lines
Quoted 6 lines
architercture
12/11/2019 06:25, Phil Yang (Arm Technology China):
Quoted 3 lines
From: Bruce Richardson <[email protected]>
Quoted 2 lines · Phil Yang
Quoted 1 line
The older version (e.g. version 7.4.0 ) of GNU C compiler for the
armhf
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
architecture doesn't support the flag '-Wno-address-of-packed-
member',
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed memberpointer")
Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 11 lines
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/mk/toolchain/gcc/rte.vars.mkQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
index 9fc7041..ec0cbbf 100644
mk/toolchain/gcc/rte.vars.mk +0
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation endifQuoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-truncation · line 106
Quoted 5 lines
mk/toolchain/gcc/rte.vars.mk +2
-0# disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endifYou don't need to do this, as gcc will not complain about this unknown
flag
Quoted 1 line
Quoted 1 line
unless you have other issues in your code.[1] I think it's better to
keep
Quoted 9 lines
Quoted 9 lines
the
Quoted 8 lines
Quoted 8 lines
code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the optionis
Quoted 2 lines
Quoted 2 lines
not
Quoted 1 line
Quoted 1 line
recognized. However, if the -Wno- form is used, the behavior is
slightly
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
different: no diagnostic is produced for -Wno-unknown-warning
unless
Quoted 2 lines
Quoted 2 lines
other
Quoted 1 line
Quoted 1 line
diagnostics are being produced. This allows the use of new -Wno-
options
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
with old compilers, but if something goes wrong, the compiler warns
that
Quoted 8 lines
Quoted 8 lines
an
Quoted 5 lines
Quoted 1 line
unrecognized option is present."
Thanks, Bruce.
There are thousands of warnings with alignment when compiling for
ARMv7 (ARMv7 supports unaligned memory access).
Quoted 1 line
Without this new flag, the build system works fine for ARMv7. So I add
this
Quoted 2 lines
Quoted 2 lines
conditional for ARMv7 only.
Quoted 1 line
I agree with you we should clean up the code, but it needs a lot of
effort to
Quoted 2 lines
Quoted 2 lines
achieve that.
Quoted 1 line
This patch is going to make the ARMv7 target build successfully during
this
Quoted 4 lines
Quoted 4 lines
period.
I would go the opposite direction.
I think we should remove all warnings disablement like "-Wno-something",
Quoted 5 lines
Quoted 1 line
and clean the code.
Thanks, Thomas.
I think it is a compiler issue rather than a code defect in this case, as It
cannot recognize the '-Waddress-of-packed-member' flag.
Quoted 1 line
"arm-linux-gnueabihf-gcc: error: unrecognized command line option '-
Waddress-of-packed-member'"
Quoted 7 lines
Quoted 5 lines
If you want to allow building ARMv7, you can just allow warnings as not errors.
So we will still see something is wrong but it won't prevent from building.Yes. We did this already, all the alignment issues are emitted as warnings
Quoted 8 lines
on ARMv7.
Quoted 3 lines
Please see these two commits:
79fa5c2a9992("mk: ignore alignment errors for ARMv7")6433c19105e8("mk: generalize strict alignment warning handling")I don't know what to do with this patch.
I think it is not how it should work,
but you say your compiler has a real bug.
Agree with you, however I haven't found a better solution for this issue yet.
Quoted 2 lines
Can you confirm which compiler is it?
Please check the packet information dumped below, it is the latest version in Ubuntu 18.04 LTS.
$ sudo apt show gcc-arm-linux-gnueabihf Package: gcc-arm-linux-gnueabihf Version: 4:7.4.0-1ubuntu2.3 Priority: optional Section: devel Source: gcc-defaults (1.176ubuntu2.3) Origin: Ubuntu
Quoted 1 line
Does it prevent to compile even with -Wno-error ?
Yes, it does. I put one piece of the compiling log bellow. Please take a look.
$ make -j1 CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc RTE_DEVEL_BUILD=y
...
/home/phil/aarch32_dpdk/dpdk/lib/librte_eal/linux/eal/eal_vfio.c:1178:7: warning: cast increases required alignment of target type [-Wcast-align]
p = (struct vfio_mp_param *)mp_rep->param;
^
/home/phil/aarch32_dpdk/dpdk/lib/librte_eal/linux/eal/eal_vfio.c: At top level:
cc1: error: unrecognized command line option '-Wno-address-of-packed-member' [-Werror]
...Quoted 3 lines
Any other opinion?
Quoted 142 lines · Phil Yang (Arm Technology China)
Quoted 120 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, November 27, 2019 1:02 AM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: [email protected]; Bruce Richardson <[email protected]>; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error on armhf architercture12/11/2019 07:40, Phil Yang (Arm Technology China):
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, November 12, 2019 2:03 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: Bruce Richardson <[email protected]>; [email protected]; [email protected]; [email protected]; HonnappaNagarahalli
Quoted 4 lines
Quoted 4 lines
<[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error onarmhf
Quoted 6 lines
Quoted 6 lines
architercture
12/11/2019 06:25, Phil Yang (Arm Technology China):
Quoted 3 lines
From: Bruce Richardson <[email protected]>
Quoted 2 lines · Phil Yang
Quoted 1 line
The older version (e.g. version 7.4.0 ) of GNU C compiler for the
armhf
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
architecture doesn't support the flag '-Wno-address-of-packed-
member',
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed memberpointer")
Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 11 lines
Review
Quoted 11 lines
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)(quoted diff) +0
-0
b/mk/toolchain/gcc/rte.vars.mkQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
index 9fc7041..ec0cbbf 100644
mk/toolchain/gcc/rte.vars.mk +0
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation endifQuoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-truncation · line 106
Quoted 5 lines
mk/toolchain/gcc/rte.vars.mk +2
-0# disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endifYou don't need to do this, as gcc will not complain about this unknown
flag
Quoted 1 line
Quoted 1 line
unless you have other issues in your code.[1] I think it's better to
keep
Quoted 9 lines
Quoted 9 lines
the
Quoted 8 lines
Quoted 8 lines
code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that the optionis
Quoted 2 lines
Quoted 2 lines
not
Quoted 1 line
Quoted 1 line
recognized. However, if the -Wno- form is used, the behavior is
slightly
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
different: no diagnostic is produced for -Wno-unknown-warning
unless
Quoted 2 lines
Quoted 2 lines
other
Quoted 1 line
Quoted 1 line
diagnostics are being produced. This allows the use of new -Wno-
options
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
with old compilers, but if something goes wrong, the compiler warns
that
Quoted 8 lines
Quoted 8 lines
an
Quoted 5 lines
Quoted 1 line
unrecognized option is present."
Thanks, Bruce.
There are thousands of warnings with alignment when compiling for
ARMv7 (ARMv7 supports unaligned memory access).
Quoted 1 line
Without this new flag, the build system works fine for ARMv7. So I add
this
Quoted 2 lines
Quoted 2 lines
conditional for ARMv7 only.
Quoted 1 line
I agree with you we should clean up the code, but it needs a lot of
effort to
Quoted 2 lines
Quoted 2 lines
achieve that.
Quoted 1 line
This patch is going to make the ARMv7 target build successfully during
this
Quoted 4 lines
Quoted 4 lines
period.
I would go the opposite direction.
I think we should remove all warnings disablement like "-Wno-something",
Quoted 5 lines
Quoted 1 line
and clean the code.
Thanks, Thomas.
I think it is a compiler issue rather than a code defect in this case, as It
cannot recognize the '-Waddress-of-packed-member' flag.
Quoted 1 line
"arm-linux-gnueabihf-gcc: error: unrecognized command line option '-
Waddress-of-packed-member'"
Quoted 7 lines
Quoted 5 lines
If you want to allow building ARMv7, you can just allow warnings as not errors.
So we will still see something is wrong but it won't prevent from building.Yes. We did this already, all the alignment issues are emitted as warnings
Quoted 8 lines
on ARMv7.
Quoted 3 lines
Please see these two commits:
79fa5c2a9992("mk: ignore alignment errors for ARMv7")6433c19105e8("mk: generalize strict alignment warning handling")I don't know what to do with this patch.
I think it is not how it should work,
but you say your compiler has a real bug.Agree with you, however I haven't found a better solution for this issue yet.
Quoted 2 lines
Can you confirm which compiler is it?
Please check the packet information dumped below, it is the latest version in Ubuntu 18.04 LTS.
$ sudo apt show gcc-arm-linux-gnueabihf Package: gcc-arm-linux-gnueabihf Version: 4:7.4.0-1ubuntu2.3 Priority: optional Section: devel Source: gcc-defaults (1.176ubuntu2.3) Origin: Ubuntu
Quoted 4 lines
Quoted 1 line
Does it prevent to compile even with -Wno-error ?
Yes, it does. I put one piece of the compiling log bellow. Please take a look.
$ make -j1 CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc RTE_DEVEL_BUILD=y
RTE_DEVEL_BUILD turns on -Werror, while what Thomas is asking about is using the opposite flag "-Wno-error". Can you do a non-developer build or put "-Wno-error" in EXTRA_CFLAGS to test this.
/Bruce
Quoted 170 lines
-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Wednesday, November 27, 2019 5:30 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error on armhf architerctureQuoted 6 lines · Phil Yang (Arm Technology China)
Quoted 6 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, November 27, 2019 1:02 AM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: [email protected]; Bruce Richardson <[email protected]>; [email protected]; [email protected]; HonnappaNagarahalli
Quoted 4 lines
Quoted 4 lines
<[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error onarmhf
Quoted 9 lines
Quoted 9 lines
architercture
12/11/2019 07:40, Phil Yang (Arm Technology China):
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, November 12, 2019 2:03 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: Bruce Richardson <[email protected]>; [email protected]; [email protected]; [email protected]; HonnappaQuoted 5 lines
Quoted 5 lines
Nagarahalli
Quoted 4 lines
Quoted 4 lines
<[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag erroron
Quoted 24 lines
Quoted 24 lines
armhf
Quoted 6 lines
Quoted 6 lines
architercture
12/11/2019 06:25, Phil Yang (Arm Technology China):
Quoted 3 lines
From: Bruce Richardson <[email protected]>
Quoted 2 lines · Phil Yang
Quoted 1 line
The older version (e.g. version 7.4.0 ) of GNU C compiler for the
armhf
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
architecture doesn't support the flag '-Wno-address-of-packed-
member',
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed memberpointer")
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0
b/mk/toolchain/gcc/rte.vars.mkQuoted 4 lines
Quoted 4 lines
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-
Quoted 4 lines
index 9fc7041..ec0cbbf 100644
mk/toolchain/gcc/rte.vars.mk +0
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format- · line 106
Quoted 7 lines
mk/toolchain/gcc/rte.vars.mk +2
-0endif # disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endifYou don't need to do this, as gcc will not complain about this
unknown
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
flag
Quoted 1 line
Quoted 1 line
unless you have other issues in your code.[1] I think it's better to
keep
Quoted 1 line
Quoted 1 line
the
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that theoption
Quoted 10 lines
Quoted 10 lines
is
Quoted 2 lines
Quoted 2 lines
not
Quoted 1 line
Quoted 1 line
recognized. However, if the -Wno- form is used, the behavior is
slightly
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
different: no diagnostic is produced for -Wno-unknown-warning
unless
Quoted 2 lines
Quoted 2 lines
other
Quoted 1 line
Quoted 1 line
diagnostics are being produced. This allows the use of new -Wno-
options
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
with old compilers, but if something goes wrong, the compiler
warns
Quoted 9 lines
Quoted 9 lines
that
Quoted 8 lines
Quoted 8 lines
an
Quoted 5 lines
Quoted 1 line
unrecognized option is present."
Thanks, Bruce.
There are thousands of warnings with alignment when compiling for
ARMv7 (ARMv7 supports unaligned memory access).
Quoted 1 line
Without this new flag, the build system works fine for ARMv7. So I
add
Quoted 6 lines
Quoted 6 lines
this
Quoted 2 lines
Quoted 2 lines
conditional for ARMv7 only.
Quoted 1 line
I agree with you we should clean up the code, but it needs a lot of
effort to
Quoted 2 lines
Quoted 2 lines
achieve that.
Quoted 1 line
This patch is going to make the ARMv7 target build successfully
during
Quoted 10 lines
Quoted 10 lines
this
Quoted 4 lines
Quoted 4 lines
period.
I would go the opposite direction.
I think we should remove all warnings disablement like "-Wno-something",
Quoted 4 lines
Quoted 1 line
and clean the code.
Thanks, Thomas.
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
I think it is a compiler issue rather than a code defect in this case, as It
cannot recognize the '-Waddress-of-packed-member' flag.
Quoted 1 line
"arm-linux-gnueabihf-gcc: error: unrecognized command line option '-
Waddress-of-packed-member'"
Quoted 3 lines
Quoted 3 lines
If you want to allow building ARMv7, you can just allow warnings as
not
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
errors.
So we will still see something is wrong but it won't prevent frombuilding.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Yes. We did this already, all the alignment issues are emitted as
warnings
Quoted 8 lines
Quoted 8 lines
on ARMv7.
Quoted 3 lines
Please see these two commits:
79fa5c2a9992("mk: ignore alignment errors for ARMv7")6433c19105e8("mk: generalize strict alignment warning handling")I don't know what to do with this patch.
I think it is not how it should work,
but you say your compiler has a real bug.Quoted 6 lines
Agree with you, however I haven't found a better solution for this issue yet.
Quoted 2 lines
Can you confirm which compiler is it?
Please check the packet information dumped below, it is the latest version
in Ubuntu 18.04 LTS.
Quoted 9 lines
$ sudo apt show gcc-arm-linux-gnueabihf Package: gcc-arm-linux-gnueabihf Version: 4:7.4.0-1ubuntu2.3 Priority: optional Section: devel Source: gcc-defaults (1.176ubuntu2.3) Origin: UbuntuQuoted 1 line
Does it prevent to compile even with -Wno-error ?
Quoted 8 lines
Quoted 3 lines
Yes, it does. I put one piece of the compiling log bellow. Please take a look.
$ make -j1 CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gccRTE_DEVEL_BUILD=y
RTE_DEVEL_BUILDturns on -Werror, while what Thomas is asking about is using the opposite flag "-Wno-error". Can you do a non-developer build or put "-Wno-error" inEXTRA_CFLAGSto test this.
Thanks, Bruce.
There is no compiling issue for the non-developer build and "-Wno-error" flag build.
27/11/2019 11:00, Phil Yang (Arm Technology China):
Quoted 173 lines
Quoted 173 lines
-----Original Message-----
From: Bruce Richardson <[email protected]>
Sent: Wednesday, November 27, 2019 5:30 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Honnappa Nagarahalli <[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error on armhf architerctureQuoted 6 lines · Phil Yang (Arm Technology China)
Quoted 6 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, November 27, 2019 1:02 AM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: [email protected]; Bruce Richardson <[email protected]>; [email protected]; [email protected]; HonnappaNagarahalli
Quoted 4 lines
Quoted 4 lines
<[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag error onarmhf
Quoted 9 lines
Quoted 9 lines
architercture
12/11/2019 07:40, Phil Yang (Arm Technology China):
Quoted 6 lines
Quoted 6 lines
-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, November 12, 2019 2:03 PM
To: Phil Yang (Arm Technology China) <[email protected]>
Cc: Bruce Richardson <[email protected]>; [email protected]; [email protected]; [email protected]; HonnappaQuoted 5 lines
Quoted 5 lines
Nagarahalli
Quoted 4 lines
Quoted 4 lines
<[email protected]>; Gavin Hu (Arm Technology China) <[email protected]>; Joyce Kong (Arm Technology China) <[email protected]>; nd <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] mk: fix unsupported flag erroron
Quoted 24 lines
Quoted 24 lines
armhf
Quoted 6 lines
Quoted 6 lines
architercture
12/11/2019 06:25, Phil Yang (Arm Technology China):
Quoted 3 lines
From: Bruce Richardson <[email protected]>
Quoted 2 lines · Phil Yang
Quoted 1 line
The older version (e.g. version 7.4.0 ) of GNU C compiler for the
armhf
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
architecture doesn't support the flag '-Wno-address-of-packed-
member',
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
so remove this flag for aarch32.
Fixes a385972c3675 ("mk: disable warning for packed memberpointer")
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Signed-off-by Phil Yang <[email protected]>Reviewed-by Gavin Hu <[email protected]>Tested-by Joyce Kong <[email protected]>--- mk/toolchain/gcc/rte.vars.mk | 2 ++ 1 file changed, 2 insertions(+)Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0
b/mk/toolchain/gcc/rte.vars.mkQuoted 4 lines
Quoted 4 lines
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format-
Quoted 4 lines
index 9fc7041..ec0cbbf 100644
mk/toolchain/gcc/rte.vars.mk +0
-0@@ -100,7 +100,9 @@ WERROR_FLAGS += -Wno-format-truncation
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
mk/toolchain/gcc/rte.vars.mk WERROR_FLAGS += -Wno-format- · line 106
Quoted 7 lines
mk/toolchain/gcc/rte.vars.mk +2
-0endif # disable packed member unalign warnings +ifneq ($(CONFIG_RTE_ARCH_ARM), y) WERROR_FLAGS += -Wno-address-of-packed-member +endifYou don't need to do this, as gcc will not complain about this
unknown
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
flag
Quoted 1 line
Quoted 1 line
unless you have other issues in your code.[1] I think it's better to
keep
Quoted 1 line
Quoted 1 line
the
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
code clean in this case, otherwise we'll have the code littered with conditionals for various flags.
/Bruce
[1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
"When an unrecognized warning option is requested (e.g., -Wunknown-warning), GCC emits a diagnostic stating that theoption
Quoted 10 lines
Quoted 10 lines
is
Quoted 2 lines
Quoted 2 lines
not
Quoted 1 line
Quoted 1 line
recognized. However, if the -Wno- form is used, the behavior is
slightly
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
different: no diagnostic is produced for -Wno-unknown-warning
unless
Quoted 2 lines
Quoted 2 lines
other
Quoted 1 line
Quoted 1 line
diagnostics are being produced. This allows the use of new -Wno-
options
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
with old compilers, but if something goes wrong, the compiler
warns
Quoted 9 lines
Quoted 9 lines
that
Quoted 8 lines
Quoted 8 lines
an
Quoted 5 lines
Quoted 1 line
unrecognized option is present."
Thanks, Bruce.
There are thousands of warnings with alignment when compiling for
ARMv7 (ARMv7 supports unaligned memory access).
Quoted 1 line
Without this new flag, the build system works fine for ARMv7. So I
add
Quoted 6 lines
Quoted 6 lines
this
Quoted 2 lines
Quoted 2 lines
conditional for ARMv7 only.
Quoted 1 line
I agree with you we should clean up the code, but it needs a lot of
effort to
Quoted 2 lines
Quoted 2 lines
achieve that.
Quoted 1 line
This patch is going to make the ARMv7 target build successfully
during
Quoted 10 lines
Quoted 10 lines
this
Quoted 4 lines
Quoted 4 lines
period.
I would go the opposite direction.
I think we should remove all warnings disablement like "-Wno-something",
Quoted 4 lines
Quoted 1 line
and clean the code.
Thanks, Thomas.
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
I think it is a compiler issue rather than a code defect in this case, as It
cannot recognize the '-Waddress-of-packed-member' flag.
Quoted 1 line
"arm-linux-gnueabihf-gcc: error: unrecognized command line option '-
Waddress-of-packed-member'"
Quoted 3 lines
Quoted 3 lines
If you want to allow building ARMv7, you can just allow warnings as
not
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
errors.
So we will still see something is wrong but it won't prevent frombuilding.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Yes. We did this already, all the alignment issues are emitted as
warnings
Quoted 8 lines
Quoted 8 lines
on ARMv7.
Quoted 3 lines
Please see these two commits:
79fa5c2a9992("mk: ignore alignment errors for ARMv7")6433c19105e8("mk: generalize strict alignment warning handling")I don't know what to do with this patch.
I think it is not how it should work,
but you say your compiler has a real bug.Quoted 6 lines
Agree with you, however I haven't found a better solution for this issue yet.
Quoted 2 lines
Can you confirm which compiler is it?
Please check the packet information dumped below, it is the latest version
in Ubuntu 18.04 LTS.
Quoted 12 lines
$ sudo apt show gcc-arm-linux-gnueabihf Package: gcc-arm-linux-gnueabihf Version: 4:7.4.0-1ubuntu2.3 Priority: optional Section: devel Source: gcc-defaults (1.176ubuntu2.3) Origin: UbuntuQuoted 1 line
Does it prevent to compile even with -Wno-error ?
Yes, it does. I put one piece of the compiling log bellow. Please take a look.
$ make -j1 CROSS=arm-linux-gnueabihf- T=arm-armv7a-linuxapp-gcc
Quoted 8 lines
Quoted 5 lines
RTE_DEVEL_BUILD=y
RTE_DEVEL_BUILDturns on -Werror, while what Thomas is asking about is using the opposite flag "-Wno-error". Can you do a non-developer build or put "-Wno-error" inEXTRA_CFLAGSto test this.Thanks, Bruce.
There is no compiling issue for the non-developer build and "-Wno-error" flag build.
Cool, so we can classify this patch as "rejected".