Skip to contentSkip to conversation

board/qemu/sparc64-sun4u: avoid gcc-11 warning to build the kernel

PATCH New Romain Naour 2 participants 10 messages Jun 12, 2021 – Jun 20, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 board/qemu/sparc64-sun4u: avoid gcc-11 warning to build the kernel

gcc-11 warns about what appears to be an out-of-range array access but stop the build due to -Werror added to cflags:

arch/sparc/kernel/mdesc.c: In function 'mdesc_node_by_name':
arch/sparc/kernel/mdesc.c:647:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
647 | if (!strcmp(names + ep[ret].name_offset, name))

      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
   77 |         struct mdesc_hdr        mdesc;
      |                                 ^~~~~
arch/sparc/kernel/mdesc.c: In function 'mdesc_get_property':
arch/sparc/kernel/mdesc.c:692:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  692 |                 if (!strcmp(names + ep->name_offset, name)) {
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
   77 |         struct mdesc_hdr        mdesc;
      |                                 ^~~~~
arch/sparc/kernel/mdesc.c: In function 'mdesc_next_arc':
arch/sparc/kernel/mdesc.c:719:21: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  719 |                 if (strcmp(names + ep->name_offset, arc_type))
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
   77 |         struct mdesc_hdr        mdesc;
      |                                 ^~~~~

cc1: all warnings being treated as errors

The issue was initially reported to gcc [1] where it was analized. As suggested, change the struct mdesc_elem * accesses from the end of mdesc to those from the beginning of the data array.

Update the prototype of node_block(), name_block() and data_block() since the code really seems to want to do is to compute the address somewhere into the chunk pointed to by hp.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100262

Upstream status: Pending
https://www.spinics.net/lists/sparclinux/msg26385.html

---
 ...ringop-overread-warning-to-access-Ma.patch | 154 ++++++++++++++++++
 configs/qemu_sparc64_sun4u_defconfig          |   3 +
 2 files changed, 157 insertions(+)
 create mode 100644 board/qemu/sparc64-sun4u/patches/linux/0001-sparc64-avoid-stringop-overread-warning-to-access-Ma.patch
board/qemu/sparc64-sun4u/patches/linux/0001-sparc64-avoid-stringop-overread-warning-to-access-Ma.patch new file +154 -0
new file mode 100644
index 0000000000..c02704696d
@@ -0,0 +1,154 @@
+From 82d91965519c20639c24aadd022b2859461562bc Mon Sep 17 00:00:00 2001
+From: Romain Naour <[email protected]>
+Date: Tue, 27 Apr 2021 14:54:28 +0200
+Subject: [PATCH] sparc64: avoid stringop-overread warning to access Machine
+ description datas
+
+gcc-11 warns about what appears to be an out-of-range array access but
+stop the build due to -Werror added to cflags:
+
+arch/sparc/kernel/mdesc.c: In function 'mdesc_node_by_name':
+arch/sparc/kernel/mdesc.c:647:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
+  647 |                 if (!strcmp(names + ep[ret].name_offset, name))
+      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
+   77 |         struct mdesc_hdr        mdesc;
+      |                                 ^~~~~
+arch/sparc/kernel/mdesc.c: In function 'mdesc_get_property':
+arch/sparc/kernel/mdesc.c:692:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
+  692 |                 if (!strcmp(names + ep->name_offset, name)) {
+      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
+   77 |         struct mdesc_hdr        mdesc;
+      |                                 ^~~~~
+arch/sparc/kernel/mdesc.c: In function 'mdesc_next_arc':
+arch/sparc/kernel/mdesc.c:719:21: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
+  719 |                 if (strcmp(names + ep->name_offset, arc_type))
+      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+arch/sparc/kernel/mdesc.c:77:33: note: at offset 16 into source object 'mdesc' of size 16
+   77 |         struct mdesc_hdr        mdesc;
+      |                                 ^~~~~
+cc1: all warnings being treated as errors
+
+The issue was initially reported to gcc [1] where it was analized.
+As suggested, change the struct mdesc_elem * accesses from the end
+of mdesc to those from the beginning of the data array.
+
+Update the prototype of node_block(), name_block() and data_block()
+since the code really seems to want to do is to compute the address
+somewhere into the chunk pointed to by hp.
+
+[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100262
+
+Upstream status: Pending 
+https://www.spinics.net/lists/sparclinux/msg26385.html
+
+Signed-off-by: Romain Naour <[email protected]>
+---
+ arch/sparc/kernel/mdesc.c | 37 +++++++++++++++++++++----------------
+ 1 file changed, 21 insertions(+), 16 deletions(-)
+
+diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
+index 8e645ddac58e..3403555aa1e2 100644
+--- a/arch/sparc/kernel/mdesc.c
++++ b/arch/sparc/kernel/mdesc.c
+@@ -75,6 +75,7 @@ struct mdesc_handle {
+ 	refcount_t		refcnt;
+ 	unsigned int		handle_size;
+ 	struct mdesc_hdr	mdesc;
++	char			data[];
+ };
+ 
+ typedef int (*mdesc_node_info_get_f)(struct mdesc_handle *, u64,
+@@ -610,26 +611,30 @@ int mdesc_get_node_info(struct mdesc_handle *hp, u64 node,
+ }
+ EXPORT_SYMBOL(mdesc_get_node_info);
+ 
+-static struct mdesc_elem *node_block(struct mdesc_hdr *mdesc)
++static struct mdesc_elem *node_block(struct mdesc_handle *hp)
+ {
+-	return (struct mdesc_elem *) (mdesc + 1);
++	return (struct mdesc_elem *) hp + offsetof(struct mdesc_handle, data);
+ }
+ 
+-static void *name_block(struct mdesc_hdr *mdesc)
++static void *name_block(struct mdesc_handle *hp)
+ {
+-	return ((void *) node_block(mdesc)) + mdesc->node_sz;
++	struct mdesc_hdr *mdesc = &hp->mdesc;
++
++	return ((void *) node_block(hp)) + mdesc->node_sz;
+ }
+ 
+-static void *data_block(struct mdesc_hdr *mdesc)
++static void *data_block(struct mdesc_handle *hp)
+ {
+-	return ((void *) name_block(mdesc)) + mdesc->name_sz;
++	struct mdesc_hdr *mdesc = &hp->mdesc;
++
++	return ((void *) name_block(hp)) + mdesc->name_sz;
+ }
+ 
+ u64 mdesc_node_by_name(struct mdesc_handle *hp,
+ 		       u64 from_node, const char *name)
+ {
+-	struct mdesc_elem *ep = node_block(&hp->mdesc);
+-	const char *names = name_block(&hp->mdesc);
++	struct mdesc_elem *ep = node_block(hp);
++	const char *names = name_block(hp);
+ 	u64 last_node = hp->mdesc.node_sz / 16;
+ 	u64 ret;
+ 
+@@ -657,15 +662,15 @@ EXPORT_SYMBOL(mdesc_node_by_name);
+ const void *mdesc_get_property(struct mdesc_handle *hp, u64 node,
+ 			       const char *name, int *lenp)
+ {
+-	const char *names = name_block(&hp->mdesc);
++	const char *names = name_block(hp);
+ 	u64 last_node = hp->mdesc.node_sz / 16;
+-	void *data = data_block(&hp->mdesc);
++	void *data = data_block(hp);
+ 	struct mdesc_elem *ep;
+ 
+ 	if (node == MDESC_NODE_NULL || node >= last_node)
+ 		return NULL;
+ 
+-	ep = node_block(&hp->mdesc) + node;
++	ep = node_block(hp) + node;
+ 	ep++;
+ 	for (; ep->tag != MD_NODE_END; ep++) {
+ 		void *val = NULL;
+@@ -702,8 +707,8 @@ EXPORT_SYMBOL(mdesc_get_property);
+ 
+ u64 mdesc_next_arc(struct mdesc_handle *hp, u64 from, const char *arc_type)
+ {
+-	struct mdesc_elem *ep, *base = node_block(&hp->mdesc);
+-	const char *names = name_block(&hp->mdesc);
++	struct mdesc_elem *ep, *base = node_block(hp);
++	const char *names = name_block(hp);
+ 	u64 last_node = hp->mdesc.node_sz / 16;
+ 
+ 	if (from == MDESC_NODE_NULL || from >= last_node)
+@@ -728,7 +733,7 @@ EXPORT_SYMBOL(mdesc_next_arc);
+ 
+ u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc)
+ {
+-	struct mdesc_elem *ep, *base = node_block(&hp->mdesc);
++	struct mdesc_elem *ep, *base = node_block(hp);
+ 
+ 	ep = base + arc;
+ 
+@@ -738,8 +743,8 @@ EXPORT_SYMBOL(mdesc_arc_target);
+ 
+ const char *mdesc_node_name(struct mdesc_handle *hp, u64 node)
+ {
+-	struct mdesc_elem *ep, *base = node_block(&hp->mdesc);
+-	const char *names = name_block(&hp->mdesc);
++	struct mdesc_elem *ep, *base = node_block(hp);
++	const char *names = name_block(hp);
+ 	u64 last_node = hp->mdesc.node_sz / 16;
+ 
+ 	if (node == MDESC_NODE_NULL || node >= last_node)
+-- 
+2.30.2
+
configs/qemu_sparc64_sun4u_defconfig +3 -0
index cff0c2968a..6a999298eb 100644
@@ -2,6 +2,9 @@
 BR2_sparc64=y
 BR2_sparc_v9=y
 
+# Patches
+BR2_GLOBAL_PATCH_DIR="board/qemu/sparc64-sun4u/patches"
+
 # System
 BR2_SYSTEM_DHCP="eth0"
 
Signature · 1 line
2.31.1
#1 lore raw

PATCH 2/6 toolchain/Config.in: add BR2_TOOLCHAIN_GCC_AT_LEAST_11 blind option

In order to add gcc 11 support for internal and external toolchain in follow-up commits, introduce BR2_TOOLCHAIN_GCC_AT_LEAST_11 symbol.

---
 toolchain/Config.in | 5 +++++
 1 file changed, 5 insertions(+)
toolchain/Config.in +5 -0
index 0181ef07de..fe327b9f46 100644
@@ -630,10 +630,15 @@ config BR2_TOOLCHAIN_GCC_AT_LEAST_10
 	bool
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_9
 
+config BR2_TOOLCHAIN_GCC_AT_LEAST_11
+	bool
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_10
+
 # This order guarantees that the highest version is set, as kconfig
 # stops affecting a value on the first matching default.
 config BR2_TOOLCHAIN_GCC_AT_LEAST
 	string
+	default "11"	if BR2_TOOLCHAIN_GCC_AT_LEAST_11
 	default "10"	if BR2_TOOLCHAIN_GCC_AT_LEAST_10
 	default "9"	if BR2_TOOLCHAIN_GCC_AT_LEAST_9
 	default "8"	if BR2_TOOLCHAIN_GCC_AT_LEAST_8
Signature · 1 line
2.31.1
#2 lore raw

PATCH 3/6 package/gcc: add support for gcc 11

In reply to Romain Naour

Disable sparc architecture for gcc 11 due to an recent gcc change that broke uClibc-ng. The change was reverted by the patch 0005-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch for gcc 8.4, 9.3 and 10.1 but stop maintaining it for newer gcc releases.

Rutime tested:
https://gitlab.com/kubu93/buildroot/-/pipelines/318043235

https://gcc.gnu.org/gcc-11/changes.html
https://gcc.gnu.org/gcc-11/porting_to.html

---
 package/gcc/Config.in.host | 16 ++++++++++++++++
 package/gcc/gcc.hash       |  2 ++
 2 files changed, 18 insertions(+)
package/gcc/Config.in.host +16 -0
index 5b056a934a..a89d92bf61 100644
@@ -50,6 +50,21 @@ config BR2_GCC_VERSION_10_X
 	depends on !BR2_csky
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_10
 
+config BR2_GCC_VERSION_11_X
+	bool "gcc 11.x"
+	# powerpc spe support has been deprecated since gcc 8.x.
+	# https://gcc.gnu.org/ml/gcc/2018-04/msg00102.html
+	depends on !BR2_powerpc_SPE
+	# C-SKY sk610 needs abiv1, which is not supported in
+	# upstream gcc. C-SKY gcc upstream support not tested
+	# with upstream binutils and glibc.
+	depends on !BR2_csky
+	# uClibc-ng broken on sparc due to recent gcc changes
+	# that need to be reverted since gcc 8.4, 9.3 and 10.1.
+	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98784
+	depends on !BR2_sparc
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_11
+
 endchoice
 
 # libcilkrts was introduced in gcc 4.9 and removed in gcc 8.x
@@ -75,6 +90,7 @@ config BR2_GCC_VERSION
 	default "8.4.0"     if BR2_GCC_VERSION_8_X
 	default "9.3.0"     if BR2_GCC_VERSION_9_X
 	default "10.3.0"    if BR2_GCC_VERSION_10_X
+	default "11.1.0"    if BR2_GCC_VERSION_11_X
 	default "arc-2020.09-release" if BR2_GCC_VERSION_ARC
 	default "48152afb96c59733d5bc79e3399bb7b3d4b44266" if BR2_GCC_VERSION_CSKY
 
package/gcc/gcc.hash +2 -0
index 566ae09fc2..8a8a7b4581 100644
@@ -4,6 +4,8 @@ sha512  6de904f552a02de33b11ef52312bb664396efd7e1ce3bbe37bfad5ef617f133095b3767b
 sha512  4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de  gcc-9.3.0.tar.xz
 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-10.3.0/sha512.sum
 sha512  2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86  gcc-10.3.0.tar.xz
+# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-11.1.0/sha512.sum
+sha512  fd6bba0f67ff48069d03073d1a9b5e896383b1cfc9dde008e868e60a9ec5014a837d56af0ecbf467b3fb9b37ec74a676e819a18b44393a0a3c4280175b5d7ad8  gcc-11.1.0.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  b0853e2b1c5998044392023fa653e399e74118c46e616504ac59e1a2cf27620f94434767ce06b6cf4ca3dfb57f81d6eda92752befaf095ea5e564a9181b4659c  gcc-arc-2020.09-release.tar.gz
Signature · 1 line
2.31.1
#3 lore raw

PATCH 3/6 package/gcc: add support for gcc 11

Quoted 5 lines · Romain Naour

Disable sparc architecture for gcc 11 due to an recent gcc change that broke uClibc-ng. The change was reverted by the patch 0005-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch for gcc 8.4, 9.3 and 10.1 but stop maintaining it for newer gcc releases.

So, that means we will be forced to drop sparc support in a few years when we
stop maintaining GCC 10, right?

I'm not crying over it, that's for sure :-)

Regards,
Arnout

Quoted 61 lines

Rutime tested:
https://gitlab.com/kubu93/buildroot/-/pipelines/318043235

https://gcc.gnu.org/gcc-11/changes.html
https://gcc.gnu.org/gcc-11/porting_to.html

---
 package/gcc/Config.in.host | 16 ++++++++++++++++
 package/gcc/gcc.hash       |  2 ++
 2 files changed, 18 insertions(+)
package/gcc/Config.in.host +16 -0
index 5b056a934a..a89d92bf61 100644
@@ -50,6 +50,21 @@ config BR2_GCC_VERSION_10_X
 	depends on !BR2_csky
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_10
 
+config BR2_GCC_VERSION_11_X
+	bool "gcc 11.x"
+	# powerpc spe support has been deprecated since gcc 8.x.
+	# https://gcc.gnu.org/ml/gcc/2018-04/msg00102.html
+	depends on !BR2_powerpc_SPE
+	# C-SKY sk610 needs abiv1, which is not supported in
+	# upstream gcc. C-SKY gcc upstream support not tested
+	# with upstream binutils and glibc.
+	depends on !BR2_csky
+	# uClibc-ng broken on sparc due to recent gcc changes
+	# that need to be reverted since gcc 8.4, 9.3 and 10.1.
+	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98784
+	depends on !BR2_sparc
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_11
+
 endchoice
 
 # libcilkrts was introduced in gcc 4.9 and removed in gcc 8.x
@@ -75,6 +90,7 @@ config BR2_GCC_VERSION
 	default "8.4.0"     if BR2_GCC_VERSION_8_X
 	default "9.3.0"     if BR2_GCC_VERSION_9_X
 	default "10.3.0"    if BR2_GCC_VERSION_10_X
+	default "11.1.0"    if BR2_GCC_VERSION_11_X
 	default "arc-2020.09-release" if BR2_GCC_VERSION_ARC
 	default "48152afb96c59733d5bc79e3399bb7b3d4b44266" if BR2_GCC_VERSION_CSKY
 
package/gcc/gcc.hash +2 -0
index 566ae09fc2..8a8a7b4581 100644
@@ -4,6 +4,8 @@ sha512  6de904f552a02de33b11ef52312bb664396efd7e1ce3bbe37bfad5ef617f133095b3767b
 sha512  4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de  gcc-9.3.0.tar.xz
 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-10.3.0/sha512.sum
 sha512  2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86  gcc-10.3.0.tar.xz
+# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-11.1.0/sha512.sum
+sha512  fd6bba0f67ff48069d03073d1a9b5e896383b1cfc9dde008e868e60a9ec5014a837d56af0ecbf467b3fb9b37ec74a676e819a18b44393a0a3c4280175b5d7ad8  gcc-11.1.0.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  b0853e2b1c5998044392023fa653e399e74118c46e616504ac59e1a2cf27620f94434767ce06b6cf4ca3dfb57f81d6eda92752befaf095ea5e564a9181b4659c  gcc-arc-2020.09-release.tar.gz
#4 lore raw

PATCH 3/6 package/gcc: add support for gcc 11

Hi Arnout,

Le 20/06/2021 ? 19:08, Arnout Vandecappelle a ?crit?:

Quoted 11 lines · Romain Naour
Quoted 5 lines

Disable sparc architecture for gcc 11 due to an recent gcc change that broke uClibc-ng. The change was reverted by the patch 0005-Revert-re-PR-target-92095-internal-error-with-O1-mcp.patch for gcc 8.4, 9.3 and 10.1 but stop maintaining it for newer gcc releases.

So, that means we will be forced to drop sparc support in a few years when we
stop maintaining GCC 10, right?

Indeed but uclibc-ng is the only remaining libc we have for sparc32 (sparcV8). The patch I reverted for gcc 8,9,10 broke the uClibc-ng port for sparc that was not modified since more than a decade.

The problem is not easy to investigate since the system crash right after the end of a forked process. For example, when you start 'ls' command, you'll see the directory content just before the crash. For some reason uClibc-ng fail to resume the initial process.

Quoted 2 lines

I'm not crying over it, that's for sure :-)

Well, even if it will not be a lost, the sparc defconfig was up-to-date and running until now.

Best regards,
Romain

Quoted 65 lines

Regards,
Arnout

Quoted 61 lines

Rutime tested:
https://gitlab.com/kubu93/buildroot/-/pipelines/318043235

https://gcc.gnu.org/gcc-11/changes.html
https://gcc.gnu.org/gcc-11/porting_to.html

---
 package/gcc/Config.in.host | 16 ++++++++++++++++
 package/gcc/gcc.hash       |  2 ++
 2 files changed, 18 insertions(+)
package/gcc/Config.in.host +16 -0
index 5b056a934a..a89d92bf61 100644
@@ -50,6 +50,21 @@ config BR2_GCC_VERSION_10_X
 	depends on !BR2_csky
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_10
 
+config BR2_GCC_VERSION_11_X
+	bool "gcc 11.x"
+	# powerpc spe support has been deprecated since gcc 8.x.
+	# https://gcc.gnu.org/ml/gcc/2018-04/msg00102.html
+	depends on !BR2_powerpc_SPE
+	# C-SKY sk610 needs abiv1, which is not supported in
+	# upstream gcc. C-SKY gcc upstream support not tested
+	# with upstream binutils and glibc.
+	depends on !BR2_csky
+	# uClibc-ng broken on sparc due to recent gcc changes
+	# that need to be reverted since gcc 8.4, 9.3 and 10.1.
+	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98784
+	depends on !BR2_sparc
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_11
+
 endchoice
 
 # libcilkrts was introduced in gcc 4.9 and removed in gcc 8.x
@@ -75,6 +90,7 @@ config BR2_GCC_VERSION
 	default "8.4.0"     if BR2_GCC_VERSION_8_X
 	default "9.3.0"     if BR2_GCC_VERSION_9_X
 	default "10.3.0"    if BR2_GCC_VERSION_10_X
+	default "11.1.0"    if BR2_GCC_VERSION_11_X
 	default "arc-2020.09-release" if BR2_GCC_VERSION_ARC
 	default "48152afb96c59733d5bc79e3399bb7b3d4b44266" if BR2_GCC_VERSION_CSKY
 
package/gcc/gcc.hash +2 -0
index 566ae09fc2..8a8a7b4581 100644
@@ -4,6 +4,8 @@ sha512  6de904f552a02de33b11ef52312bb664396efd7e1ce3bbe37bfad5ef617f133095b3767b
 sha512  4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de  gcc-9.3.0.tar.xz
 # From ftp://gcc.gnu.org/pub/gcc/releases/gcc-10.3.0/sha512.sum
 sha512  2b2dd7453d48a398c29eaebd1422b70341001b8c90a62aee51e83344e7fdd8a8e45f82a4a9165bd7edc76dada912c932f4b6632c5636760fec4c5d7e402b3f86  gcc-10.3.0.tar.xz
+# From ftp://gcc.gnu.org/pub/gcc/releases/gcc-11.1.0/sha512.sum
+sha512  fd6bba0f67ff48069d03073d1a9b5e896383b1cfc9dde008e868e60a9ec5014a837d56af0ecbf467b3fb9b37ec74a676e819a18b44393a0a3c4280175b5d7ad8  gcc-11.1.0.tar.xz
 
 # Locally calculated (fetched from Github)
 sha512  b0853e2b1c5998044392023fa653e399e74118c46e616504ac59e1a2cf27620f94434767ce06b6cf4ca3dfb57f81d6eda92752befaf095ea5e564a9181b4659c  gcc-arc-2020.09-release.tar.gz
#5 lore raw

PATCH 4/6 arch: add BR2_ARCH_NEEDS_GCC_AT_LEAST_11

In reply to Romain Naour

This new symbol will be used by architectures introduced with gcc 11.

[1] https://gcc.gnu.org/gcc-11/changes.html

---
 arch/Config.in             | 4 ++++
 package/gcc/Config.in.host | 1 +
 2 files changed, 5 insertions(+)
arch/Config.in +4 -0
index 155403c363..1853e26bb4 100644
@@ -321,6 +321,10 @@ config BR2_ARCH_NEEDS_GCC_AT_LEAST_10
 	bool
 	select BR2_ARCH_NEEDS_GCC_AT_LEAST_9
 
+config BR2_ARCH_NEEDS_GCC_AT_LEAST_11
+	bool
+	select BR2_ARCH_NEEDS_GCC_AT_LEAST_10
+
 # The following string values are defined by the individual
 # Config.in.$ARCH files
 config BR2_ARCH
package/gcc/Config.in.host +1 -0
index a89d92bf61..5d66834301 100644
@@ -41,6 +41,7 @@ config BR2_GCC_VERSION_9_X
 
 config BR2_GCC_VERSION_10_X
 	bool "gcc 10.x"
+	depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_11
 	# powerpc spe support has been deprecated since gcc 8.x.
 	# https://gcc.gnu.org/ml/gcc/2018-04/msg00102.html
 	depends on !BR2_powerpc_SPE
Signature · 1 line
2.31.1
#6 lore raw

PATCH 5/6 toolchain/toolchain-external/toolchain-external-custom: add gcc 11 version selection

In reply to Romain Naour

This patch allows to use an external toolchain based on gcc 11.

---
 .../toolchain-external-custom/Config.in.options               | 4 ++++
 1 file changed, 4 insertions(+)
toolchain/toolchain-external/toolchain-external-custom/Config.in.options +4 -0
index ba9aeb29ad..4a3345e4a5 100644
@@ -31,6 +31,10 @@ choice
 	  Set to the gcc version that is used by your external
 	  toolchain.
 
+config BR2_TOOLCHAIN_EXTERNAL_GCC_11
+	bool "11.x"
+	select BR2_TOOLCHAIN_GCC_AT_LEAST_11
+
 config BR2_TOOLCHAIN_EXTERNAL_GCC_10
 	bool "10.x"
 	select BR2_TOOLCHAIN_GCC_AT_LEAST_10
Signature · 1 line
2.31.1
#7 lore raw

PATCH 6/6 package/gcc: switch to gcc 10.x as the default

In reply to Romain Naour

Even if gcc 9.x is still maintained for some time (gcc 9.5 will be the last), switch to gcc 10.x since it has been released since 2020-05-07 and gcc 11.x is available since 2021-04-27.

We have been having toolchains in the autobuilders with gcc 10.x for a while, so the vast majority of the problems should have already been solved.

---
 package/gcc/Config.in.host | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gcc/Config.in.host +1 -1
index 5d66834301..40559e3253 100644
@@ -4,7 +4,7 @@ choice
 	prompt "GCC compiler Version"
 	default BR2_GCC_VERSION_ARC if BR2_arc
 	default BR2_GCC_VERSION_CSKY if BR2_csky
-	default BR2_GCC_VERSION_9_X
+	default BR2_GCC_VERSION_10_X
 	help
 	  Select the version of gcc you wish to use.
 
Signature · 1 line
2.31.1
#8 lore raw

PATCH 6/6 package/gcc: switch to gcc 10.x as the default

Quoted 7 lines · Romain Naour

Even if gcc 9.x is still maintained for some time (gcc 9.5 will be the last), switch to gcc 10.x since it has been released since 2020-05-07 and gcc 11.x is available since 2021-04-27.

We have been having toolchains in the autobuilders with gcc 10.x for a while, so the vast majority of the problems should have already been solved.

In fact, another patch to solve a GCC 10 issue was submitted just last Monday
(but that was an NDEBUG issue really so OK).

I've added the date that we started building with GCC 10 (mid-January, based on
the update of the bootlin toolchains in support/config-fragments).

Series applied to master, thanks.

Regards,
Arnout

Quoted 20 lines
---
 package/gcc/Config.in.host | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gcc/Config.in.host +1 -1
index 5d66834301..40559e3253 100644
@@ -4,7 +4,7 @@ choice
 	prompt "GCC compiler Version"
 	default BR2_GCC_VERSION_ARC if BR2_arc
 	default BR2_GCC_VERSION_CSKY if BR2_csky
-	default BR2_GCC_VERSION_9_X
+	default BR2_GCC_VERSION_10_X
 	help
 	  Select the version of gcc you wish to use.
 
#9 lore raw

PATCH 6/6 package/gcc: switch to gcc 10.x as the default

Hi Arnout,

Le 20/06/2021 ? 19:07, Arnout Vandecappelle a ?crit?:

Quoted 7 lines · Romain Naour
Quoted 4 lines

Even if gcc 9.x is still maintained for some time (gcc 9.5 will be the last), switch to gcc 10.x since it has been released since 2020-05-07 and gcc 11.x is available since 2021-04-27.

Quoted 6 lines
Quoted 3 lines

We have been having toolchains in the autobuilders with gcc 10.x for a while, so the vast majority of the problems should have already been solved.

In fact, another patch to solve a GCC 10 issue was submitted just last Monday
(but that was an NDEBUG issue really so OK).

I had a look but I need to reproduce the issue.
It seems we are not impacted since we don't have the --enable-checking option in gcc.mk.
Maybe we could add --disable-werror like of other package (binutils, glibc).

Quoted 3 lines

I've added the date that we started building with GCC 10 (mid-January, based on
the update of the bootlin toolchains in support/config-fragments).

Ok I'll add this info next time.

Quoted 2 lines

Series applied to master, thanks.

Thanks!

Best regards,
Romain

Quoted 24 lines

Regards,
Arnout

Quoted 20 lines
---
 package/gcc/Config.in.host | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/gcc/Config.in.host +1 -1
index 5d66834301..40559e3253 100644
@@ -4,7 +4,7 @@ choice
 	prompt "GCC compiler Version"
 	default BR2_GCC_VERSION_ARC if BR2_arc
 	default BR2_GCC_VERSION_CSKY if BR2_csky
-	default BR2_GCC_VERSION_9_X
+	default BR2_GCC_VERSION_10_X
 	help
 	  Select the version of gcc you wish to use.