buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597
@ 2024-02-18 18:45 Giulio Benetti
  2024-02-18 18:45 ` [Buildroot] [PATCH 1/8] package/binutils: add local patches to fix Nios2 " Giulio Benetti
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

This patchset add backported patches for Buildroot Nios2 binutils bug 27597 and
drop packages dependency on it. Doing this the external toolchain will fail
building those packages, so I'm not that sure how to deal with this situation.
The same happened for OpenRisc and as far as I remember the first patch of the
series has been applied, then Bootlin toolchains have been patched and rebuilt/
redeployed, in the end the remaining patches have been applied. But here we also
have Sourcery CodeBench Nios-II 2018.05 toolchain that contain the bug, so I
don't know how to deal with this situation to avoid build failures.

Any ideas?

Thank you!

Best regards
Giulio

Giulio Benetti (8):
  package/binutils: add local patches to fix Nios2 bug 27597
  package/gdal: drop nios2 binutils bug 27597 dependency
  package/kf5/kf5-kcoreaddons: drop nios2 binutils bug 27597 dependency
  package/libcamera: drop nios2 binutils bug 27597 dependency
  package/libgeos: drop nios2 binutils bug 27597 dependency
  package/pistache: drop nios2 binutils bug 27597 dependency
  package/postgis: drop nios2 binutils bug 27597 dependency
  toolchain: remove binutils bug 27597

 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 package/gdal/Config.in                        |   4 +-
 package/kf5/kf5-kcoreaddons/Config.in         |   1 -
 package/libcamera/Config.in                   |   1 -
 package/libgeos/Config.in                     |   6 +-
 package/pistache/Config.in                    |   6 +-
 package/postgis/Config.in                     |   6 +-
 toolchain/Config.in                           |   6 -
 10 files changed, 382 insertions(+), 23 deletions(-)
 create mode 100644 package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 create mode 100644 package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 create mode 100644 package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch

-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 1/8] package/binutils: add local patches to fix Nios2 bug 27597
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
@ 2024-02-18 18:45 ` Giulio Benetti
  2024-02-18 18:45 ` [Buildroot] [PATCH 2/8] package/gdal: drop nios2 binutils bug 27597 dependency Giulio Benetti
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

These backported patches fix Nios2 linker bug 27597 that affects packages
gdal, kf5-kcoreaddons, libgeos, libcamera, pistache.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 3 files changed, 375 insertions(+)
 create mode 100644 package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 create mode 100644 package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 create mode 100644 package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch

diff --git a/package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch b/package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
new file mode 100644
index 0000000000..4753ae13c4
--- /dev/null
+++ b/package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
@@ -0,0 +1,125 @@
+From 900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Fri, 16 Feb 2024 22:33:29 +1030
+Subject: [PATCH] PR27597, nios: assertion fail in nios2_elf32_install_imm16
+
+The assertion in nios2_elf32_install_imm16 triggers when the PLT is
+twice the maximum allowable size for a branch from PLTn to reach
+.PLTresolve, and on no other call to nios2_elf32_install_imm16.  That
+makes the assertion completely useless.  We can handle a PIC PLT
+exceeding 0x8000 in size by bouncing branches that won't reach through
+previous branches.
+
+	PR 27597
+	* elf32-nios2.c (nios2_elf32_install_imm16): Delete BFD_ASSERT.
+	(nios2_build_one_stub): Don't bother masking value passed to
+	nios2_elf32_install_imm16.
+	(nios2_elf32_finish_dynamic_symbol): Likewise.  Handle overflow
+	of PLTn branch to .PLTresolve by bouncing through prior branches.
+
+Upstream: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-nios2.c | 40 ++++++++++++++++++++++++----------------
+ 1 file changed, 24 insertions(+), 16 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index bebf4239958..7f61e2f8507 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -1878,8 +1878,6 @@ nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
+ {
+   bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
+ 
+-  BFD_ASSERT (value <= 0xffff || ((bfd_signed_vma) value) >= -0xffff);
+-
+   bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
+ 	      sec->contents + offset);
+ }
+@@ -2518,7 +2516,7 @@ nios2_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg ATTRIBUTE_U
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset,
+ 				 hiadj (sym_value));
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset + 4,
+-				 (sym_value & 0xffff));
++				 sym_value);
+       stub_sec->size += 12;
+       break;
+     default:
+@@ -4986,16 +4984,28 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+       /* Emit the PLT entry.  */
+       if (bfd_link_pic (info))
+ 	{
++	  bfd_vma br_offset;
++
+ 	  nios2_elf32_install_data (splt, nios2_so_plt_entry, h->plt.offset,
+ 				    3);
+ 	  plt_index = (h->plt.offset - 24) / 12;
+ 	  got_offset = (plt_index + 3) * 4;
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset,
+-				     hiadj(plt_index * 4));
++				     hiadj (plt_index * 4));
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     (plt_index * 4) & 0xffff);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8,
+-				     0xfff4 - h->plt.offset);
++				     plt_index * 4);
++	  br_offset = -(h->plt.offset + 12);
++	  /* If this plt entry is too far away from the start of .plt
++	     for the "br" to reach .PLTresolve, bounce through one or
++	     more of the previous "br" instructions.  */
++	  if (br_offset < (bfd_vma) -32768)
++	    {
++	      br_offset += 32768 / 12 * 12 - 4;
++	      while (br_offset < (bfd_vma) -32768)
++		br_offset += 32768 / 12 * 12;
++	    }
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8, br_offset);
++
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+ 
+@@ -5014,9 +5024,8 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+ 	  nios2_elf32_install_data (splt, nios2_plt_entry, h->plt.offset, 3);
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj(got_address));
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     got_address & 0xffff);
++	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj (got_address));
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4, got_address);
+ 
+ 	  /* Fill in the entry in the global offset table.  */
+ 	  bfd_put_32 (output_bfd,
+@@ -5217,8 +5226,8 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 	      BFD_ASSERT ((got_pcrel & 0xf) == 0);
+ 	      nios2_elf32_install_data (splt, nios2_so_plt0_entry, 0, 6);
+ 	      nios2_elf32_install_imm16 (splt, 4, hiadj (got_pcrel));
+-	      nios2_elf32_install_imm16 (splt, 12, got_pcrel & 0xffff);
+-	      nios2_elf32_install_imm16 (splt, 16, (got_pcrel + 4) & 0xffff);
++	      nios2_elf32_install_imm16 (splt, 12, got_pcrel);
++	      nios2_elf32_install_imm16 (splt, 16, got_pcrel + 4);
+ 	    }
+ 	  else
+ 	    {
+@@ -5240,14 +5249,13 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 
+ 	      nios2_elf32_install_data (splt, nios2_plt0_entry, res_size, 7);
+ 	      nios2_elf32_install_imm16 (splt, res_size, hiadj (res_start));
+-	      nios2_elf32_install_imm16 (splt, res_size + 4,
+-					 res_start & 0xffff);
++	      nios2_elf32_install_imm16 (splt, res_size + 4, res_start);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 12,
+ 					 hiadj (got_address));
+ 	      nios2_elf32_install_imm16 (splt, res_size + 16,
+-					 (got_address + 4) & 0xffff);
++					 got_address + 4);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 20,
+-					 (got_address + 8) & 0xffff);
++					 got_address + 8);
+ 	    }
+ 	}
+     }
+-- 
+2.34.1
+
diff --git a/package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch b/package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
new file mode 100644
index 0000000000..4753ae13c4
--- /dev/null
+++ b/package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
@@ -0,0 +1,125 @@
+From 900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Fri, 16 Feb 2024 22:33:29 +1030
+Subject: [PATCH] PR27597, nios: assertion fail in nios2_elf32_install_imm16
+
+The assertion in nios2_elf32_install_imm16 triggers when the PLT is
+twice the maximum allowable size for a branch from PLTn to reach
+.PLTresolve, and on no other call to nios2_elf32_install_imm16.  That
+makes the assertion completely useless.  We can handle a PIC PLT
+exceeding 0x8000 in size by bouncing branches that won't reach through
+previous branches.
+
+	PR 27597
+	* elf32-nios2.c (nios2_elf32_install_imm16): Delete BFD_ASSERT.
+	(nios2_build_one_stub): Don't bother masking value passed to
+	nios2_elf32_install_imm16.
+	(nios2_elf32_finish_dynamic_symbol): Likewise.  Handle overflow
+	of PLTn branch to .PLTresolve by bouncing through prior branches.
+
+Upstream: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-nios2.c | 40 ++++++++++++++++++++++++----------------
+ 1 file changed, 24 insertions(+), 16 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index bebf4239958..7f61e2f8507 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -1878,8 +1878,6 @@ nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
+ {
+   bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
+ 
+-  BFD_ASSERT (value <= 0xffff || ((bfd_signed_vma) value) >= -0xffff);
+-
+   bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
+ 	      sec->contents + offset);
+ }
+@@ -2518,7 +2516,7 @@ nios2_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg ATTRIBUTE_U
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset,
+ 				 hiadj (sym_value));
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset + 4,
+-				 (sym_value & 0xffff));
++				 sym_value);
+       stub_sec->size += 12;
+       break;
+     default:
+@@ -4986,16 +4984,28 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+       /* Emit the PLT entry.  */
+       if (bfd_link_pic (info))
+ 	{
++	  bfd_vma br_offset;
++
+ 	  nios2_elf32_install_data (splt, nios2_so_plt_entry, h->plt.offset,
+ 				    3);
+ 	  plt_index = (h->plt.offset - 24) / 12;
+ 	  got_offset = (plt_index + 3) * 4;
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset,
+-				     hiadj(plt_index * 4));
++				     hiadj (plt_index * 4));
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     (plt_index * 4) & 0xffff);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8,
+-				     0xfff4 - h->plt.offset);
++				     plt_index * 4);
++	  br_offset = -(h->plt.offset + 12);
++	  /* If this plt entry is too far away from the start of .plt
++	     for the "br" to reach .PLTresolve, bounce through one or
++	     more of the previous "br" instructions.  */
++	  if (br_offset < (bfd_vma) -32768)
++	    {
++	      br_offset += 32768 / 12 * 12 - 4;
++	      while (br_offset < (bfd_vma) -32768)
++		br_offset += 32768 / 12 * 12;
++	    }
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8, br_offset);
++
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+ 
+@@ -5014,9 +5024,8 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+ 	  nios2_elf32_install_data (splt, nios2_plt_entry, h->plt.offset, 3);
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj(got_address));
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     got_address & 0xffff);
++	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj (got_address));
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4, got_address);
+ 
+ 	  /* Fill in the entry in the global offset table.  */
+ 	  bfd_put_32 (output_bfd,
+@@ -5217,8 +5226,8 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 	      BFD_ASSERT ((got_pcrel & 0xf) == 0);
+ 	      nios2_elf32_install_data (splt, nios2_so_plt0_entry, 0, 6);
+ 	      nios2_elf32_install_imm16 (splt, 4, hiadj (got_pcrel));
+-	      nios2_elf32_install_imm16 (splt, 12, got_pcrel & 0xffff);
+-	      nios2_elf32_install_imm16 (splt, 16, (got_pcrel + 4) & 0xffff);
++	      nios2_elf32_install_imm16 (splt, 12, got_pcrel);
++	      nios2_elf32_install_imm16 (splt, 16, got_pcrel + 4);
+ 	    }
+ 	  else
+ 	    {
+@@ -5240,14 +5249,13 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 
+ 	      nios2_elf32_install_data (splt, nios2_plt0_entry, res_size, 7);
+ 	      nios2_elf32_install_imm16 (splt, res_size, hiadj (res_start));
+-	      nios2_elf32_install_imm16 (splt, res_size + 4,
+-					 res_start & 0xffff);
++	      nios2_elf32_install_imm16 (splt, res_size + 4, res_start);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 12,
+ 					 hiadj (got_address));
+ 	      nios2_elf32_install_imm16 (splt, res_size + 16,
+-					 (got_address + 4) & 0xffff);
++					 got_address + 4);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 20,
+-					 (got_address + 8) & 0xffff);
++					 got_address + 8);
+ 	    }
+ 	}
+     }
+-- 
+2.34.1
+
diff --git a/package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch b/package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
new file mode 100644
index 0000000000..4753ae13c4
--- /dev/null
+++ b/package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
@@ -0,0 +1,125 @@
+From 900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Fri, 16 Feb 2024 22:33:29 +1030
+Subject: [PATCH] PR27597, nios: assertion fail in nios2_elf32_install_imm16
+
+The assertion in nios2_elf32_install_imm16 triggers when the PLT is
+twice the maximum allowable size for a branch from PLTn to reach
+.PLTresolve, and on no other call to nios2_elf32_install_imm16.  That
+makes the assertion completely useless.  We can handle a PIC PLT
+exceeding 0x8000 in size by bouncing branches that won't reach through
+previous branches.
+
+	PR 27597
+	* elf32-nios2.c (nios2_elf32_install_imm16): Delete BFD_ASSERT.
+	(nios2_build_one_stub): Don't bother masking value passed to
+	nios2_elf32_install_imm16.
+	(nios2_elf32_finish_dynamic_symbol): Likewise.  Handle overflow
+	of PLTn branch to .PLTresolve by bouncing through prior branches.
+
+Upstream: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-nios2.c | 40 ++++++++++++++++++++++++----------------
+ 1 file changed, 24 insertions(+), 16 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index bebf4239958..7f61e2f8507 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -1878,8 +1878,6 @@ nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
+ {
+   bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
+ 
+-  BFD_ASSERT (value <= 0xffff || ((bfd_signed_vma) value) >= -0xffff);
+-
+   bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
+ 	      sec->contents + offset);
+ }
+@@ -2518,7 +2516,7 @@ nios2_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg ATTRIBUTE_U
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset,
+ 				 hiadj (sym_value));
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset + 4,
+-				 (sym_value & 0xffff));
++				 sym_value);
+       stub_sec->size += 12;
+       break;
+     default:
+@@ -4986,16 +4984,28 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+       /* Emit the PLT entry.  */
+       if (bfd_link_pic (info))
+ 	{
++	  bfd_vma br_offset;
++
+ 	  nios2_elf32_install_data (splt, nios2_so_plt_entry, h->plt.offset,
+ 				    3);
+ 	  plt_index = (h->plt.offset - 24) / 12;
+ 	  got_offset = (plt_index + 3) * 4;
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset,
+-				     hiadj(plt_index * 4));
++				     hiadj (plt_index * 4));
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     (plt_index * 4) & 0xffff);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8,
+-				     0xfff4 - h->plt.offset);
++				     plt_index * 4);
++	  br_offset = -(h->plt.offset + 12);
++	  /* If this plt entry is too far away from the start of .plt
++	     for the "br" to reach .PLTresolve, bounce through one or
++	     more of the previous "br" instructions.  */
++	  if (br_offset < (bfd_vma) -32768)
++	    {
++	      br_offset += 32768 / 12 * 12 - 4;
++	      while (br_offset < (bfd_vma) -32768)
++		br_offset += 32768 / 12 * 12;
++	    }
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8, br_offset);
++
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+ 
+@@ -5014,9 +5024,8 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+ 	  nios2_elf32_install_data (splt, nios2_plt_entry, h->plt.offset, 3);
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj(got_address));
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     got_address & 0xffff);
++	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj (got_address));
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4, got_address);
+ 
+ 	  /* Fill in the entry in the global offset table.  */
+ 	  bfd_put_32 (output_bfd,
+@@ -5217,8 +5226,8 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 	      BFD_ASSERT ((got_pcrel & 0xf) == 0);
+ 	      nios2_elf32_install_data (splt, nios2_so_plt0_entry, 0, 6);
+ 	      nios2_elf32_install_imm16 (splt, 4, hiadj (got_pcrel));
+-	      nios2_elf32_install_imm16 (splt, 12, got_pcrel & 0xffff);
+-	      nios2_elf32_install_imm16 (splt, 16, (got_pcrel + 4) & 0xffff);
++	      nios2_elf32_install_imm16 (splt, 12, got_pcrel);
++	      nios2_elf32_install_imm16 (splt, 16, got_pcrel + 4);
+ 	    }
+ 	  else
+ 	    {
+@@ -5240,14 +5249,13 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 
+ 	      nios2_elf32_install_data (splt, nios2_plt0_entry, res_size, 7);
+ 	      nios2_elf32_install_imm16 (splt, res_size, hiadj (res_start));
+-	      nios2_elf32_install_imm16 (splt, res_size + 4,
+-					 res_start & 0xffff);
++	      nios2_elf32_install_imm16 (splt, res_size + 4, res_start);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 12,
+ 					 hiadj (got_address));
+ 	      nios2_elf32_install_imm16 (splt, res_size + 16,
+-					 (got_address + 4) & 0xffff);
++					 got_address + 4);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 20,
+-					 (got_address + 8) & 0xffff);
++					 got_address + 8);
+ 	    }
+ 	}
+     }
+-- 
+2.34.1
+
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 2/8] package/gdal: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
  2024-02-18 18:45 ` [Buildroot] [PATCH 1/8] package/binutils: add local patches to fix Nios2 " Giulio Benetti
