All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/1] Fix last OpenRisc binutils bug
@ 2021-07-12 10:45 Giulio Benetti
  2021-07-12 10:45 ` [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc Giulio Benetti
  0 siblings, 1 reply; 10+ messages in thread
From: Giulio Benetti @ 2021-07-12 10:45 UTC (permalink / raw)
  To: buildroot

This patch adds patches for all 4 binutils version we have and fixes a
binutils bug who shows up while building package openal. It's been
suggested upstream and it's pending:
https://sourceware.org/pipermail/binutils/2021-July/117334.html

With this last binutils bug fix, new external toolchain can be built
(i.e. Bootlin ones) and after that we can consider Buildroot toolchains
and external toolchains with all OpenRisc's patches applied bug-free.

I've built and re-built openal package with binutils 2.32, 2.34, 2.35.2,
2.36.1 without and with this patch succesfully.

Giulio Benetti (1):
  package/binutils: fix linker assert on OpenRisc

 ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
 ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
 ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
 ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
 4 files changed, 236 insertions(+)
 create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
 create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
 create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
 create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch

-- 
2.25.1

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

* [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
  2021-07-12 10:45 [Buildroot] [PATCH 0/1] Fix last OpenRisc binutils bug Giulio Benetti
@ 2021-07-12 10:45 ` Giulio Benetti
  2021-07-16 14:14     ` Giulio Benetti
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Giulio Benetti @ 2021-07-12 10:45 UTC (permalink / raw)
  To: buildroot

When building openal we were seeing the assert failure:

/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
pc-relative relocation against dynamic symbol alSourcePausev
/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
pc-relative relocation against dynamic symbol alSourceStopv
/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
pc-relative relocation against dynamic symbol alSourceRewindv
/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
pc-relative relocation against dynamic symbol alSourcePlayv
collect2: error: ld returned 1 exit status

So add patches to fix this binutils assert link failure on OpenRisc.
It's been suggested upstream and it's pending here:
https://sourceware.org/pipermail/binutils/2021-July/117334.html

Fixes:
http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
 ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
 ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
 ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
 4 files changed, 236 insertions(+)
 create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
 create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
 create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
 create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch

diff --git a/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
new file mode 100644
index 0000000000..585b97b2af
--- /dev/null
+++ b/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
@@ -0,0 +1,59 @@
+From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Sat, 10 Jul 2021 17:57:34 +0200
+Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
+ relative 26 bit relocation
+
+When building openal we were seeing the assert failure:
+
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePausev
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceStopv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceRewindv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePlayv
+collect2: error: ld returned 1 exit status
+
+This happens because in R_OR1K_INSN_REL_26 case we can't reference local
+symbol as previously done but we need to make sure that calls to actual
+symbol always call the version of current object.
+
+bfd/Changelog:
+
+	* elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
+	  in switch case R_OR1K_INSN_REL_26 where we need to check for
+	  !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..4f9092539f5 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ 	  break;
+ 
+ 	case R_OR1K_INSN_REL_26:
++	  /* For a non-shared link, these will reference plt or call the
++	     version of actual object.  */
++	  if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
++	    {
++	      _bfd_error_handler
++		(_("%pB: pc-relative relocation against dynamic symbol %s"),
++		 input_bfd, name);
++	      ret_val = FALSE;
++	      bfd_set_error (bfd_error_bad_value);
++	    }
++	  break;
++
+ 	case R_OR1K_PCREL_PG21:
+ 	case R_OR1K_LO13:
+ 	case R_OR1K_SLO13:
+-- 
+2.25.1
+
diff --git a/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
new file mode 100644
index 0000000000..585b97b2af
--- /dev/null
+++ b/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
@@ -0,0 +1,59 @@
+From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Sat, 10 Jul 2021 17:57:34 +0200
+Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
+ relative 26 bit relocation
+
+When building openal we were seeing the assert failure:
+
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePausev
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceStopv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceRewindv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePlayv
+collect2: error: ld returned 1 exit status
+
+This happens because in R_OR1K_INSN_REL_26 case we can't reference local
+symbol as previously done but we need to make sure that calls to actual
+symbol always call the version of current object.
+
+bfd/Changelog:
+
+	* elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
+	  in switch case R_OR1K_INSN_REL_26 where we need to check for
+	  !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..4f9092539f5 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ 	  break;
+ 
+ 	case R_OR1K_INSN_REL_26:
++	  /* For a non-shared link, these will reference plt or call the
++	     version of actual object.  */
++	  if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
++	    {
++	      _bfd_error_handler
++		(_("%pB: pc-relative relocation against dynamic symbol %s"),
++		 input_bfd, name);
++	      ret_val = FALSE;
++	      bfd_set_error (bfd_error_bad_value);
++	    }
++	  break;
++
+ 	case R_OR1K_PCREL_PG21:
+ 	case R_OR1K_LO13:
+ 	case R_OR1K_SLO13:
+-- 
+2.25.1
+
diff --git a/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
new file mode 100644
index 0000000000..585b97b2af
--- /dev/null
+++ b/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
@@ -0,0 +1,59 @@
+From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Sat, 10 Jul 2021 17:57:34 +0200
+Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
+ relative 26 bit relocation
+
+When building openal we were seeing the assert failure:
+
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePausev
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceStopv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceRewindv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePlayv
+collect2: error: ld returned 1 exit status
+
+This happens because in R_OR1K_INSN_REL_26 case we can't reference local
+symbol as previously done but we need to make sure that calls to actual
+symbol always call the version of current object.
+
+bfd/Changelog:
+
+	* elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
+	  in switch case R_OR1K_INSN_REL_26 where we need to check for
+	  !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..4f9092539f5 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ 	  break;
+ 
+ 	case R_OR1K_INSN_REL_26:
++	  /* For a non-shared link, these will reference plt or call the
++	     version of actual object.  */
++	  if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
++	    {
++	      _bfd_error_handler
++		(_("%pB: pc-relative relocation against dynamic symbol %s"),
++		 input_bfd, name);
++	      ret_val = FALSE;
++	      bfd_set_error (bfd_error_bad_value);
++	    }
++	  break;
++
+ 	case R_OR1K_PCREL_PG21:
+ 	case R_OR1K_LO13:
+ 	case R_OR1K_SLO13:
+-- 
+2.25.1
+
diff --git a/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
new file mode 100644
index 0000000000..585b97b2af
--- /dev/null
+++ b/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
@@ -0,0 +1,59 @@
+From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@benettiengineering.com>
+Date: Sat, 10 Jul 2021 17:57:34 +0200
+Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
+ relative 26 bit relocation
+
+When building openal we were seeing the assert failure:
+
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePausev
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceStopv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourceRewindv
+/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
+pc-relative relocation against dynamic symbol alSourcePlayv
+collect2: error: ld returned 1 exit status
+
+This happens because in R_OR1K_INSN_REL_26 case we can't reference local
+symbol as previously done but we need to make sure that calls to actual
+symbol always call the version of current object.
+
+bfd/Changelog:
+
+	* elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
+	  in switch case R_OR1K_INSN_REL_26 where we need to check for
+	  !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
+
+Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
+---
+ bfd/elf32-or1k.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
+index 4ae7f324d33..4f9092539f5 100644
+--- a/bfd/elf32-or1k.c
++++ b/bfd/elf32-or1k.c
+@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
+ 	  break;
+ 
+ 	case R_OR1K_INSN_REL_26:
++	  /* For a non-shared link, these will reference plt or call the
++	     version of actual object.  */
++	  if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
++	    {
++	      _bfd_error_handler
++		(_("%pB: pc-relative relocation against dynamic symbol %s"),
++		 input_bfd, name);
++	      ret_val = FALSE;
++	      bfd_set_error (bfd_error_bad_value);
++	    }
++	  break;
++
+ 	case R_OR1K_PCREL_PG21:
+ 	case R_OR1K_LO13:
+ 	case R_OR1K_SLO13:
+-- 
+2.25.1
+
-- 
2.25.1

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

* [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
@ 2021-07-16 14:14     ` Giulio Benetti
  0 siblings, 0 replies; 10+ messages in thread
