summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Golubev <fatzer2@gmail.com>2026-02-22 04:15:03 +0300
committerFat-Zer <fatzer2@gmail.com>2026-02-22 05:00:26 +0000
commit7274f0cec1be62b8b819f2dbb7e7a0017be4a725 (patch)
tree9233df1242651809d8cdd2e9038d98d23fa90661
parent15d873519d97bb364c303932802a799abb6f1536 (diff)
downloadtde-packaging-gentoo-master.tar.gz
tde-packaging-gentoo-master.zip
dev-libs/libr: fix build with binutils-2.45 & 2.45HEADmaster
Closes: https://mirror.git.trinitydesktop.org/gitea/TDE/tde-packaging-gentoo/issues/465 Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
-rw-r--r--dev-libs/libr/files/libr-14.1.4-Update-for-API-change-in-binutils-2.45.patch79
-rw-r--r--dev-libs/libr/files/libr-14.1.5-Update-for-API-change-in-binutils-2.46.patch73
-rw-r--r--dev-libs/libr/libr-14.1.4.ebuild7
-rw-r--r--dev-libs/libr/libr-14.1.5.ebuild4
4 files changed, 162 insertions, 1 deletions
diff --git a/dev-libs/libr/files/libr-14.1.4-Update-for-API-change-in-binutils-2.45.patch b/dev-libs/libr/files/libr-14.1.4-Update-for-API-change-in-binutils-2.45.patch
new file mode 100644
index 00000000..94790c02
--- /dev/null
+++ b/dev-libs/libr/files/libr-14.1.4-Update-for-API-change-in-binutils-2.45.patch
@@ -0,0 +1,79 @@
+From 2ef4ae411f630affb53a709e090d05c43ee7b1c6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <slavek.banko@axis.cz>
+Date: Tue, 5 Aug 2025 01:43:24 +0200
+Subject: [PATCH 1/2] Update for API change in binutils 2.45. Simplify binutils
+ version definitions.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
+(cherry picked from commit c57eae31615bc70072c7e99d712c2285817bd2e5)
+(cherry picked from commit 8380fc26a471d64bcddc38a2bce9442f6386b805)
+---
+ CMakeLists.txt | 9 ++++++++-
+ src/config.h.cmake | 3 +++
+ src/libr-bfd.c | 8 +++++++-
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ba522b1..f7f489d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,6 +28,7 @@ set( PACKAGE_VERSION 0.7.0 )
+
+ include( FindPkgConfig )
+ include( FindThreads )
++include( CheckCSourceCompiles )
+ include( CheckIncludeFile )
+ include( CheckFunctionExists )
+ include( CheckLibraryExists )
+@@ -66,8 +67,14 @@ if( WITH_BACKEND_LIBBFD )
+ endif( NOT HAVE_BFD_H )
+ tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "bfd" )
+ check_symbol_exists( bfd_asymbol_section bfd.h HAVE_BFD_2_34 )
+- tde_restore( CMAKE_REQUIRED_DEFINITIONS )
++ check_c_source_compiles(
++ "#include <bfd.h>
++ int main() { bfd *ihandle, *ohandle; asection *iscn, *oscn;
++ bfd_copy_private_section_data(ihandle, iscn, ohandle, oscn, NULL);
++ }"
++ HAVE_BFD_2_45)
+ tde_restore( CMAKE_REQUIRED_LIBRARIES )
++ tde_restore( CMAKE_REQUIRED_DEFINITIONS )
+ set( BACKEND_LIBRARIES "-lbfd" )
+ set( LIBR_BACKEND "bfd" )
+ set( BACKEND_NAME "libbfd" )
+diff --git a/src/config.h.cmake b/src/config.h.cmake
+index 34fe955..e2673d2 100644
+--- a/src/config.h.cmake
++++ b/src/config.h.cmake
+@@ -10,3 +10,6 @@
+
+ /* Define to 1 if you have Binutils >= 2.34 */
+ #cmakedefine HAVE_BFD_2_34 1
++
++/* Define to 1 if you have Binutils >= 2.45 */
++#cmakedefine HAVE_BFD_2_45 1
+diff --git a/src/libr-bfd.c b/src/libr-bfd.c
+index 53e8aee..9d72cce 100644
+--- a/src/libr-bfd.c
++++ b/src/libr-bfd.c
+@@ -240,7 +240,13 @@ int setup_sections(bfd *ihandle, bfd *ohandle)
+ oscn->entsize = iscn->entsize;
+ iscn->output_section = oscn;
+ iscn->output_offset = vma;
+- if(!bfd_copy_private_section_data(ihandle, iscn, ohandle, oscn))
++ if(
++ #ifdef HAVE_BFD_2_45
++ !bfd_copy_private_section_data(ihandle, iscn, ohandle, oscn, NULL)
++ #else
++ !bfd_copy_private_section_data(ihandle, iscn, ohandle, oscn)
++ #endif
++ )
+ {
+ printf("failed to compute section alignment: %s\n", bfd_errmsg(bfd_get_error()));
+ return false;
+--
+2.52.0
+
diff --git a/dev-libs/libr/files/libr-14.1.5-Update-for-API-change-in-binutils-2.46.patch b/dev-libs/libr/files/libr-14.1.5-Update-for-API-change-in-binutils-2.46.patch
new file mode 100644
index 00000000..ec44486e
--- /dev/null
+++ b/dev-libs/libr/files/libr-14.1.5-Update-for-API-change-in-binutils-2.46.patch
@@ -0,0 +1,73 @@
+From 6ac41e2f0ba06d6ba49326b5b7460c0e4bc1d7ff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= <slavek.banko@axis.cz>
+Date: Sun, 25 Jan 2026 18:29:16 +0100
+Subject: [PATCH] Update for API change in binutils 2.46.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+According to the commit message in binutils, it was a simple renaming
+of `*_set_reloc` to `*_finalize_section_relocs` without changing the
+functionality.
+
+Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
+(cherry picked from commit b471c5f6213db85a3ac35e98a0a1054dc9eb9ad3)
+---
+ CMakeLists.txt | 1 +
+ src/config.h.cmake | 3 +++
+ src/libr-bfd.c | 10 ++++++++++
+ 3 files changed, 14 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f7f489d..3eb7384 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -73,6 +73,7 @@ if( WITH_BACKEND_LIBBFD )
+ bfd_copy_private_section_data(ihandle, iscn, ohandle, oscn, NULL);
+ }"
+ HAVE_BFD_2_45)
++ check_symbol_exists( bfd_finalize_section_relocs bfd.h HAVE_BFD_2_46 )
+ tde_restore( CMAKE_REQUIRED_LIBRARIES )
+ tde_restore( CMAKE_REQUIRED_DEFINITIONS )
+ set( BACKEND_LIBRARIES "-lbfd" )
+diff --git a/src/config.h.cmake b/src/config.h.cmake
+index e2673d2..bf6d3e7 100644
+--- a/src/config.h.cmake
++++ b/src/config.h.cmake
+@@ -13,3 +13,6 @@
+
+ /* Define to 1 if you have Binutils >= 2.45 */
+ #cmakedefine HAVE_BFD_2_45 1
++
++/* Define to 1 if you have Binutils >= 2.46 */
++#cmakedefine HAVE_BFD_2_46 1
+diff --git a/src/libr-bfd.c b/src/libr-bfd.c
+index 9d72cce..b472543 100644
+--- a/src/libr-bfd.c
++++ b/src/libr-bfd.c
+@@ -320,12 +320,22 @@ int build_output(libr_file *file_handle)
+ oscn = iscn->output_section;
+ reloc_size = bfd_get_reloc_upper_bound(ihandle, iscn);
+ if(reloc_size == 0)
++ {
++ #ifdef HAVE_BFD_2_46
++ bfd_finalize_section_relocs(ohandle, oscn, NULL, 0);
++ #else
+ bfd_set_reloc(ohandle, oscn, NULL, 0);
++ #endif
++ }
+ else
+ {
+ reloc_buffer = malloc(reloc_size);
+ reloc_count = bfd_canonicalize_reloc(ihandle, iscn, reloc_buffer, symtab_buffer);
++ #ifdef HAVE_BFD_2_46
++ bfd_finalize_section_relocs(ohandle, oscn, reloc_buffer, reloc_count);
++ #else
+ bfd_set_reloc(ohandle, oscn, reloc_buffer, reloc_count);
++ #endif
+ }
+
+ if(
+--
+2.52.0
+
diff --git a/dev-libs/libr/libr-14.1.4.ebuild b/dev-libs/libr/libr-14.1.4.ebuild
index 46d443f6..985ff9b0 100644
--- a/dev-libs/libr/libr-14.1.4.ebuild
+++ b/dev-libs/libr/libr-14.1.4.ebuild
@@ -1,5 +1,5 @@
# Copyright 1999-2024 Gentoo Authors
-# Copyright 2020-2025 The Trinity Desktop Project
+# Copyright 2020-2026 The Trinity Desktop Project
# Distributed under the terms of the GNU General Public License v2
EAPI="8"
@@ -31,6 +31,11 @@ DEPEND="${RDEPEND}
# NOTE: gtk uses weak linkage, so it's not necessary during runtime
BDEPEND="man? ( app-text/doxygen )"
+PATCHES=(
+ "${FILESDIR}/${P}-Update-for-API-change-in-binutils-2.45.patch"
+ "${FILESDIR}/${PN}-14.1.5-Update-for-API-change-in-binutils-2.46.patch"
+)
+
pkg_pretend() {
if ! use bfd && ! use elf; then
ewarn "You haven't selected nor \"bfd\" nor \"elf\" as a backend"
diff --git a/dev-libs/libr/libr-14.1.5.ebuild b/dev-libs/libr/libr-14.1.5.ebuild
index 6ded42bb..409c458c 100644
--- a/dev-libs/libr/libr-14.1.5.ebuild
+++ b/dev-libs/libr/libr-14.1.5.ebuild
@@ -31,6 +31,10 @@ DEPEND="${RDEPEND}
# NOTE: gtk uses weak linkage, so it's not necessary during runtime
BDEPEND="man? ( app-text/doxygen )"
+PATCHES=(
+ "${FILESDIR}/${P}-Update-for-API-change-in-binutils-2.46.patch"
+)
+
pkg_pretend() {
if ! use bfd && ! use elf; then
ewarn "You haven't selected nor \"bfd\" nor \"elf\" as a backend"