@ 2024-02-18 18:45 ` Giulio Benetti
  2024-02-18 19:13   ` Yann E. MORIN
  2024-02-19  5:47   ` Maxim Kochetkov via buildroot
  2024-02-18 18:45 ` [Buildroot] [PATCH 3/8] package/kf5/kf5-kcoreaddons: " Giulio Benetti
                   ` (7 subsequent siblings)
  9 siblings, 2 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/gdal/Config.in | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/package/gdal/Config.in b/package/gdal/Config.in
index 24a1f06af2..839a1bd7ea 100644
--- a/package/gdal/Config.in
+++ b/package/gdal/Config.in
@@ -5,7 +5,6 @@ config BR2_PACKAGE_GDAL
 	# configure can't find proj, when linking statically
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11, proj
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 	depends on BR2_TOOLCHAIN_HAS_THREADS # proj
 	depends on BR2_USE_WCHAR # proj
 	select BR2_PACKAGE_GIFLIB
@@ -26,9 +25,8 @@ config BR2_PACKAGE_GDAL
 
 	  https://gdal.org/
 
-comment "gdal needs a toolchain w/ C++, dynamic library, gcc >= 4.7, not binutils bug 27597, threads, wchar"
+comment "gdal needs a toolchain w/ C++, dynamic library, gcc >= 4.7, threads, wchar"
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || \
-		BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597 || \
 		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 3/8] package/kf5/kf5-kcoreaddons: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
  2024-02-18 18:45 ` [Buildroot] [PATCH 1/8] package/binutils: add local patches to fix Nios2 " Giulio Benetti
  2024-02-18 18:45 ` [Buildroot] [PATCH 2/8] package/gdal: drop nios2 binutils bug 27597 dependency Giulio Benetti
@ 2024-02-18 18:45 ` Giulio Benetti
  2024-02-18 18:45 ` [Buildroot] [PATCH 4/8] package/libcamera: " Giulio Benetti
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/kf5/kf5-kcoreaddons/Config.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/kf5/kf5-kcoreaddons/Config.in b/package/kf5/kf5-kcoreaddons/Config.in
index 02bd38e395..88fda03ee0 100644
--- a/package/kf5/kf5-kcoreaddons/Config.in
+++ b/package/kf5/kf5-kcoreaddons/Config.in
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_KF5_KCOREADDONS
 	bool "kf5-kcoreaddons"
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 	select BR2_PACKAGE_KF5_EXTRA_CMAKE_MODULES
 	select BR2_PACKAGE_QT5TOOLS
 	select BR2_PACKAGE_QT5TOOLS_LINGUIST_TOOLS
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 4/8] package/libcamera: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
                   ` (2 preceding siblings ...)
  2024-02-18 18:45 ` [Buildroot] [PATCH 3/8] package/kf5/kf5-kcoreaddons: " Giulio Benetti
@ 2024-02-18 18:45 ` Giulio Benetti
  2024-02-18 18:45 ` [Buildroot] [PATCH 5/8] package/libgeos: " Giulio Benetti
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/libcamera/Config.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/libcamera/Config.in b/package/libcamera/Config.in
index ccb5281b4b..e84b8d342e 100644
--- a/package/libcamera/Config.in
+++ b/package/libcamera/Config.in
@@ -3,7 +3,6 @@ config BR2_PACKAGE_LIBCAMERA_ARCH_SUPPORTS
 	default y
 	# Invalid packing size of ControlValue struct on m68k
 	depends on !BR2_m68k
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 
 menuconfig BR2_PACKAGE_LIBCAMERA
 	bool "libcamera"
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 5/8] package/libgeos: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
                   ` (3 preceding siblings ...)
  2024-02-18 18:45 ` [Buildroot] [PATCH 4/8] package/libcamera: " Giulio Benetti
@ 2024-02-18 18:45 ` Giulio Benetti
  2024-02-19  5:48   ` Maxim Kochetkov via buildroot
  2024-02-18 18:45 ` [Buildroot] [PATCH 6/8] package/pistache: " Giulio Benetti
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/libgeos/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/libgeos/Config.in b/package/libgeos/Config.in
index 2a27c6f2a4..76cbb9bdcd 100644
--- a/package/libgeos/Config.in
+++ b/package/libgeos/Config.in
@@ -4,7 +4,6 @@ config BR2_PACKAGE_LIBGEOS
 	depends on BR2_USE_WCHAR
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 	help
 	  GEOS (Geometry Engine - Open Source) is a C++ port of the
 	  JTS Topology Suite (JTS). It aims to contain the complete