From: Giulio Benetti @ 2021-07-16 14:14 UTC (permalink / raw)
  To: buildroot

Hello,

> Il giorno 12 lug 2021, alle ore 12:45, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
> 
> ?When building openal we were seeing the assert failure:
> 
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourcePausev
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourceStopv
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourceRewindv
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourcePlayv
> collect2: error: ld returned 1 exit status
> 
> So add patches to fix this binutils assert link failure on OpenRisc.
> It's been suggested upstream and it's pending here:
> https://sourceware.org/pipermail/binutils/2021-July/117334.html

This patche has been applied upstream:

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=05a1dd47cc9b6fcc8ec112bd0b68b36567ccbb39

Best regards
Giulio Benetti

> 
> Fixes:
> http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
> 4 files changed, 236 insertions(+)
> create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> 
> diff --git a/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> new file mode 100644
> index 0000000000..585b97b2af
> --- /dev/null
> +++ b/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> @@ -0,0 +1,59 @@
> +From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 10 Jul 2021 17:57:34 +0200
> +Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
> + relative 26 bit relocation
> +
> +When building openal we were seeing the assert failure:
> +
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePausev
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceStopv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceRewindv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePlayv
> +collect2: error: ld returned 1 exit status
> +
> +This happens because in R_OR1K_INSN_REL_26 case we can't reference local
> +symbol as previously done but we need to make sure that calls to actual
> +symbol always call the version of current object.
> +
> +bfd/Changelog:
> +
> +    * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
> +      in switch case R_OR1K_INSN_REL_26 where we need to check for
> +      !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + bfd/elf32-or1k.c | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
> +index 4ae7f324d33..4f9092539f5 100644
> +--- a/bfd/elf32-or1k.c
> ++++ b/bfd/elf32-or1k.c
> +@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
> +      break;
> + 
> +    case R_OR1K_INSN_REL_26:
> ++      /* For a non-shared link, these will reference plt or call the
> ++         version of actual object.  */
> ++      if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
> ++        {
> ++          _bfd_error_handler
> ++        (_("%pB: pc-relative relocation against dynamic symbol %s"),
> ++         input_bfd, name);
> ++          ret_val = FALSE;
> ++          bfd_set_error (bfd_error_bad_value);
> ++        }
> ++      break;
> ++
> +    case R_OR1K_PCREL_PG21:
> +    case R_OR1K_LO13:
> +    case R_OR1K_SLO13:
> +-- 
> +2.25.1
> +
> diff --git a/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> new file mode 100644
> index 0000000000..585b97b2af
> --- /dev/null
> +++ b/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> @@ -0,0 +1,59 @@
> +From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 10 Jul 2021 17:57:34 +0200
> +Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
> + relative 26 bit relocation
> +
> +When building openal we were seeing the assert failure:
> +
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePausev
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceStopv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceRewindv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePlayv
> +collect2: error: ld returned 1 exit status
> +
> +This happens because in R_OR1K_INSN_REL_26 case we can't reference local
> +symbol as previously done but we need to make sure that calls to actual
> +symbol always call the version of current object.
> +
> +bfd/Changelog:
> +
> +    * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
> +      in switch case R_OR1K_INSN_REL_26 where we need to check for
> +      !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + bfd/elf32-or1k.c | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
> +index 4ae7f324d33..4f9092539f5 100644
> +--- a/bfd/elf32-or1k.c
> ++++ b/bfd/elf32-or1k.c
> +@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
> +      break;
> + 
> +    case R_OR1K_INSN_REL_26:
> ++      /* For a non-shared link, these will reference plt or call the
> ++         version of actual object.  */
> ++      if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
> ++        {
> ++          _bfd_error_handler
> ++        (_("%pB: pc-relative relocation against dynamic symbol %s"),
> ++         input_bfd, name);
> ++          ret_val = FALSE;
> ++          bfd_set_error (bfd_error_bad_value);
> ++        }
> ++      break;
> ++
> +    case R_OR1K_PCREL_PG21:
> +    case R_OR1K_LO13:
> +    case R_OR1K_SLO13:
> +-- 
> +2.25.1
> +
> diff --git a/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> new file mode 100644
> index 0000000000..585b97b2af
> --- /dev/null
> +++ b/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> @@ -0,0 +1,59 @@
> +From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 10 Jul 2021 17:57:34 +0200
> +Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
> + relative 26 bit relocation
> +
> +When building openal we were seeing the assert failure:
> +
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePausev
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceStopv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceRewindv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePlayv
> +collect2: error: ld returned 1 exit status
> +
> +This happens because in R_OR1K_INSN_REL_26 case we can't reference local
> +symbol as previously done but we need to make sure that calls to actual
> +symbol always call the version of current object.
> +
> +bfd/Changelog:
> +
> +    * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
> +      in switch case R_OR1K_INSN_REL_26 where we need to check for
> +      !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + bfd/elf32-or1k.c | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
> +index 4ae7f324d33..4f9092539f5 100644
> +--- a/bfd/elf32-or1k.c
> ++++ b/bfd/elf32-or1k.c
> +@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
> +      break;
> + 
> +    case R_OR1K_INSN_REL_26:
> ++      /* For a non-shared link, these will reference plt or call the
> ++         version of actual object.  */
> ++      if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
> ++        {
> ++          _bfd_error_handler
> ++        (_("%pB: pc-relative relocation against dynamic symbol %s"),
> ++         input_bfd, name);
> ++          ret_val = FALSE;
> ++          bfd_set_error (bfd_error_bad_value);
> ++        }
> ++      break;
> ++
> +    case R_OR1K_PCREL_PG21:
> +    case R_OR1K_LO13:
> +    case R_OR1K_SLO13:
> +-- 
> +2.25.1
> +
> diff --git a/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> new file mode 100644
> index 0000000000..585b97b2af
> --- /dev/null
> +++ b/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> @@ -0,0 +1,59 @@
> +From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 10 Jul 2021 17:57:34 +0200
> +Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
> + relative 26 bit relocation
> +
> +When building openal we were seeing the assert failure:
> +
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePausev
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceStopv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceRewindv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePlayv
> +collect2: error: ld returned 1 exit status
> +
> +This happens because in R_OR1K_INSN_REL_26 case we can't reference local
> +symbol as previously done but we need to make sure that calls to actual
> +symbol always call the version of current object.
> +
> +bfd/Changelog:
> +
> +    * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
> +      in switch case R_OR1K_INSN_REL_26 where we need to check for
> +      !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + bfd/elf32-or1k.c | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
> +index 4ae7f324d33..4f9092539f5 100644
> +--- a/bfd/elf32-or1k.c
> ++++ b/bfd/elf32-or1k.c
> +@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
> +      break;
> + 
> +    case R_OR1K_INSN_REL_26:
> ++      /* For a non-shared link, these will reference plt or call the
> ++         version of actual object.  */
> ++      if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
> ++        {
> ++          _bfd_error_handler
> ++        (_("%pB: pc-relative relocation against dynamic symbol %s"),
> ++         input_bfd, name);
> ++          ret_val = FALSE;
> ++          bfd_set_error (bfd_error_bad_value);
> ++        }
> ++      break;
> ++
> +    case R_OR1K_PCREL_PG21:
> +    case R_OR1K_LO13:
> +    case R_OR1K_SLO13:
> +-- 
> +2.25.1
> +
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210716/d3209ead/attachment-0001.html>

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

