board/qemu/ppc*: disable Werror while building ppc kernel with gcc >= 9.1
PATCH 1/1 board/qemu/ppc*: disable Werror while building ppc kernel with gcc >= 9.1
From patch [1] included in kernel >= 5.0:
"The upcoming GCC 9 release extends the -Wmissing-attributes warnings (enabled by -Wall) to C and aliases: it warns when particular function attributes are missing in the aliases but not in their target.
In particular, it triggers for all the init/cleanup_module aliases in the kernel (defined by the module_init/exit macros), ending up being very noisy.
These aliases point to the __init/__exit functions of a module, which are defined as __cold (among other attributes). However, the aliases themselves do not have the __cold attribute.
Since the compiler behaves differently when compiling a __cold function as well as when compiling paths leading to calls to __cold functions, the warning is trying to point out the possibly-forgotten attribute in the alias."
Werror is set by default while building ppc kernel [2], but some warning can be introduced while building current kernel with newer compiler (for example building kernel 4.19 with gcc 9.1).
Instead of backporting this patch [1] to kernel 4.19, select the Kconfig option CONFIG_PPC_DISABLE_WERROR that allow to disable Werror.
Add CONFIG_PPC_DISABLE_WERROR only for qemu ppc{64} defconfig since they are used for CI with toolchain-builder's gitlab [3].
Fixes:
https://gitlab.com/kubu93/toolchains-builder/-/jobs/205435741
[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=a6e60d84989fa0e91db7f236eda40453b0e44afa
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=ba55bd74360ea4b8b95e73ed79474d37ff482b36
[3] https://gitlab.com/bootlin/toolchains-builder
---
Note: It can be usefull to select CONFIG_PPC_DISABLE_WERROR for other ppc board defconfig.
--- board/qemu/ppc-g3beige/linux.config | 1 + board/qemu/ppc-mpc8544ds/linux.config | 1 + board/qemu/ppc-virtex-ml507/linux.config | 1 + board/qemu/ppc64-e5500/linux.fragment | 2 ++ board/qemu/ppc64-pseries/linux.fragment | 1 + board/qemu/ppc64le-pseries/linux.fragment | 1 + configs/qemu_ppc64_pseries_defconfig | 1 + configs/qemu_ppc64le_pseries_defconfig | 1 + 8 files changed, 9 insertions(+) create mode 100644 board/qemu/ppc64-pseries/linux.fragment create mode 100644 board/qemu/ppc64le-pseries/linux.fragment
board/qemu/ppc-g3beige/linux.config +1 -0
@@ -23,3 +23,4 @@ CONFIG_EXT4_FS=y CONFIG_TMPFS=y CONFIG_TMPFS_POSIX_ACL=y CONFIG_BOOTX_TEXT=y +CONFIG_PPC_DISABLE_WERROR=y
board/qemu/ppc-mpc8544ds/linux.config +1 -0
@@ -36,3 +36,4 @@ CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_FSL=y CONFIG_USB_OHCI_HCD=y CONFIG_TMPFS=y +CONFIG_PPC_DISABLE_WERROR=y
board/qemu/ppc-virtex-ml507/linux.config +1 -0
@@ -34,3 +34,4 @@ CONFIG_EXT4_FS=y CONFIG_AUTOFS4_FS=y CONFIG_VFAT_FS=y CONFIG_TMPFS=y +CONFIG_PPC_DISABLE_WERROR=y
board/qemu/ppc64-e5500/linux.fragment +2 -0
@@ -8,3 +8,5 @@ CONFIG_VIRTIO_PCI=y CONFIG_HW_RANDOM_VIRTIO=y CONFIG_VIRTIO_BLK=y CONFIG_VIRTIO_NET=y + +CONFIG_PPC_DISABLE_WERROR=y
board/qemu/ppc64-pseries/linux.fragment new file +1 -0
@@ -0,0 +1 @@ +CONFIG_PPC_DISABLE_WERROR=y
board/qemu/ppc64le-pseries/linux.fragment new file +1 -0
@@ -0,0 +1 @@ +CONFIG_PPC_DISABLE_WERROR=y
configs/qemu_ppc64_pseries_defconfig +1 -0
@@ -19,3 +19,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.16" BR2_LINUX_KERNEL_DEFCONFIG="pseries" BR2_LINUX_KERNEL_VMLINUX=y +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/ppc64-pseries/linux.fragment"
configs/qemu_ppc64le_pseries_defconfig +1 -0
@@ -19,3 +19,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.19.16" BR2_LINUX_KERNEL_DEFCONFIG="pseries_le" BR2_LINUX_KERNEL_VMLINUX=y +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/qemu/ppc64le-pseries/linux.fragment"
Signature · 1 line
2.14.5
PATCH 1/1 board/qemu/ppc*: disable Werror while building ppc kernel with gcc >= 9.1
Quoted 2 lines · Romain Naour
Add
CONFIG_PPC_DISABLE_WERRORonly for qemu ppc{64} defconfig since they are used for CI with toolchain-builder's gitlab [3].
Maybe it would be better to have a single fragment file
board/linux-ppc-disable-werror.fragment
and include that in all the relevant defconfigs, rather than updating each linux config?
Regards,
Arnout
PATCH 1/1 board/qemu/ppc*: disable Werror while building ppc kernel with gcc >= 9.1
Hi Arnout,
Le 01/05/2019 ? 15:32, Arnout Vandecappelle a ?crit?:
Quoted 10 lines · Romain Naour
Quoted 2 lines
Add
CONFIG_PPC_DISABLE_WERRORonly for qemu ppc{64} defconfig since they are used for CI with toolchain-builder's gitlab [3].Maybe it would be better to have a single fragment file
board/linux-ppc-disable-werror.fragment
and include that in all the relevant defconfigs, rather than updating each linux config?
I'm not sure how to handle such fragments in Buildroot. Storing fragments in board directory seems not great.
Maybe add a new fragments directory in linux package directory:
linux/fragments/linux-ppc-disable-werror.fragment
Or a new directory configs/fragments/linux/linux-ppc-disable-werror.fragment
Thought ?
Best regards,
Romain
Quoted 4 lines
Regards,
Arnout
PATCH 1/1 board/qemu/ppc*: disable Werror while building ppc kernel with gcc >= 9.1
Hello Romain,
Quoted 7 lines · On Wed, 1 May 2019 15:57:47 +0200 Romain Naour <[email protected]> wrote:
Quoted 4 lines
Maybe it would be better to have a single fragment file
board/linux-ppc-disable-werror.fragment
and include that in all the relevant defconfigs, rather than updating each linux config?I'm not sure how to handle such fragments in Buildroot. Storing fragments in board directory seems not great.
Why ? We already have plenty of these:
$ find board/ | grep frag board/beaglebone/linux-4.1-sgx.fragment board/technologic/ts4800/linux.fragment board/engicam/icorem6/linux_qt5.fragment board/orangepi/orangepi-pc/linux.fragment board/amarula/vyasa/linux_gmac.fragment board/udoo/mx6qdl/linux.fragment board/lego/ev3/linux.fragment board/lego/ev3/busybox.fragment board/stmicroelectronics/stm32mp157-dk/uboot-fragment.config board/freescale/imx6-sabresd/linux_qt5.fragment board/freescale/warpboard/linux.fragment board/solidrun/macchiatobin/uboot-fragment.config board/solidrun/clearfog/linux.fragment board/synopsys/hsdk/linux.fragment board/qemu/nios2-10m50/linux.fragment board/qemu/ppc64-e5500/linux.fragment board/lemaker/bananapro/linux-wifi.fragment board/chromebook/snow/linux-4.15.fragment board/olimex/imx233_olinuxino/linux-wifi.fragment
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 board/qemu/ppc*: disable Werror while building ppc kernel with gcc >= 9.1
Hi Thomas,
Le 01/05/2019 ? 21:38, Thomas Petazzoni a ?crit?:
Quoted 27 lines
Hello Romain,
Quoted 7 lines · On Wed, 1 May 2019 15:57:47 +0200 Romain Naour <[email protected]> wrote:
Quoted 4 lines
Maybe it would be better to have a single fragment file
board/linux-ppc-disable-werror.fragment
and include that in all the relevant defconfigs, rather than updating each linux config?I'm not sure how to handle such fragments in Buildroot. Storing fragments in board directory seems not great.
Why ? We already have plenty of these:
$ find board/ | grep frag board/beaglebone/linux-4.1-sgx.fragment board/technologic/ts4800/linux.fragment board/engicam/icorem6/linux_qt5.fragment board/orangepi/orangepi-pc/linux.fragment board/amarula/vyasa/linux_gmac.fragment board/udoo/mx6qdl/linux.fragment board/lego/ev3/linux.fragment board/lego/ev3/busybox.fragment board/stmicroelectronics/stm32mp157-dk/uboot-fragment.config board/freescale/imx6-sabresd/linux_qt5.fragment board/freescale/warpboard/linux.fragment
Quoted 8 lines
board/solidrun/macchiatobin/uboot-fragment.config board/solidrun/clearfog/linux.fragment board/synopsys/hsdk/linux.fragment board/qemu/nios2-10m50/linux.fragment board/qemu/ppc64-e5500/linux.fragment board/lemaker/bananapro/linux-wifi.fragment board/chromebook/snow/linux-4.15.fragment board/olimex/imx233_olinuxino/linux-wifi.fragment
I mean storing the fragment in board/linux-ppc-disable-werror.fragment that is shared between several boards.
Each existing linux.fragment are only used by one board.
Best regards,
Romain
Quoted 5 lines
Best regards,
Thomas
PATCH 1/1 board/qemu/ppc*: disable Werror while building ppc kernel with gcc >= 9.1
In reply to Romain NaourQuoted 9 lines · Romain Naour
Hi Arnout,
Le 01/05/2019 ? 15:32, Arnout Vandecappelle a ?crit?:
Quoted 6 lines · Romain Naour
Quoted 2 lines
Add
CONFIG_PPC_DISABLE_WERRORonly for qemu ppc{64} defconfig since they are used for CI with toolchain-builder's gitlab [3].
Quoted 7 lines
Quoted 4 lines
Maybe it would be better to have a single fragment file
board/linux-ppc-disable-werror.fragment
and include that in all the relevant defconfigs, rather than updating each linux config?I'm not sure how to handle such fragments in Buildroot. Storing fragments in board directory seems not great.
Maybe in board/shared then?
Quoted 2 lines
Maybe add a new fragments directory in linux package directory:
linux/fragments/linux-ppc-disable-werror.fragment
I don't like that. that. IMO, the linux/ directory should only contain stuff
that is used by the linux package infra itself. IMO the defconfigs should only refer to paths in board/ and utils/.
We currently have two exceptions to that "rule": genimage.sh which is in
support/scripts instead of utils, and busybox-minimal.config which is in the busybox directory.
Quoted 1 line
Or a new directory configs/fragments/linux/linux-ppc-disable-werror.fragment
I feel that configs/ is an artefact of the kconfig infra, it would in fact be a
lot more logical to have the defconfigs in the board directory. But board/fragments/linux would work as well. Though I don't see many other shared fragments than linux config fragments...
Regards,
Arnout
Quoted 11 lines
Thought ?
Best regards,
RomainQuoted 4 lines
Regards,
Arnout