@@ -14,8 +13,7 @@ config BR2_PACKAGE_LIBGEOS
 
 	  https://trac.osgeo.org/geos
 
-comment "libgeos needs a toolchain w/ C++, wchar, gcc >= 4.9, threads not binutils bug 27597"
+comment "libgeos needs a toolchain w/ C++, wchar, gcc >= 4.9, threads"
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
 		   !BR2_TOOLCHAIN_HAS_THREADS || \
-		   !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
-		   BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
+		   !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 6/8] package/pistache: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
                   ` (4 preceding siblings ...)
  2024-02-18 18:45 ` [Buildroot] [PATCH 5/8] package/libgeos: " Giulio Benetti
@ 2024-02-18 18:45 ` Giulio Benetti
  2024-02-18 18:45 ` [Buildroot] [PATCH 7/8] package/postgis: " Giulio Benetti
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/pistache/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/pistache/Config.in b/package/pistache/Config.in
index 3acf1f53f0..ca2d2833cd 100644
--- a/package/pistache/Config.in
+++ b/package/pistache/Config.in
@@ -4,7 +4,6 @@ config BR2_PACKAGE_PISTACHE
 	depends on BR2_USE_WCHAR
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 	select BR2_PACKAGE_RAPIDJSON
 	help
 	  Pistache is a modern and elegant HTTP and REST framework
@@ -13,9 +12,8 @@ config BR2_PACKAGE_PISTACHE
 
 	  https://github.com/oktal/pistache
 
-comment "pistache needs a toolchain w/ C++, gcc >= 7, threads, wchar, not binutils bug 27597"
+comment "pistache needs a toolchain w/ C++, gcc >= 7, threads, wchar"
 	depends on !BR2_INSTALL_LIBSTDCPP || \
 		   !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \
 		   !BR2_TOOLCHAIN_HAS_THREADS || \
-		   !BR2_USE_WCHAR || \
-		   BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
+		   !BR2_USE_WCHAR
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 7/8] package/postgis: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
                   ` (5 preceding siblings ...)
  2024-02-18 18:45 ` [Buildroot] [PATCH 6/8] package/pistache: " Giulio Benetti
@ 2024-02-18 18:45 ` Giulio Benetti
  2024-02-19  5:48   ` Maxim Kochetkov via buildroot
  2024-02-18 18:45 ` [Buildroot] [PATCH 8/8] toolchain: remove binutils bug 27597 Giulio Benetti
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/postgis/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/postgis/Config.in b/package/postgis/Config.in
index 7d42390677..78569d63be 100644
--- a/package/postgis/Config.in
+++ b/package/postgis/Config.in
@@ -5,7 +5,6 @@ config BR2_PACKAGE_POSTGIS
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # libgeos
 	depends on BR2_TOOLCHAIN_HAS_THREADS # libgeos, proj
 	depends on BR2_USE_WCHAR # libgeos, proj
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597 # libgeos
 	select BR2_PACKAGE_LIBGEOS
 	select BR2_PACKAGE_PROJ
 	select BR2_PACKAGE_LIBXML2
@@ -18,7 +17,6 @@ config BR2_PACKAGE_POSTGIS
 
 	  https://postgis.net/
 
-comment "postgis needs a toolchain w/ C++, threads, wchar, gcc >= 4.9, not binutils bug 27597"
+comment "postgis needs a toolchain w/ C++, threads, wchar, gcc >= 4.9"
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
-		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \
-		BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
+		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH 8/8] toolchain: remove binutils bug 27597
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
                   ` (6 preceding siblings ...)
  2024-02-18 18:45 ` [Buildroot] [PATCH 7/8] package/postgis: " Giulio Benetti
@ 2024-02-18 18:45 ` Giulio Benetti
  2024-02-18 19:44   ` Yann E. MORIN
  2024-02-18 19:26 ` [Buildroot] [PATCH 0/8] Patch and remove Nios2 " Yann E. MORIN
  2024-02-18 22:05 ` Thomas Petazzoni via buildroot
  9 siblings, 1 reply; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 18:45 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Thomas Petazzoni,
	Giulio Benetti, Romain Naour, Thomas De Schampheleire

Binutils bug 27597 is not present anymore in Buildroot so let's remove it.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 toolchain/Config.in | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 407a03c42e..9e6cff1950 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -71,12 +71,6 @@ source "package/gdb/Config.in.host"
 
 comment "Toolchain Generic Options"
 
-# https://sourceware.org/bugzilla/show_bug.cgi?id=27597
-# Affect toolchains built with binutils 2.36.1, still not fixed.
-config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
-	bool
-	default y if BR2_nios2
-
 # https://sourceware.org/bugzilla/show_bug.cgi?id=30730
 # Affect toolchains built with binutils 2.40, still not fixed.
 config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_30730
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 2/8] package/gdal: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 ` [Buildroot] [PATCH 2/8] package/gdal: drop nios2 binutils bug 27597 dependency Giulio Benetti
@ 2024-02-18 19:13   ` Yann E. MORIN
  2024-02-19  5:47   ` Maxim Kochetkov via buildroot
  1 sibling, 0 replies; 28+ messages in thread
From: Yann E. MORIN @ 2024-02-18 19:13 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: Marcus Folkesson, Thomas Petazzoni, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Pierre Ducroquet,
	buildroot, Romain Naour, Thomas De Schampheleire

Giulio, All,

On 2024-02-18 19:45 +0100, Giulio Benetti spake thusly:
> Now that binutils patch has been backported to every Buildroot binutils
> version we can drop nios2 binutils bug 27597 dependency.

What about external pre-built toolchains?

Comment valid for all the patches in this series...

Regards,
Yann E. MORIN.

> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  package/gdal/Config.in | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/package/gdal/Config.in b/package/gdal/Config.in
> index 24a1f06af2..839a1bd7ea 100644
> --- a/package/gdal/Config.in
> +++ b/package/gdal/Config.in
> @@ -5,7 +5,6 @@ config BR2_PACKAGE_GDAL
>  	# configure can't find proj, when linking statically
>  	depends on !BR2_STATIC_LIBS
>  	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11, proj
> -	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
>  	depends on BR2_TOOLCHAIN_HAS_THREADS # proj
>  	depends on BR2_USE_WCHAR # proj
>  	select BR2_PACKAGE_GIFLIB
> @@ -26,9 +25,8 @@ config BR2_PACKAGE_GDAL
>  
>  	  https://gdal.org/
>  
> -comment "gdal needs a toolchain w/ C++, dynamic library, gcc >= 4.7, not binutils bug 27597, threads, wchar"
> +comment "gdal needs a toolchain w/ C++, dynamic library, gcc >= 4.7, threads, wchar"
>  	depends on BR2_TOOLCHAIN_HAS_SYNC_4
>  	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
>  		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || \
> -		BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597 || \
>  		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
                   ` (7 preceding siblings ...)
  2024-02-18 18:45 ` [Buildroot] [PATCH 8/8] toolchain: remove binutils bug 27597 Giulio Benetti
@ 2024-02-18 19:26 ` Yann E. MORIN
  2024-02-18 22:05 ` Thomas Petazzoni via buildroot
  9 siblings, 0 replies; 28+ messages in thread
From: Yann E. MORIN @ 2024-02-18 19:26 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: Marcus Folkesson, Thomas Petazzoni, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Pierre Ducroquet,
	buildroot, Romain Naour, Thomas De Schampheleire

Giulio, All,

On 2024-02-18 19:45 +0100, Giulio Benetti spake thusly:
> This patchset add backported patches for Buildroot Nios2 binutils bug 27597 and
> drop packages dependency on it. Doing this the external toolchain will fail
> building those packages, so I'm not that sure how to deal with this situation.
> The same happened for OpenRisc and as far as I remember the first patch of the
> series has been applied, then Bootlin toolchains have been patched and rebuilt/
> redeployed, in the end the remaining patches have been applied. But here we also
> have Sourcery CodeBench Nios-II 2018.05 toolchain that contain the bug, so I
> don't know how to deal with this situation to avoid build failures.

My suggestion:
  - keep BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
  - make the sourcery toolchain select it.

For "soon" after BR 2024.02 release::
  - drop the sourcery toolchain: it is going to be 6 years old when
    BR 2024.05, so it's going to be time to drop it.

Regards,
Yann E. MORIN.