* [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
@ 2021-07-16 14:14     ` Giulio Benetti
  0 siblings, 0 replies; 10+ messages in thread
From: Giulio Benetti @ 2021-07-16 14:14 UTC (permalink / raw)
  To: buildroot

Hello,

> Il giorno 12 lug 2021, alle ore 12:45, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
> 
> ?When building openal we were seeing the assert failure:
> 
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourcePausev
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourceStopv
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourceRewindv
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourcePlayv
> collect2: error: ld returned 1 exit status
> 
> So add patches to fix this binutils assert link failure on OpenRisc.
> It's been suggested upstream and it's pending here:
> https://sourceware.org/pipermail/binutils/2021-July/117334.html

This patche has been applied upstream:

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=05a1dd47cc9b6fcc8ec112bd0b68b36567ccbb39

Best regards
Giulio Benetti

> 
> Fixes:
> http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
> 4 files changed, 236 insertions(+)
> create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> 
> diff --git a/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> new file mode 100644
> index 0000000000..585b97b2af
> --- /dev/null
> +++ b/package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> @@ -0,0 +1,59 @@
> +From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 10 Jul 2021 17:57:34 +0200
> +Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
> + relative 26 bit relocation
> +
> +When building openal we were seeing the assert failure:
> +
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePausev
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceStopv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceRewindv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePlayv
> +collect2: error: ld returned 1 exit status
> +
> +This happens because in R_OR1K_INSN_REL_26 case we can't reference local
> +symbol as previously done but we need to make sure that calls to actual
> +symbol always call the version of current object.
> +
> +bfd/Changelog:
> +
> +    * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
> +      in switch case R_OR1K_INSN_REL_26 where we need to check for
> +      !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + bfd/elf32-or1k.c | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
> +index 4ae7f324d33..4f9092539f5 100644
> +--- a/bfd/elf32-or1k.c
> ++++ b/bfd/elf32-or1k.c
> +@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
> +      break;
> + 
> +    case R_OR1K_INSN_REL_26:
> ++      /* For a non-shared link, these will reference plt or call the
> ++         version of actual object.  */
> ++      if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
> ++        {
> ++          _bfd_error_handler
> ++        (_("%pB: pc-relative relocation against dynamic symbol %s"),
> ++         input_bfd, name);
> ++          ret_val = FALSE;
> ++          bfd_set_error (bfd_error_bad_value);
> ++        }
> ++      break;
> ++
> +    case R_OR1K_PCREL_PG21:
> +    case R_OR1K_LO13:
> +    case R_OR1K_SLO13:
> +-- 
> +2.25.1
> +
> diff --git a/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> new file mode 100644
> index 0000000000..585b97b2af
> --- /dev/null
> +++ b/package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> @@ -0,0 +1,59 @@
> +From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 10 Jul 2021 17:57:34 +0200
> +Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
> + relative 26 bit relocation
> +
> +When building openal we were seeing the assert failure:
> +
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePausev
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceStopv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceRewindv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePlayv
> +collect2: error: ld returned 1 exit status
> +
> +This happens because in R_OR1K_INSN_REL_26 case we can't reference local
> +symbol as previously done but we need to make sure that calls to actual
> +symbol always call the version of current object.
> +
> +bfd/Changelog:
> +
> +    * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
> +      in switch case R_OR1K_INSN_REL_26 where we need to check for
> +      !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + bfd/elf32-or1k.c | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
> +index 4ae7f324d33..4f9092539f5 100644
> +--- a/bfd/elf32-or1k.c
> ++++ b/bfd/elf32-or1k.c
> +@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
> +      break;
> + 
> +    case R_OR1K_INSN_REL_26:
> ++      /* For a non-shared link, these will reference plt or call the
> ++         version of actual object.  */
> ++      if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
> ++        {
> ++          _bfd_error_handler
> ++        (_("%pB: pc-relative relocation against dynamic symbol %s"),
> ++         input_bfd, name);
> ++          ret_val = FALSE;
> ++          bfd_set_error (bfd_error_bad_value);
> ++        }
> ++      break;
> ++
> +    case R_OR1K_PCREL_PG21:
> +    case R_OR1K_LO13:
> +    case R_OR1K_SLO13:
> +-- 
> +2.25.1
> +
> diff --git a/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> new file mode 100644
> index 0000000000..585b97b2af
> --- /dev/null
> +++ b/package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> @@ -0,0 +1,59 @@
> +From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 10 Jul 2021 17:57:34 +0200
> +Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
> + relative 26 bit relocation
> +
> +When building openal we were seeing the assert failure:
> +
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePausev
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceStopv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceRewindv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePlayv
> +collect2: error: ld returned 1 exit status
> +
> +This happens because in R_OR1K_INSN_REL_26 case we can't reference local
> +symbol as previously done but we need to make sure that calls to actual
> +symbol always call the version of current object.
> +
> +bfd/Changelog:
> +
> +    * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
> +      in switch case R_OR1K_INSN_REL_26 where we need to check for
> +      !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + bfd/elf32-or1k.c | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
> +index 4ae7f324d33..4f9092539f5 100644
> +--- a/bfd/elf32-or1k.c
> ++++ b/bfd/elf32-or1k.c
> +@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
> +      break;
> + 
> +    case R_OR1K_INSN_REL_26:
> ++      /* For a non-shared link, these will reference plt or call the
> ++         version of actual object.  */
> ++      if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
> ++        {
> ++          _bfd_error_handler
> ++        (_("%pB: pc-relative relocation against dynamic symbol %s"),
> ++         input_bfd, name);
> ++          ret_val = FALSE;
> ++          bfd_set_error (bfd_error_bad_value);
> ++        }
> ++      break;
> ++
> +    case R_OR1K_PCREL_PG21:
> +    case R_OR1K_LO13:
> +    case R_OR1K_SLO13:
> +-- 
> +2.25.1
> +
> diff --git a/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch b/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> new file mode 100644
> index 0000000000..585b97b2af
> --- /dev/null
> +++ b/package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> @@ -0,0 +1,59 @@
> +From 9af93e143a7fbdb75aa1ed37277f9250eb111628 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +Date: Sat, 10 Jul 2021 17:57:34 +0200
> +Subject: [PATCH] or1k: fix pc-relative relocation against dynamic on PC
> + relative 26 bit relocation
> +
> +When building openal we were seeing the assert failure:
> +
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePausev
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceStopv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourceRewindv
> +/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> +pc-relative relocation against dynamic symbol alSourcePlayv
> +collect2: error: ld returned 1 exit status
> +
> +This happens because in R_OR1K_INSN_REL_26 case we can't reference local
> +symbol as previously done but we need to make sure that calls to actual
> +symbol always call the version of current object.
> +
> +bfd/Changelog:
> +
> +    * elf32-or1k.c (or1k_elf_relocate_section): use a separate entry
> +      in switch case R_OR1K_INSN_REL_26 where we need to check for
> +      !SYMBOL_CALLS_LOCAL() instead of !SYMBOL_REFERENCES_LOCAL().
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> +---
> + bfd/elf32-or1k.c | 12 ++++++++++++
> + 1 file changed, 12 insertions(+)
> +
> +diff --git a/bfd/elf32-or1k.c b/bfd/elf32-or1k.c
> +index 4ae7f324d33..4f9092539f5 100644
> +--- a/bfd/elf32-or1k.c
> ++++ b/bfd/elf32-or1k.c
> +@@ -1543,6 +1543,18 @@ or1k_elf_relocate_section (bfd *output_bfd,
> +      break;
> + 
> +    case R_OR1K_INSN_REL_26:
> ++      /* For a non-shared link, these will reference plt or call the
> ++         version of actual object.  */
> ++      if (bfd_link_pic (info) && !SYMBOL_CALLS_LOCAL (info, h))
> ++        {
> ++          _bfd_error_handler
> ++        (_("%pB: pc-relative relocation against dynamic symbol %s"),
> ++         input_bfd, name);
> ++          ret_val = FALSE;
> ++          bfd_set_error (bfd_error_bad_value);
> ++        }
> ++      break;
> ++
> +    case R_OR1K_PCREL_PG21:
> +    case R_OR1K_LO13:
> +    case R_OR1K_SLO13:
> +-- 
> +2.25.1
> +
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210716/d3209ead/attachment-0002.html>

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

* [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
  2021-07-12 10:45 ` [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc Giulio Benetti
  2021-07-16 14:14     ` Giulio Benetti
@ 2021-07-16 20:52   ` Thomas Petazzoni
  2021-07-17  0:27     ` Giulio Benetti
  2021-08-03  9:13   ` Peter Korsgaard
  2 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2021-07-16 20:52 UTC (permalink / raw)
  To: buildroot

On Mon, 12 Jul 2021 12:45:01 +0200
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> When building openal we were seeing the assert failure:
> 
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourcePausev
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourceStopv
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourceRewindv
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
> pc-relative relocation against dynamic symbol alSourcePlayv
> collect2: error: ld returned 1 exit status
> 
> So add patches to fix this binutils assert link failure on OpenRisc.
> It's been suggested upstream and it's pending here:
> https://sourceware.org/pipermail/binutils/2021-July/117334.html
> 
> Fixes:
> http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> ---
>  ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>  ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>  ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>  ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>  4 files changed, 236 insertions(+)
>  create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>  create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>  create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>  create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch

Wow, thanks a lot for this work! Really amazing that you've been able
to push this through!

Applied to master, of course!

Thanks again,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
  2021-07-16 20:52   ` Thomas Petazzoni
@ 2021-07-17  0:27     ` Giulio Benetti
  2021-07-17  0:28       ` Giulio Benetti
  0 siblings, 1 reply; 10+ messages in thread
From: Giulio Benetti @ 2021-07-17  0:27 UTC (permalink / raw)
  To: buildroot


> Il giorno 16 lug 2021, alle ore 22:53, Thomas Petazzoni <thomas.petazzoni@bootlin.com> ha scritto:
> 
> ?On Mon, 12 Jul 2021 12:45:01 +0200
> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
> 
>> When building openal we were seeing the assert failure:
>> 
>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>> pc-relative relocation against dynamic symbol alSourcePausev
>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>> pc-relative relocation against dynamic symbol alSourceStopv
>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>> pc-relative relocation against dynamic symbol alSourceRewindv
>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>> pc-relative relocation against dynamic symbol alSourcePlayv
>> collect2: error: ld returned 1 exit status
>> 
>> So add patches to fix this binutils assert link failure on OpenRisc.
>> It's been suggested upstream and it's pending here:
>> https://sourceware.org/pipermail/binutils/2021-July/117334.html
>> 
>> Fixes:
>> http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/
>> 
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>> 4 files changed, 236 insertions(+)
>> create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>> create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>> create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>> create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
> 
> Wow, thanks a lot for this work! Really amazing that you've been able
> to push this through!

I?m very happy about this. Fortunately I?ve suggested what to do on binutils otherwise it could take months :-) 

Giulio

> 
> Applied to master, of course!
> 
> Thanks again,
> 
> Thomas
> -- 
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

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

* [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
  2021-07-17  0:27     ` Giulio Benetti
@ 2021-07-17  0:28       ` Giulio Benetti
  2021-07-17  0:40           ` Giulio Benetti
  0 siblings, 1 reply; 10+ messages in thread
From: Giulio Benetti @ 2021-07-17  0:28 UTC (permalink / raw)
  To: buildroot



Inviato da iPhone

> Il giorno 17 lug 2021, alle ore 02:27, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
> 
> ?
>> Il giorno 16 lug 2021, alle ore 22:53, Thomas Petazzoni <thomas.petazzoni@bootlin.com> ha scritto:
>> 
>> ?On Mon, 12 Jul 2021 12:45:01 +0200
>> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
>> 
>>> When building openal we were seeing the assert failure:
>>> 
>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>> pc-relative relocation against dynamic symbol alSourcePausev
>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>> pc-relative relocation against dynamic symbol alSourceStopv
>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>> pc-relative relocation against dynamic symbol alSourceRewindv
>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>> pc-relative relocation against dynamic symbol alSourcePlayv
>>> collect2: error: ld returned 1 exit status
>>> 
>>> So add patches to fix this binutils assert link failure on OpenRisc.
>>> It's been suggested upstream and it's pending here:
>>> https://sourceware.org/pipermail/binutils/2021-July/117334.html
>>> 
>>> Fixes:
>>> http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/
>>> 
>>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>>> ---
>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>> 4 files changed, 236 insertions(+)
>>> create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>> create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>> create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>> create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>> 
>> Wow, thanks a lot for this work! Really amazing that you've been able
>> to push this through!
> 
> I?m very happy about this. Fortunately I?ve

*been* suggested

> suggested what to do on binutils otherwise it could take months :-) 
> 
> Giulio
> 
>> 
>> Applied to master, of course!
>> 
>> Thanks again,
>> 
>> Thomas
>> -- 
>> Thomas Petazzoni, CTO, Bootlin
>> Embedded Linux and Kernel engineering
>> https://bootlin.com

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

* [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
@ 2021-07-17  0:40           ` Giulio Benetti
  0 siblings, 0 replies; 10+ messages in thread
From: Giulio Benetti @ 2021-07-17  0:40 UTC (permalink / raw)
  To: buildroot

Ah, last thing,

> Il giorno 17 lug 2021, alle ore 02:28, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
> 
> ?
> 
> Inviato da iPhone
> 
>> Il giorno 17 lug 2021, alle ore 02:27, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
>> 
>> ?
>>>> Il giorno 16 lug 2021, alle ore 22:53, Thomas Petazzoni <thomas.petazzoni@bootlin.com> ha scritto:
>>> 
>>> ?On Mon, 12 Jul 2021 12:45:01 +0200
>>> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
>>> 
>>>> When building openal we were seeing the assert failure:
>>>> 
>>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>>> pc-relative relocation against dynamic symbol alSourcePausev
>>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>>> pc-relative relocation against dynamic symbol alSourceStopv
>>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>>> pc-relative relocation against dynamic symbol alSourceRewindv
>>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>>> pc-relative relocation against dynamic symbol alSourcePlayv
>>>> collect2: error: ld returned 1 exit status
>>>> 
>>>> So add patches to fix this binutils assert link failure on OpenRisc.
>>>> It's been suggested upstream and it's pending here:
>>>> https://sourceware.org/pipermail/binutils/2021-July/117334.html
>>>> 
>>>> Fixes:
>>>> http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/
>>>> 
>>>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>>>> ---
>>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>>> 4 files changed, 236 insertions(+)
>>>> create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>>> create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>>> create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>>> create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>> 
>>> Wow, thanks a lot for this work! Really amazing that you've been able
>>> to push this through!

Probably you know, but for having all OpenRiac toolchain bug free we need this patch applied:

https://patchwork.ozlabs.org/project/buildroot/patch/20210609162753.1138390-1-giulio.benetti at benettiengineering.com/

Best regards

Giulio

>> 
>> I?m very happy about this. Fortunately I?ve
> 
> *been* suggested
> 
>> suggested what to do on binutils otherwise it could take months :-) 
>> 
>> Giulio
>> 
>>> 
>>> Applied to master, of course!
>>> 
>>> Thanks again,
>>> 
>>> Thomas
>>> -- 
>>> Thomas Petazzoni, CTO, Bootlin
>>> Embedded Linux and Kernel engineering
>>> https://bootlin.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210717/b3f9c734/attachment-0001.html>

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

* [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
@ 2021-07-17  0:40           ` Giulio Benetti
  0 siblings, 0 replies; 10+ messages in thread
From: Giulio Benetti @ 2021-07-17  0:40 UTC (permalink / raw)
  To: buildroot

Ah, last thing,

> Il giorno 17 lug 2021, alle ore 02:28, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
> 
> ?
> 
> Inviato da iPhone
> 
>> Il giorno 17 lug 2021, alle ore 02:27, Giulio Benetti <giulio.benetti@benettiengineering.com> ha scritto:
>> 
>> ?
>>>> Il giorno 16 lug 2021, alle ore 22:53, Thomas Petazzoni <thomas.petazzoni@bootlin.com> ha scritto:
>>> 
>>> ?On Mon, 12 Jul 2021 12:45:01 +0200
>>> Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:
>>> 
>>>> When building openal we were seeing the assert failure:
>>>> 
>>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>>> pc-relative relocation against dynamic symbol alSourcePausev
>>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>>> pc-relative relocation against dynamic symbol alSourceStopv
>>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>>> pc-relative relocation against dynamic symbol alSourceRewindv
>>>> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld: CMakeFiles/OpenAL.dir/al/source.cpp.o:
>>>> pc-relative relocation against dynamic symbol alSourcePlayv
>>>> collect2: error: ld returned 1 exit status
>>>> 
>>>> So add patches to fix this binutils assert link failure on OpenRisc.
>>>> It's been suggested upstream and it's pending here:
>>>> https://sourceware.org/pipermail/binutils/2021-July/117334.html
>>>> 
>>>> Fixes:
>>>> http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/
>>>> 
>>>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>>>> ---
>>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>>> ...tive-relocation-against-dynamic-on-P.patch | 59 +++++++++++++++++++
>>>> 4 files changed, 236 insertions(+)
>>>> create mode 100644 package/binutils/2.32/0015-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>>> create mode 100644 package/binutils/2.34/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>>> create mode 100644 package/binutils/2.35.2/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>>> create mode 100644 package/binutils/2.36.1/0008-or1k-fix-pc-relative-relocation-against-dynamic-on-P.patch
>>> 
>>> Wow, thanks a lot for this work! Really amazing that you've been able
>>> to push this through!

Probably you know, but for having all OpenRiac toolchain bug free we need this patch applied:

https://patchwork.ozlabs.org/project/buildroot/patch/20210609162753.1138390-1-giulio.benetti at benettiengineering.com/

Best regards

Giulio

>> 
>> I?m very happy about this. Fortunately I?ve
> 
> *been* suggested
> 
>> suggested what to do on binutils otherwise it could take months :-) 
>> 
>> Giulio
>> 
>>> 
>>> Applied to master, of course!
>>> 
>>> Thanks again,
>>> 
>>> Thomas
>>> -- 
>>> Thomas Petazzoni, CTO, Bootlin
>>> Embedded Linux and Kernel engineering
>>> https://bootlin.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210717/b3f9c734/attachment-0002.html>

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

* Re: [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc
  2021-07-12 10:45 ` [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc Giulio Benetti
  2021-07-16 14:14     ` Giulio Benetti
  2021-07-16 20:52   ` Thomas Petazzoni
@ 2021-08-03  9:13   ` Peter Korsgaard
  2 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2021-08-03  9:13 UTC (permalink / raw)
  To: Giulio Benetti; +Cc: Romain Naour, Thomas Petazzoni, buildroot

>>>>> "Giulio" == Giulio Benetti <giulio.benetti@benettiengineering.com> writes:

 > When building openal we were seeing the assert failure:
 > /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
 > CMakeFiles/OpenAL.dir/al/source.cpp.o:
 > pc-relative relocation against dynamic symbol alSourcePausev
 > /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
 > CMakeFiles/OpenAL.dir/al/source.cpp.o:
 > pc-relative relocation against dynamic symbol alSourceStopv
 > /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
 > CMakeFiles/OpenAL.dir/al/source.cpp.o:
 > pc-relative relocation against dynamic symbol alSourceRewindv
 > /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/or1k-buildroot-linux-uclibc/9.3.0/../../../../or1k-buildroot-linux-uclibc/bin/ld:
 > CMakeFiles/OpenAL.dir/al/source.cpp.o:
 > pc-relative relocation against dynamic symbol alSourcePlayv
 > collect2: error: ld returned 1 exit status

 > So add patches to fix this binutils assert link failure on OpenRisc.
 > It's been suggested upstream and it's pending here:
 > https://sourceware.org/pipermail/binutils/2021-July/117334.html

 > Fixes:
 > http://autobuild.buildroot.net/results/c96/c96f2600f227d6c76114b9fbc41f74a57e40415a/

 > Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

Committed to 2021.02.x and 2021.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

end of thread, other threads:[~2021-08-03  9:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12 10:45 [Buildroot] [PATCH 0/1] Fix last OpenRisc binutils bug Giulio Benetti
2021-07-12 10:45 ` [Buildroot] [PATCH 1/1] package/binutils: fix linker assert on OpenRisc Giulio Benetti
2021-07-16 14:14   ` Giulio Benetti
2021-07-16 14:14     ` Giulio Benetti
2021-07-16 20:52   ` Thomas Petazzoni
2021-07-17  0:27     ` Giulio Benetti
2021-07-17  0:28       ` Giulio Benetti
2021-07-17  0:40         ` Giulio Benetti
2021-07-17  0:40           ` Giulio Benetti
2021-08-03  9:13   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.