> Any ideas?
> 
> Thank you!
> 
> Best regards
> Giulio
> 
> Giulio Benetti (8):
>   package/binutils: add local patches to fix Nios2 bug 27597
>   package/gdal: drop nios2 binutils bug 27597 dependency
>   package/kf5/kf5-kcoreaddons: drop nios2 binutils bug 27597 dependency
>   package/libcamera: drop nios2 binutils bug 27597 dependency
>   package/libgeos: drop nios2 binutils bug 27597 dependency
>   package/pistache: drop nios2 binutils bug 27597 dependency
>   package/postgis: drop nios2 binutils bug 27597 dependency
>   toolchain: remove binutils bug 27597
> 
>  ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
>  ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
>  ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
>  package/gdal/Config.in                        |   4 +-
>  package/kf5/kf5-kcoreaddons/Config.in         |   1 -
>  package/libcamera/Config.in                   |   1 -
>  package/libgeos/Config.in                     |   6 +-
>  package/pistache/Config.in                    |   6 +-
>  package/postgis/Config.in                     |   6 +-
>  toolchain/Config.in                           |   6 -
>  10 files changed, 382 insertions(+), 23 deletions(-)
>  create mode 100644 package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
>  create mode 100644 package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
>  create mode 100644 package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
> 
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 8/8] toolchain: remove binutils bug 27597
  2024-02-18 18:45 ` [Buildroot] [PATCH 8/8] toolchain: remove binutils bug 27597 Giulio Benetti
@ 2024-02-18 19:44   ` Yann E. MORIN
  0 siblings, 0 replies; 28+ messages in thread
From: Yann E. MORIN @ 2024-02-18 19:44 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: Marcus Folkesson, Thomas Petazzoni, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Pierre Ducroquet,
	buildroot, Romain Naour, Thomas De Schampheleire

Giulio, all,

On 2024-02-18 19:45 +0100, Giulio Benetti spake thusly:
> Binutils bug 27597 is not present anymore in Buildroot so let's remove it.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  toolchain/Config.in | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/toolchain/Config.in b/toolchain/Config.in
> index 407a03c42e..9e6cff1950 100644
> --- a/toolchain/Config.in
> +++ b/toolchain/Config.in
> @@ -71,12 +71,6 @@ source "package/gdb/Config.in.host"
>  
>  comment "Toolchain Generic Options"
>  
> -# https://sourceware.org/bugzilla/show_bug.cgi?id=27597
> -# Affect toolchains built with binutils 2.36.1, still not fixed.
> -config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
> -	bool
> -	default y if BR2_nios2

As I suggested in the cover letter, and that I'll duplicate here so it
is recorded with Patchwork, don't remove the symbol. Instead, just drop
the default, and have the sourceery niosII toolchain select it.

Regards,
Yann E. MORIN.

>  # https://sourceware.org/bugzilla/show_bug.cgi?id=30730
>  # Affect toolchains built with binutils 2.40, still not fixed.
>  config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_30730
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597
  2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
                   ` (8 preceding siblings ...)
  2024-02-18 19:26 ` [Buildroot] [PATCH 0/8] Patch and remove Nios2 " Yann E. MORIN
@ 2024-02-18 22:05 ` Thomas Petazzoni via buildroot
  2024-02-18 22:28   ` Giulio Benetti
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
  9 siblings, 2 replies; 28+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-02-18 22:05 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: Marcus Folkesson, Kieran Bingham, Dominik Michael Rauh,
	Maxim Kochetkov, Pierre Ducroquet, buildroot, Romain Naour,
	Thomas De Schampheleire

Hello,

On Sun, 18 Feb 2024 19:45:28 +0100
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> This patchset add backported patches for Buildroot Nios2 binutils bug 27597 and
> drop packages dependency on it. Doing this the external toolchain will fail
> building those packages, so I'm not that sure how to deal with this situation.
> The same happened for OpenRisc and as far as I remember the first patch of the
> series has been applied, then Bootlin toolchains have been patched and rebuilt/
> redeployed, in the end the remaining patches have been applied. But here we also
> have Sourcery CodeBench Nios-II 2018.05 toolchain that contain the bug, so I
> don't know how to deal with this situation to avoid build failures.

First of all, thanks for following up on this, I'm really happy to see
that we are not always *adding* more GCC/binutils bug options, but
sometimes *removing* some of them.

Regarding the CodeBench NIOSII toolchain from 2018.05, I think we could
simply delete it. It makes sense to support old toolchains to some
extent, but NIOSII is a very confidential architecture, and almost 6
years old toolchain is really ancient. So I would be entirely fine with
dropping this toolchain.

Best regards,

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597
  2024-02-18 22:05 ` Thomas Petazzoni via buildroot
@ 2024-02-18 22:28   ` Giulio Benetti
  2024-02-19  1:20     ` Vincent Fazio
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
  1 sibling, 1 reply; 28+ messages in thread
From: Giulio Benetti @ 2024-02-18 22:28 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Marcus Folkesson, Kieran Bingham, Dominik Michael Rauh,
	Maxim Kochetkov, Vincent Fazio, Pierre Ducroquet, buildroot,
	Romain Naour, Yann MORIN, Thomas De Schampheleire

Hi Thomas, Yann, Vincent, All,

> Il giorno 18 feb 2024, alle ore 23:05, Thomas Petazzoni <thomas.petazzoni@bootlin.com> ha scritto:
> 
> Hello,
> 
>> On Sun, 18 Feb 2024 19:45:28 +0100
>> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
>> 
>> This patchset add backported patches for Buildroot Nios2 binutils bug 27597 and
>> drop packages dependency on it. Doing this the external toolchain will fail
>> building those packages, so I'm not that sure how to deal with this situation.
>> The same happened for OpenRisc and as far as I remember the first patch of the
>> series has been applied, then Bootlin toolchains have been patched and rebuilt/
>> redeployed, in the end the remaining patches have been applied. But here we also
>> have Sourcery CodeBench Nios-II 2018.05 toolchain that contain the bug, so I
>> don't know how to deal with this situation to avoid build failures.
> 
> First of all, thanks for following up on this, I'm really happy to see
> that we are not always *adding* more GCC/binutils bug options, but
> sometimes *removing* some of them.

It would be great if some Microblaze or Sh4 bug could be patched too.
There’s a patch proposed by Vincent for a Microblaze gcc ICE.
Vincent, it would be great if you provide a patchset similar to this for gcc, or I can deal with it.

> 
> Regarding the CodeBench NIOSII toolchain from 2018.05, I think we could
> simply delete it. It makes sense to support old toolchains to some
> extent, but NIOSII is a very confidential architecture, and almost 6
> years old toolchain is really ancient. So I would be entirely fine with
> dropping this toolchain.

It sounds good to me and it’s similat suggestion of Yann.

One thing is left out to deal with, Bootlin toolchains that need to be patched/rebuilt/redeployed.

So I can give a respin to this series adding another patch dropping Sourcery external toolchain and you can apply it only after updating Bootlin Nios2 toolchain(this should be sufficient since the bug shows up only on Nios2).
That way Buildroot will be bug 27597 free.

Thanks for commenting!

Best regards
Giulio

> 
> Best regards,
> 
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597
  2024-02-18 22:28   ` Giulio Benetti
@ 2024-02-19  1:20     ` Vincent Fazio
  0 siblings, 0 replies; 28+ messages in thread
From: Vincent Fazio @ 2024-02-19  1:20 UTC (permalink / raw)
  To: Giulio Benetti
  Cc: Marcus Folkesson, Thomas Petazzoni, Kieran Bingham,
	Dominik Michael Rauh, Maxim Kochetkov, Pierre Ducroquet,
	buildroot, Romain Naour, Yann MORIN, Thomas De Schampheleire


[-- Attachment #1.1: Type: text/plain, Size: 3758 bytes --]

All,

On Sun, Feb 18, 2024 at 4:28 PM Giulio Benetti <
giulio.benetti@benettiengineering.com> wrote:

> Hi Thomas, Yann, Vincent, All,
>
> > Il giorno 18 feb 2024, alle ore 23:05, Thomas Petazzoni <
> thomas.petazzoni@bootlin.com> ha scritto:
> >
> > Hello,
> >
> >> On Sun, 18 Feb 2024 19:45:28 +0100
> >> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> >>
> >> This patchset add backported patches for Buildroot Nios2 binutils bug
> 27597 and
> >> drop packages dependency on it. Doing this the external toolchain will
> fail
> >> building those packages, so I'm not that sure how to deal with this
> situation.
> >> The same happened for OpenRisc and as far as I remember the first patch
> of the
> >> series has been applied, then Bootlin toolchains have been patched and
> rebuilt/
> >> redeployed, in the end the remaining patches have been applied. But
> here we also
> >> have Sourcery CodeBench Nios-II 2018.05 toolchain that contain the bug,
> so I
> >> don't know how to deal with this situation to avoid build failures.
> >
> > First of all, thanks for following up on this, I'm really happy to see
> > that we are not always *adding* more GCC/binutils bug options, but
> > sometimes *removing* some of them.
>
> It would be great if some Microblaze or Sh4 bug could be patched too.
> There’s a patch proposed by Vincent for a Microblaze gcc ICE.
> Vincent, it would be great if you provide a patchset similar to this for
> gcc, or I can deal with it.
>
>
I can certainly post the patch for BR. I've been a bit busy recently so
haven't done so and I'm a bit concerned with push back when trying to
upstream it, so don't know if it's worth submitting it without an upstream
submission.


> >
> > Regarding the CodeBench NIOSII toolchain from 2018.05, I think we could
> > simply delete it. It makes sense to support old toolchains to some
> > extent, but NIOSII is a very confidential architecture, and almost 6
> > years old toolchain is really ancient. So I would be entirely fine with
> > dropping this toolchain.
>
> It sounds good to me and it’s similat suggestion of Yann.
>
>
Any patch for the MicroBlaze stuff (and other fixes) will have to slowly
bleed into BR. As may have already been brought up, there are external
toolchains that we do _not_ control which make it difficult to drop these
types of flags.

I don't want to get too far off topic, but some of the things I brought up
in https://bugs.buildroot.org/show_bug.cgi?id=15943 seem at least
quasi-related.

Basically, it may behoove us to be very specific about what toolchains
_must_ have in order to be supported by a specific version of BR, such as:

* Minimum version of kernel headers
* Minimum libc + other tool versions
* Prequisite patches

This would largely push consumers to vetted external toolchains such as the
pre-created Bootlin toolchains that meet these requirements or to use BR
generated toolchains. Otherwise, we'll be "supporting" a hodge-podge of
toolchains with various mixtures of software indefinitely.

One thing is left out to deal with, Bootlin toolchains that need to be
> patched/rebuilt/redeployed.
>
> So I can give a respin to this series adding another patch dropping
> Sourcery external toolchain and you can apply it only after updating
> Bootlin Nios2 toolchain(this should be sufficient since the bug shows up
> only on Nios2).
> That way Buildroot will be bug 27597 free.
>
> Thanks for commenting!
>
> Best regards
> Giulio
>
> >
> > Best regards,
> >
> > Thomas
> > --
> > Thomas Petazzoni, co-owner and CEO, Bootlin
> > Embedded Linux and Kernel engineering and training
> > https://bootlin.com
>
>
-Vincent

[-- Attachment #1.2: Type: text/html, Size: 5073 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 2/8] package/gdal: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 ` [Buildroot] [PATCH 2/8] package/gdal: drop nios2 binutils bug 27597 dependency Giulio Benetti
  2024-02-18 19:13   ` Yann E. MORIN
@ 2024-02-19  5:47   ` Maxim Kochetkov via buildroot
  1 sibling, 0 replies; 28+ messages in thread
From: Maxim Kochetkov via buildroot @ 2024-02-19  5:47 UTC (permalink / raw)
  To: Giulio Benetti, buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Thomas Petazzoni, Romain Naour,
	Thomas De Schampheleire



On 18.02.2024 21:45, Giulio Benetti wrote:
> Now that binutils patch has been backported to every Buildroot binutils
> version we can drop nios2 binutils bug 27597 dependency.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---

Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 5/8] package/libgeos: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 ` [Buildroot] [PATCH 5/8] package/libgeos: " Giulio Benetti
@ 2024-02-19  5:48   ` Maxim Kochetkov via buildroot
  0 siblings, 0 replies; 28+ messages in thread
From: Maxim Kochetkov via buildroot @ 2024-02-19  5:48 UTC (permalink / raw)
  To: Giulio Benetti, buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Thomas Petazzoni, Romain Naour,
	Thomas De Schampheleire



On 18.02.2024 21:45, Giulio Benetti wrote:
> Now that binutils patch has been backported to every Buildroot binutils
> version we can drop nios2 binutils bug 27597 dependency.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [Buildroot] [PATCH 7/8] package/postgis: drop nios2 binutils bug 27597 dependency
  2024-02-18 18:45 ` [Buildroot] [PATCH 7/8] package/postgis: " Giulio Benetti
@ 2024-02-19  5:48   ` Maxim Kochetkov via buildroot
  0 siblings, 0 replies; 28+ messages in thread
From: Maxim Kochetkov via buildroot @ 2024-02-19  5:48 UTC (permalink / raw)
  To: Giulio Benetti, buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Dominik Michael Rauh, Thomas Petazzoni, Romain Naour,
	Thomas De Schampheleire



On 18.02.2024 21:45, Giulio Benetti wrote:
> Now that binutils patch has been backported to every Buildroot binutils
> version we can drop nios2 binutils bug 27597 dependency.
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 0/9] Patch and remove Nios2 binutils bug 27597
  2024-02-18 22:05 ` Thomas Petazzoni via buildroot
  2024-02-18 22:28   ` Giulio Benetti
@ 2024-02-21 21:39   ` Giulio Benetti
  2024-02-21 21:39     ` [Buildroot] [PATCH v2 1/9] toolchain/toolchain-external: drop external codesourcery niosII toolchain Giulio Benetti
                       ` (8 more replies)
  1 sibling, 9 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:39 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

This patchset:
* add backported patches for Buildroot Nios2 binutils bug 27597
* remove Codesourcery Nios2 external toolchain that is affected from bug above
  (I've tried to update to latest 2023.09-5 just for testing and yes, it's still
   affected by that bug, maybe once they will release toolchain based on latest
   binutils 2.42 that has patch applied to fix bug 27597 we can add it back)

* HERE we need Bootlin Nios2 Toolchain to be patched, rebuilt and updated.
  I've opened a PR with binutils patches for bug 27597:
  https://github.com/bootlin/buildroot-toolchains/pull/2

* drop all bug 27597 bug depencies
* drop the bug 27597 itself

Best regards
Giulio

Giulio Benetti (9):
  toolchain/toolchain-external: drop external codesourcery niosII
    toolchain
  package/binutils: add local patches to fix Nios2 bug 27597
  package/gdal: drop nios2 binutils bug 27597 dependency
  package/kf5/kf5-kcoreaddons: drop nios2 binutils bug 27597 dependency
  package/libcamera: drop nios2 binutils bug 27597 dependency
  package/libgeos: drop nios2 binutils bug 27597 dependency
  package/pistache: drop nios2 binutils bug 27597 dependency
  package/postgis: drop nios2 binutils bug 27597 dependency
  toolchain: remove binutils bug 27597

 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 package/gdal/Config.in                        |   4 +-
 package/kf5/kf5-kcoreaddons/Config.in         |   1 -
 package/libcamera/Config.in                   |   1 -
 package/libgeos/Config.in                     |   6 +-
 package/pistache/Config.in                    |   6 +-
 package/postgis/Config.in                     |   6 +-
 toolchain/Config.in                           |   6 -
 toolchain/toolchain-external/Config.in        |   6 -
 .../pkg-toolchain-external.mk                 |   2 +-
 .../Config.in                                 |  16 ---
 .../Config.in.options                         |   9 --
 ...oolchain-external-codesourcery-niosII.hash |   6 -
 .../toolchain-external-codesourcery-niosII.mk |  13 --
 16 files changed, 383 insertions(+), 74 deletions(-)
 create mode 100644 package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 create mode 100644 package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 create mode 100644 package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 delete mode 100644 toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in
 delete mode 100644 toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in.options
 delete mode 100644 toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.hash
 delete mode 100644 toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.mk

-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 1/9] toolchain/toolchain-external: drop external codesourcery niosII toolchain
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
@ 2024-02-21 21:39     ` Giulio Benetti
  2024-02-21 21:39     ` [Buildroot] [PATCH v2 2/9] package/binutils: add local patches to fix Nios2 bug 27597 Giulio Benetti
                       ` (7 subsequent siblings)
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:39 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

This toolchain is pretty old and unlikely used. It's also affected by
binutils bug 27597, so let's remove it.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 toolchain/toolchain-external/Config.in           |  6 ------
 .../toolchain-external/pkg-toolchain-external.mk |  2 +-
 .../Config.in                                    | 16 ----------------
 .../Config.in.options                            |  9 ---------
 .../toolchain-external-codesourcery-niosII.hash  |  6 ------
 .../toolchain-external-codesourcery-niosII.mk    | 13 -------------
 6 files changed, 1 insertion(+), 51 deletions(-)
 delete mode 100644 toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in
 delete mode 100644 toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in.options
 delete mode 100644 toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.hash
 delete mode 100644 toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.mk

diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index c1c159cb8e..cb678b7886 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -33,9 +33,6 @@ source "toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config
 source "toolchain/toolchain-external/toolchain-external-codescape-img-mips/Config.in"
 source "toolchain/toolchain-external/toolchain-external-codescape-mti-mips/Config.in"
 
-# NIOSII
-source "toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in"
-
 # Bootlin toolchains, available for virtually all architectures
 source "toolchain/toolchain-external/toolchain-external-bootlin/Config.in"
 
@@ -137,9 +134,6 @@ source "toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config
 source "toolchain/toolchain-external/toolchain-external-codescape-img-mips/Config.in.options"
 source "toolchain/toolchain-external/toolchain-external-codescape-mti-mips/Config.in.options"
 
-# NIOSII
-source "toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in.options"
-
 # Bootlin toolchains
 source "toolchain/toolchain-external/toolchain-external-bootlin/Config.in.options"
 
diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index ddf1d70ab4..aa5365b5bd 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -13,7 +13,7 @@
 #  * Toolchains provided by Linaro for the ARM and AArch64
 #    architectures
 #  * Sourcery CodeBench toolchains (from Mentor Graphics) for the ARM,
-#    MIPS, PowerPC, x86_64 and NIOS 2 architectures. For the MIPS
+#    MIPS, PowerPC, and x86_64 architectures. For the MIPS
 #    toolchain, the -muclibc variant isn't supported yet, only the
 #    default glibc-based variant is.
 #  * Synopsys DesignWare toolchains for ARC cores
diff --git a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in b/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in
deleted file mode 100644
index cf3ce69a68..0000000000
--- a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in
+++ /dev/null
@@ -1,16 +0,0 @@
-config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII
-	bool "Sourcery CodeBench Nios-II 2018.05"
-	depends on BR2_nios2
-	depends on !BR2_ARCH_NEEDS_GCC_AT_LEAST_8
-	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
-	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
-	select BR2_TOOLCHAIN_HAS_SSP
-	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
-	select BR2_INSTALL_LIBSTDCPP
-	select BR2_HOSTARCH_NEEDS_IA32_LIBS
-	select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_15
-	select BR2_TOOLCHAIN_GCC_AT_LEAST_7
-	help
-	  Sourcery CodeBench toolchain for the Nios-II architecture,
-	  from Mentor Graphics. It uses gcc 7.3, binutils 2.28,
-	  glibc 2.27, gdb 8.0.1 and kernel headers 4.15.5.
diff --git a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in.options b/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in.options
deleted file mode 100644
index 07cc5ede94..0000000000
--- a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/Config.in.options
+++ /dev/null
@@ -1,9 +0,0 @@
-if BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII
-
-config BR2_TOOLCHAIN_EXTERNAL_PREFIX
-	default "nios2-linux-gnu"
-
-config BR2_PACKAGE_PROVIDES_TOOLCHAIN_EXTERNAL
-	default "toolchain-external-codesourcery-niosII"
-
-endif
diff --git a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.hash b/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.hash
deleted file mode 100644
index 47893ab7e2..0000000000
--- a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.hash
+++ /dev/null
@@ -1,6 +0,0 @@
-# From https://sourcery.mentor.com/GNUToolchain/release3374
-md5  4f536b3b9b4e00f483e82e304c0a27ae  sourceryg++-2018.05-5-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2
-md5  be42ab83da2e8db7b73dc890c2549570  sourceryg++-2018.05-5-nios2-linux-gnu.src.tar.bz2
-# Locally calculated
-sha256  c19afb432b5b23f8d5d639831d3a423a3ea3c9cc62e0015020d20ea2eb36dd1b  sourceryg++-2018.05-5-nios2-linux-gnu-i686-pc-linux-gnu.tar.bz2
-sha256  d73a6364106dd62352711f932d3be8e97fdaaa548995678b5d38d9f21e22437a  sourceryg++-2018.05-5-nios2-linux-gnu.src.tar.bz2
diff --git a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.mk b/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.mk
deleted file mode 100644
index cb0fe760ff..0000000000
--- a/toolchain/toolchain-external/toolchain-external-codesourcery-niosII/toolchain-external-codesourcery-niosII.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-#
-# toolchain-external-codesourcery-niosII
-#
-################################################################################
-
-TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_VERSION = 2018.05-5
-
-TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_SITE = https://sourcery.mentor.com/public/gnu_toolchain/$(TOOLCHAIN_EXTERNAL_PREFIX)
-TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_SOURCE = sourceryg++-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX)-i686-pc-linux-gnu.tar.bz2
-TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_ACTUAL_SOURCE_TARBALL = sourceryg++-$(TOOLCHAIN_EXTERNAL_CODESOURCERY_NIOSII_VERSION)-$(TOOLCHAIN_EXTERNAL_PREFIX).src.tar.bz2
-
-$(eval $(toolchain-external-package))
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 2/9] package/binutils: add local patches to fix Nios2 bug 27597
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
  2024-02-21 21:39     ` [Buildroot] [PATCH v2 1/9] toolchain/toolchain-external: drop external codesourcery niosII toolchain Giulio Benetti
@ 2024-02-21 21:39     ` Giulio Benetti
  2024-02-21 21:39     ` [Buildroot] [PATCH v2 3/9] package/gdal: drop nios2 binutils bug 27597 dependency Giulio Benetti
                       ` (6 subsequent siblings)
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:39 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

These backported patches fix Nios2 linker bug 27597 that affects packages
gdal, kf5-kcoreaddons, libgeos, libcamera, pistache.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 ...ertion-fail-in-nios2_elf32_install_i.patch | 125 ++++++++++++++++++
 3 files changed, 375 insertions(+)
 create mode 100644 package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 create mode 100644 package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
 create mode 100644 package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch

diff --git a/package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch b/package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
new file mode 100644
index 0000000000..4753ae13c4
--- /dev/null
+++ b/package/binutils/2.39/0004-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
@@ -0,0 +1,125 @@
+From 900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Fri, 16 Feb 2024 22:33:29 +1030
+Subject: [PATCH] PR27597, nios: assertion fail in nios2_elf32_install_imm16
+
+The assertion in nios2_elf32_install_imm16 triggers when the PLT is
+twice the maximum allowable size for a branch from PLTn to reach
+.PLTresolve, and on no other call to nios2_elf32_install_imm16.  That
+makes the assertion completely useless.  We can handle a PIC PLT
+exceeding 0x8000 in size by bouncing branches that won't reach through
+previous branches.
+
+	PR 27597
+	* elf32-nios2.c (nios2_elf32_install_imm16): Delete BFD_ASSERT.
+	(nios2_build_one_stub): Don't bother masking value passed to
+	nios2_elf32_install_imm16.
+	(nios2_elf32_finish_dynamic_symbol): Likewise.  Handle overflow
+	of PLTn branch to .PLTresolve by bouncing through prior branches.
+
+Upstream: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-nios2.c | 40 ++++++++++++++++++++++++----------------
+ 1 file changed, 24 insertions(+), 16 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index bebf4239958..7f61e2f8507 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -1878,8 +1878,6 @@ nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
+ {
+   bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
+ 
+-  BFD_ASSERT (value <= 0xffff || ((bfd_signed_vma) value) >= -0xffff);
+-
+   bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
+ 	      sec->contents + offset);
+ }
+@@ -2518,7 +2516,7 @@ nios2_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg ATTRIBUTE_U
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset,
+ 				 hiadj (sym_value));
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset + 4,
+-				 (sym_value & 0xffff));
++				 sym_value);
+       stub_sec->size += 12;
+       break;
+     default:
+@@ -4986,16 +4984,28 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+       /* Emit the PLT entry.  */
+       if (bfd_link_pic (info))
+ 	{
++	  bfd_vma br_offset;
++
+ 	  nios2_elf32_install_data (splt, nios2_so_plt_entry, h->plt.offset,
+ 				    3);
+ 	  plt_index = (h->plt.offset - 24) / 12;
+ 	  got_offset = (plt_index + 3) * 4;
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset,
+-				     hiadj(plt_index * 4));
++				     hiadj (plt_index * 4));
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     (plt_index * 4) & 0xffff);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8,
+-				     0xfff4 - h->plt.offset);
++				     plt_index * 4);
++	  br_offset = -(h->plt.offset + 12);
++	  /* If this plt entry is too far away from the start of .plt
++	     for the "br" to reach .PLTresolve, bounce through one or
++	     more of the previous "br" instructions.  */
++	  if (br_offset < (bfd_vma) -32768)
++	    {
++	      br_offset += 32768 / 12 * 12 - 4;
++	      while (br_offset < (bfd_vma) -32768)
++		br_offset += 32768 / 12 * 12;
++	    }
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8, br_offset);
++
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+ 
+@@ -5014,9 +5024,8 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+ 	  nios2_elf32_install_data (splt, nios2_plt_entry, h->plt.offset, 3);
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj(got_address));
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     got_address & 0xffff);
++	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj (got_address));
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4, got_address);
+ 
+ 	  /* Fill in the entry in the global offset table.  */
+ 	  bfd_put_32 (output_bfd,
+@@ -5217,8 +5226,8 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 	      BFD_ASSERT ((got_pcrel & 0xf) == 0);
+ 	      nios2_elf32_install_data (splt, nios2_so_plt0_entry, 0, 6);
+ 	      nios2_elf32_install_imm16 (splt, 4, hiadj (got_pcrel));
+-	      nios2_elf32_install_imm16 (splt, 12, got_pcrel & 0xffff);
+-	      nios2_elf32_install_imm16 (splt, 16, (got_pcrel + 4) & 0xffff);
++	      nios2_elf32_install_imm16 (splt, 12, got_pcrel);
++	      nios2_elf32_install_imm16 (splt, 16, got_pcrel + 4);
+ 	    }
+ 	  else
+ 	    {
+@@ -5240,14 +5249,13 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 
+ 	      nios2_elf32_install_data (splt, nios2_plt0_entry, res_size, 7);
+ 	      nios2_elf32_install_imm16 (splt, res_size, hiadj (res_start));
+-	      nios2_elf32_install_imm16 (splt, res_size + 4,
+-					 res_start & 0xffff);
++	      nios2_elf32_install_imm16 (splt, res_size + 4, res_start);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 12,
+ 					 hiadj (got_address));
+ 	      nios2_elf32_install_imm16 (splt, res_size + 16,
+-					 (got_address + 4) & 0xffff);
++					 got_address + 4);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 20,
+-					 (got_address + 8) & 0xffff);
++					 got_address + 8);
+ 	    }
+ 	}
+     }
+-- 
+2.34.1
+
diff --git a/package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch b/package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
new file mode 100644
index 0000000000..4753ae13c4
--- /dev/null
+++ b/package/binutils/2.40/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
@@ -0,0 +1,125 @@
+From 900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Fri, 16 Feb 2024 22:33:29 +1030
+Subject: [PATCH] PR27597, nios: assertion fail in nios2_elf32_install_imm16
+
+The assertion in nios2_elf32_install_imm16 triggers when the PLT is
+twice the maximum allowable size for a branch from PLTn to reach
+.PLTresolve, and on no other call to nios2_elf32_install_imm16.  That
+makes the assertion completely useless.  We can handle a PIC PLT
+exceeding 0x8000 in size by bouncing branches that won't reach through
+previous branches.
+
+	PR 27597
+	* elf32-nios2.c (nios2_elf32_install_imm16): Delete BFD_ASSERT.
+	(nios2_build_one_stub): Don't bother masking value passed to
+	nios2_elf32_install_imm16.
+	(nios2_elf32_finish_dynamic_symbol): Likewise.  Handle overflow
+	of PLTn branch to .PLTresolve by bouncing through prior branches.
+
+Upstream: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-nios2.c | 40 ++++++++++++++++++++++++----------------
+ 1 file changed, 24 insertions(+), 16 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index bebf4239958..7f61e2f8507 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -1878,8 +1878,6 @@ nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
+ {
+   bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
+ 
+-  BFD_ASSERT (value <= 0xffff || ((bfd_signed_vma) value) >= -0xffff);
+-
+   bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
+ 	      sec->contents + offset);
+ }
+@@ -2518,7 +2516,7 @@ nios2_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg ATTRIBUTE_U
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset,
+ 				 hiadj (sym_value));
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset + 4,
+-				 (sym_value & 0xffff));
++				 sym_value);
+       stub_sec->size += 12;
+       break;
+     default:
+@@ -4986,16 +4984,28 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+       /* Emit the PLT entry.  */
+       if (bfd_link_pic (info))
+ 	{
++	  bfd_vma br_offset;
++
+ 	  nios2_elf32_install_data (splt, nios2_so_plt_entry, h->plt.offset,
+ 				    3);
+ 	  plt_index = (h->plt.offset - 24) / 12;
+ 	  got_offset = (plt_index + 3) * 4;
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset,
+-				     hiadj(plt_index * 4));
++				     hiadj (plt_index * 4));
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     (plt_index * 4) & 0xffff);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8,
+-				     0xfff4 - h->plt.offset);
++				     plt_index * 4);
++	  br_offset = -(h->plt.offset + 12);
++	  /* If this plt entry is too far away from the start of .plt
++	     for the "br" to reach .PLTresolve, bounce through one or
++	     more of the previous "br" instructions.  */
++	  if (br_offset < (bfd_vma) -32768)
++	    {
++	      br_offset += 32768 / 12 * 12 - 4;
++	      while (br_offset < (bfd_vma) -32768)
++		br_offset += 32768 / 12 * 12;
++	    }
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8, br_offset);
++
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+ 
+@@ -5014,9 +5024,8 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+ 	  nios2_elf32_install_data (splt, nios2_plt_entry, h->plt.offset, 3);
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj(got_address));
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     got_address & 0xffff);
++	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj (got_address));
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4, got_address);
+ 
+ 	  /* Fill in the entry in the global offset table.  */
+ 	  bfd_put_32 (output_bfd,
+@@ -5217,8 +5226,8 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 	      BFD_ASSERT ((got_pcrel & 0xf) == 0);
+ 	      nios2_elf32_install_data (splt, nios2_so_plt0_entry, 0, 6);
+ 	      nios2_elf32_install_imm16 (splt, 4, hiadj (got_pcrel));
+-	      nios2_elf32_install_imm16 (splt, 12, got_pcrel & 0xffff);
+-	      nios2_elf32_install_imm16 (splt, 16, (got_pcrel + 4) & 0xffff);
++	      nios2_elf32_install_imm16 (splt, 12, got_pcrel);
++	      nios2_elf32_install_imm16 (splt, 16, got_pcrel + 4);
+ 	    }
+ 	  else
+ 	    {
+@@ -5240,14 +5249,13 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 
+ 	      nios2_elf32_install_data (splt, nios2_plt0_entry, res_size, 7);
+ 	      nios2_elf32_install_imm16 (splt, res_size, hiadj (res_start));
+-	      nios2_elf32_install_imm16 (splt, res_size + 4,
+-					 res_start & 0xffff);
++	      nios2_elf32_install_imm16 (splt, res_size + 4, res_start);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 12,
+ 					 hiadj (got_address));
+ 	      nios2_elf32_install_imm16 (splt, res_size + 16,
+-					 (got_address + 4) & 0xffff);
++					 got_address + 4);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 20,
+-					 (got_address + 8) & 0xffff);
++					 got_address + 8);
+ 	    }
+ 	}
+     }
+-- 
+2.34.1
+
diff --git a/package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch b/package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
new file mode 100644
index 0000000000..4753ae13c4
--- /dev/null
+++ b/package/binutils/2.41/0003-PR27597-nios-assertion-fail-in-nios2_elf32_install_i.patch
@@ -0,0 +1,125 @@
+From 900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Fri, 16 Feb 2024 22:33:29 +1030
+Subject: [PATCH] PR27597, nios: assertion fail in nios2_elf32_install_imm16
+
+The assertion in nios2_elf32_install_imm16 triggers when the PLT is
+twice the maximum allowable size for a branch from PLTn to reach
+.PLTresolve, and on no other call to nios2_elf32_install_imm16.  That
+makes the assertion completely useless.  We can handle a PIC PLT
+exceeding 0x8000 in size by bouncing branches that won't reach through
+previous branches.
+
+	PR 27597
+	* elf32-nios2.c (nios2_elf32_install_imm16): Delete BFD_ASSERT.
+	(nios2_build_one_stub): Don't bother masking value passed to
+	nios2_elf32_install_imm16.
+	(nios2_elf32_finish_dynamic_symbol): Likewise.  Handle overflow
+	of PLTn branch to .PLTresolve by bouncing through prior branches.
+
+Upstream: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=900c0f0aa3d78cd9e67ccd26fbc86224cef4c5b1
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-nios2.c | 40 ++++++++++++++++++++++++----------------
+ 1 file changed, 24 insertions(+), 16 deletions(-)
+
+diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
+index bebf4239958..7f61e2f8507 100644
+--- a/bfd/elf32-nios2.c
++++ b/bfd/elf32-nios2.c
+@@ -1878,8 +1878,6 @@ nios2_elf32_install_imm16 (asection *sec, bfd_vma offset, bfd_vma value)
+ {
+   bfd_vma word = bfd_get_32 (sec->owner, sec->contents + offset);
+ 
+-  BFD_ASSERT (value <= 0xffff || ((bfd_signed_vma) value) >= -0xffff);
+-
+   bfd_put_32 (sec->owner, word | ((value & 0xffff) << 6),
+ 	      sec->contents + offset);
+ }
+@@ -2518,7 +2516,7 @@ nios2_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg ATTRIBUTE_U
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset,
+ 				 hiadj (sym_value));
+       nios2_elf32_install_imm16 (stub_sec, hsh->stub_offset + 4,
+-				 (sym_value & 0xffff));
++				 sym_value);
+       stub_sec->size += 12;
+       break;
+     default:
+@@ -4986,16 +4984,28 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+       /* Emit the PLT entry.  */
+       if (bfd_link_pic (info))
+ 	{
++	  bfd_vma br_offset;
++
+ 	  nios2_elf32_install_data (splt, nios2_so_plt_entry, h->plt.offset,
+ 				    3);
+ 	  plt_index = (h->plt.offset - 24) / 12;
+ 	  got_offset = (plt_index + 3) * 4;
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset,
+-				     hiadj(plt_index * 4));
++				     hiadj (plt_index * 4));
+ 	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     (plt_index * 4) & 0xffff);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8,
+-				     0xfff4 - h->plt.offset);
++				     plt_index * 4);
++	  br_offset = -(h->plt.offset + 12);
++	  /* If this plt entry is too far away from the start of .plt
++	     for the "br" to reach .PLTresolve, bounce through one or
++	     more of the previous "br" instructions.  */
++	  if (br_offset < (bfd_vma) -32768)
++	    {
++	      br_offset += 32768 / 12 * 12 - 4;
++	      while (br_offset < (bfd_vma) -32768)
++		br_offset += 32768 / 12 * 12;
++	    }
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 8, br_offset);
++
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+ 
+@@ -5014,9 +5024,8 @@ nios2_elf32_finish_dynamic_symbol (bfd *output_bfd,
+ 	  nios2_elf32_install_data (splt, nios2_plt_entry, h->plt.offset, 3);
+ 	  got_address = (sgotplt->output_section->vma + sgotplt->output_offset
+ 			 + got_offset);
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj(got_address));
+-	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4,
+-				     got_address & 0xffff);
++	  nios2_elf32_install_imm16 (splt, h->plt.offset, hiadj (got_address));
++	  nios2_elf32_install_imm16 (splt, h->plt.offset + 4, got_address);
+ 
+ 	  /* Fill in the entry in the global offset table.  */
+ 	  bfd_put_32 (output_bfd,
+@@ -5217,8 +5226,8 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 	      BFD_ASSERT ((got_pcrel & 0xf) == 0);
+ 	      nios2_elf32_install_data (splt, nios2_so_plt0_entry, 0, 6);
+ 	      nios2_elf32_install_imm16 (splt, 4, hiadj (got_pcrel));
+-	      nios2_elf32_install_imm16 (splt, 12, got_pcrel & 0xffff);
+-	      nios2_elf32_install_imm16 (splt, 16, (got_pcrel + 4) & 0xffff);
++	      nios2_elf32_install_imm16 (splt, 12, got_pcrel);
++	      nios2_elf32_install_imm16 (splt, 16, got_pcrel + 4);
+ 	    }
+ 	  else
+ 	    {
+@@ -5240,14 +5249,13 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
+ 
+ 	      nios2_elf32_install_data (splt, nios2_plt0_entry, res_size, 7);
+ 	      nios2_elf32_install_imm16 (splt, res_size, hiadj (res_start));
+-	      nios2_elf32_install_imm16 (splt, res_size + 4,
+-					 res_start & 0xffff);
++	      nios2_elf32_install_imm16 (splt, res_size + 4, res_start);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 12,
+ 					 hiadj (got_address));
+ 	      nios2_elf32_install_imm16 (splt, res_size + 16,
+-					 (got_address + 4) & 0xffff);
++					 got_address + 4);
+ 	      nios2_elf32_install_imm16 (splt, res_size + 20,
+-					 (got_address + 8) & 0xffff);
++					 got_address + 8);
+ 	    }
+ 	}
+     }
+-- 
+2.34.1
+
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 3/9] package/gdal: drop nios2 binutils bug 27597 dependency
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
  2024-02-21 21:39     ` [Buildroot] [PATCH v2 1/9] toolchain/toolchain-external: drop external codesourcery niosII toolchain Giulio Benetti
  2024-02-21 21:39     ` [Buildroot] [PATCH v2 2/9] package/binutils: add local patches to fix Nios2 bug 27597 Giulio Benetti
@ 2024-02-21 21:39     ` Giulio Benetti
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 4/9] package/kf5/kf5-kcoreaddons: " Giulio Benetti
                       ` (5 subsequent siblings)
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:39 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 package/gdal/Config.in | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/package/gdal/Config.in b/package/gdal/Config.in
index 24a1f06af2..839a1bd7ea 100644
--- a/package/gdal/Config.in
+++ b/package/gdal/Config.in
@@ -5,7 +5,6 @@ config BR2_PACKAGE_GDAL
 	# configure can't find proj, when linking statically
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11, proj
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 	depends on BR2_TOOLCHAIN_HAS_THREADS # proj
 	depends on BR2_USE_WCHAR # proj
 	select BR2_PACKAGE_GIFLIB
@@ -26,9 +25,8 @@ config BR2_PACKAGE_GDAL
 
 	  https://gdal.org/
 
-comment "gdal needs a toolchain w/ C++, dynamic library, gcc >= 4.7, not binutils bug 27597, threads, wchar"
+comment "gdal needs a toolchain w/ C++, dynamic library, gcc >= 4.7, threads, wchar"
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || \
-		BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597 || \
 		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 4/9] package/kf5/kf5-kcoreaddons: drop nios2 binutils bug 27597 dependency
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
                       ` (2 preceding siblings ...)
  2024-02-21 21:39     ` [Buildroot] [PATCH v2 3/9] package/gdal: drop nios2 binutils bug 27597 dependency Giulio Benetti
@ 2024-02-21 21:40     ` Giulio Benetti
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 5/9] package/libcamera: " Giulio Benetti
                       ` (4 subsequent siblings)
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:40 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/kf5/kf5-kcoreaddons/Config.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/kf5/kf5-kcoreaddons/Config.in b/package/kf5/kf5-kcoreaddons/Config.in
index 02bd38e395..88fda03ee0 100644
--- a/package/kf5/kf5-kcoreaddons/Config.in
+++ b/package/kf5/kf5-kcoreaddons/Config.in
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_KF5_KCOREADDONS
 	bool "kf5-kcoreaddons"
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 	select BR2_PACKAGE_KF5_EXTRA_CMAKE_MODULES
 	select BR2_PACKAGE_QT5TOOLS
 	select BR2_PACKAGE_QT5TOOLS_LINGUIST_TOOLS
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 5/9] package/libcamera: drop nios2 binutils bug 27597 dependency
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
                       ` (3 preceding siblings ...)
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 4/9] package/kf5/kf5-kcoreaddons: " Giulio Benetti
@ 2024-02-21 21:40     ` Giulio Benetti
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 6/9] package/libgeos: " Giulio Benetti
                       ` (3 subsequent siblings)
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:40 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/libcamera/Config.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/libcamera/Config.in b/package/libcamera/Config.in
index ccb5281b4b..e84b8d342e 100644
--- a/package/libcamera/Config.in
+++ b/package/libcamera/Config.in
@@ -3,7 +3,6 @@ config BR2_PACKAGE_LIBCAMERA_ARCH_SUPPORTS
 	default y
 	# Invalid packing size of ControlValue struct on m68k
 	depends on !BR2_m68k
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 
 menuconfig BR2_PACKAGE_LIBCAMERA
 	bool "libcamera"
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 6/9] package/libgeos: drop nios2 binutils bug 27597 dependency
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
                       ` (4 preceding siblings ...)
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 5/9] package/libcamera: " Giulio Benetti
@ 2024-02-21 21:40     ` Giulio Benetti
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 7/9] package/pistache: " Giulio Benetti
                       ` (2 subsequent siblings)
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:40 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 package/libgeos/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/libgeos/Config.in b/package/libgeos/Config.in
index 2a27c6f2a4..76cbb9bdcd 100644
--- a/package/libgeos/Config.in
+++ b/package/libgeos/Config.in
@@ -4,7 +4,6 @@ config BR2_PACKAGE_LIBGEOS
 	depends on BR2_USE_WCHAR
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++14
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 	help
 	  GEOS (Geometry Engine - Open Source) is a C++ port of the
 	  JTS Topology Suite (JTS). It aims to contain the complete
@@ -14,8 +13,7 @@ config BR2_PACKAGE_LIBGEOS
 
 	  https://trac.osgeo.org/geos
 
-comment "libgeos needs a toolchain w/ C++, wchar, gcc >= 4.9, threads not binutils bug 27597"
+comment "libgeos needs a toolchain w/ C++, wchar, gcc >= 4.9, threads"
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
 		   !BR2_TOOLCHAIN_HAS_THREADS || \
-		   !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
-		   BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
+		   !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 7/9] package/pistache: drop nios2 binutils bug 27597 dependency
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
                       ` (5 preceding siblings ...)
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 6/9] package/libgeos: " Giulio Benetti
@ 2024-02-21 21:40     ` Giulio Benetti
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 8/9] package/postgis: " Giulio Benetti
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 9/9] toolchain: remove binutils bug 27597 Giulio Benetti
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:40 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/pistache/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/pistache/Config.in b/package/pistache/Config.in
index 3acf1f53f0..ca2d2833cd 100644
--- a/package/pistache/Config.in
+++ b/package/pistache/Config.in
@@ -4,7 +4,6 @@ config BR2_PACKAGE_PISTACHE
 	depends on BR2_USE_WCHAR
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_INSTALL_LIBSTDCPP
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
 	select BR2_PACKAGE_RAPIDJSON
 	help
 	  Pistache is a modern and elegant HTTP and REST framework
@@ -13,9 +12,8 @@ config BR2_PACKAGE_PISTACHE
 
 	  https://github.com/oktal/pistache
 
-comment "pistache needs a toolchain w/ C++, gcc >= 7, threads, wchar, not binutils bug 27597"
+comment "pistache needs a toolchain w/ C++, gcc >= 7, threads, wchar"
 	depends on !BR2_INSTALL_LIBSTDCPP || \
 		   !BR2_TOOLCHAIN_GCC_AT_LEAST_7 || \
 		   !BR2_TOOLCHAIN_HAS_THREADS || \
-		   !BR2_USE_WCHAR || \
-		   BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
+		   !BR2_USE_WCHAR
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 8/9] package/postgis: drop nios2 binutils bug 27597 dependency
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
                       ` (6 preceding siblings ...)
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 7/9] package/pistache: " Giulio Benetti
@ 2024-02-21 21:40     ` Giulio Benetti
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 9/9] toolchain: remove binutils bug 27597 Giulio Benetti
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:40 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

Now that binutils patch has been backported to every Buildroot binutils
version we can drop nios2 binutils bug 27597 dependency.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Maxim Kochetkov <fido_max@inbox.ru>
---
 package/postgis/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/postgis/Config.in b/package/postgis/Config.in
index 7d42390677..78569d63be 100644
--- a/package/postgis/Config.in
+++ b/package/postgis/Config.in
@@ -5,7 +5,6 @@ config BR2_PACKAGE_POSTGIS
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # libgeos
 	depends on BR2_TOOLCHAIN_HAS_THREADS # libgeos, proj
 	depends on BR2_USE_WCHAR # libgeos, proj
-	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597 # libgeos
 	select BR2_PACKAGE_LIBGEOS
 	select BR2_PACKAGE_PROJ
 	select BR2_PACKAGE_LIBXML2
@@ -18,7 +17,6 @@ config BR2_PACKAGE_POSTGIS
 
 	  https://postgis.net/
 
-comment "postgis needs a toolchain w/ C++, threads, wchar, gcc >= 4.9, not binutils bug 27597"
+comment "postgis needs a toolchain w/ C++, threads, wchar, gcc >= 4.9"
 	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
-		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR || \
-		BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
+		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [Buildroot] [PATCH v2 9/9] toolchain: remove binutils bug 27597
  2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
                       ` (7 preceding siblings ...)
  2024-02-21 21:40     ` [Buildroot] [PATCH v2 8/9] package/postgis: " Giulio Benetti
@ 2024-02-21 21:40     ` Giulio Benetti
  8 siblings, 0 replies; 28+ messages in thread
From: Giulio Benetti @ 2024-02-21 21:40 UTC (permalink / raw)
  To: buildroot
  Cc: Marcus Folkesson, Pierre Ducroquet, Kieran Bingham,
	Yann E . MORIN, Dominik Michael Rauh, Maxim Kochetkov,
	Vincent Fazio, Thomas Petazzoni, Giulio Benetti, Romain Naour,
	Thomas De Schampheleire

Binutils bug 27597 is not present anymore in Buildroot so let's remove it.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 toolchain/Config.in | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 407a03c42e..9e6cff1950 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -71,12 +71,6 @@ source "package/gdb/Config.in.host"
 
 comment "Toolchain Generic Options"
 
-# https://sourceware.org/bugzilla/show_bug.cgi?id=27597
-# Affect toolchains built with binutils 2.36.1, still not fixed.
-config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597
-	bool
-	default y if BR2_nios2
-
 # https://sourceware.org/bugzilla/show_bug.cgi?id=30730
 # Affect toolchains built with binutils 2.40, still not fixed.
 config BR2_TOOLCHAIN_HAS_BINUTILS_BUG_30730
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2024-02-21 21:40 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-18 18:45 [Buildroot] [PATCH 0/8] Patch and remove Nios2 binutils bug 27597 Giulio Benetti
2024-02-18 18:45 ` [Buildroot] [PATCH 1/8] package/binutils: add local patches to fix Nios2 " Giulio Benetti
2024-02-18 18:45 ` [Buildroot] [PATCH 2/8] package/gdal: drop nios2 binutils bug 27597 dependency Giulio Benetti
2024-02-18 19:13   ` Yann E. MORIN
2024-02-19  5:47   ` Maxim Kochetkov via buildroot
2024-02-18 18:45 ` [Buildroot] [PATCH 3/8] package/kf5/kf5-kcoreaddons: " Giulio Benetti
2024-02-18 18:45 ` [Buildroot] [PATCH 4/8] package/libcamera: " Giulio Benetti
2024-02-18 18:45 ` [Buildroot] [PATCH 5/8] package/libgeos: " Giulio Benetti
2024-02-19  5:48   ` Maxim Kochetkov via buildroot
2024-02-18 18:45 ` [Buildroot] [PATCH 6/8] package/pistache: " Giulio Benetti
2024-02-18 18:45 ` [Buildroot] [PATCH 7/8] package/postgis: " Giulio Benetti
2024-02-19  5:48   ` Maxim Kochetkov via buildroot
2024-02-18 18:45 ` [Buildroot] [PATCH 8/8] toolchain: remove binutils bug 27597 Giulio Benetti
2024-02-18 19:44   ` Yann E. MORIN
2024-02-18 19:26 ` [Buildroot] [PATCH 0/8] Patch and remove Nios2 " Yann E. MORIN
2024-02-18 22:05 ` Thomas Petazzoni via buildroot
2024-02-18 22:28   ` Giulio Benetti
2024-02-19  1:20     ` Vincent Fazio
2024-02-21 21:39   ` [Buildroot] [PATCH v2 0/9] " Giulio Benetti
2024-02-21 21:39     ` [Buildroot] [PATCH v2 1/9] toolchain/toolchain-external: drop external codesourcery niosII toolchain Giulio Benetti
2024-02-21 21:39     ` [Buildroot] [PATCH v2 2/9] package/binutils: add local patches to fix Nios2 bug 27597 Giulio Benetti
2024-02-21 21:39     ` [Buildroot] [PATCH v2 3/9] package/gdal: drop nios2 binutils bug 27597 dependency Giulio Benetti
2024-02-21 21:40     ` [Buildroot] [PATCH v2 4/9] package/kf5/kf5-kcoreaddons: " Giulio Benetti
2024-02-21 21:40     ` [Buildroot] [PATCH v2 5/9] package/libcamera: " Giulio Benetti
2024-02-21 21:40     ` [Buildroot] [PATCH v2 6/9] package/libgeos: " Giulio Benetti
2024-02-21 21:40     ` [Buildroot] [PATCH v2 7/9] package/pistache: " Giulio Benetti
2024-02-21 21:40     ` [Buildroot] [PATCH v2 8/9] package/postgis: " Giulio Benetti
2024-02-21 21:40     ` [Buildroot] [PATCH v2 9/9] toolchain: remove binutils bug 27597 Giulio Benetti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).