commit:     c2297ca51d38dff90e855f1f136ad6d944c87f88
Author:     Alexander Golubev <fatzer2 <AT> gmail <DOT> com>
AuthorDate: Thu Feb 19 08:25:56 2026 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Fri Feb 20 14:01:56 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2297ca5

dev-embedded/gputils: fix build with gcc-15/C23

Also some common housekeeping:
- update SRC_URI to avoid permanent redirect
- use ${PN} in patch names
- drop tc-ld-disable-gold due to gold is no longer supported and pkgdev
  complains about the function. The package builds fine with mold and
  lld.

Closes: https://bugs.gentoo.org/944881
Signed-off-by: Alexander Golubev <fatzer2 <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/45841
Closes: https://github.com/gentoo/gentoo/pull/45841
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 .../files/gputils-1.5.2-fix-build-with-C23.patch   | 39 +++++++++++++++++++
 dev-embedded/gputils/gputils-1.5.2-r1.ebuild       | 45 ++++++++++++++++++++++
 2 files changed, 84 insertions(+)

diff --git a/dev-embedded/gputils/files/gputils-1.5.2-fix-build-with-C23.patch 
b/dev-embedded/gputils/files/gputils-1.5.2-fix-build-with-C23.patch
new file mode 100644
index 000000000000..72b7db3158f0
--- /dev/null
+++ b/dev-embedded/gputils/files/gputils-1.5.2-fix-build-with-C23.patch
@@ -0,0 +1,39 @@
+Make the code C23-compatible
+
+Replace the enum-defined true/false constants with the default one. Also
+fix-up a function definition.
+
+Authour: Alexander Golubev (Fat-Zer) <[email protected]>
+Bug: https://bugs.gentoo.org/944881
+Source: A dedicated patch for Gentoo
+
+--- a/libgputils/gpcoffgen.h
++++ b/libgputils/gpcoffgen.h
+@@ -88,7 +88,7 @@ extern gp_reloc_t *gp_coffgen_add_reloc(gp_section_t 
*Section);
+ #define RELOC_DISABLE_WARN              (1 << 0)
+ #define RELOC_ENABLE_CINIT_WARN         (1 << 1)
+ 
+-extern void gp_coffgen_check_relocations(const gp_object_t *Object, unsigned 
int Behavior);
++extern void gp_coffgen_check_relocations(const gp_object_t *Object, 
gp_boolean Behavior);
+ 
+ extern gp_boolean gp_coffgen_del_reloc(gp_section_t *Section, gp_reloc_t 
*Relocation);
+ extern const char *gp_coffgen_reloc_type_to_str(uint16_t Type);
+--- a/libgputils/gptypes.h
++++ b/libgputils/gptypes.h
+@@ -26,10 +26,16 @@ Boston, MA 02111-1307, USA.  */
+ 
+ #include "stdhdr.h"
+ 
++/* C99 systems have <stdbool.h>. Non-C99 systems may or may not. */
++#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
++#include <stdbool.h>
++typedef int gp_boolean; /* use int rather than bool to keep ABI compatible 
with enum; replace with bool if you are bold */
++#else
+ typedef enum {
+   false = (0 == 1),
+   true  = (0 == 0)
+ } gp_boolean;
++#endif
+ 
+ typedef long    gp_symvalue_t;
+ 

diff --git a/dev-embedded/gputils/gputils-1.5.2-r1.ebuild 
b/dev-embedded/gputils/gputils-1.5.2-r1.ebuild
new file mode 100644
index 000000000000..ee74113dbe2e
--- /dev/null
+++ b/dev-embedded/gputils/gputils-1.5.2-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs flag-o-matic
+
+DESCRIPTION="Tools including assembler, linker and librarian for PIC 
microcontrollers"
+HOMEPAGE="https://gputils.sourceforge.io";
+SRC_URI="https://downloads.sourceforge.net/project/${PN}/${PN}/$(ver_cut 
1-2).0/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
+IUSE="doc"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-1.5.2-fix-invalid-operator.patch"
+       "${FILESDIR}/${PN}-1.5.2-fix-build-with-C23.patch"
+)
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_configure() {
+       # Their configure script tries to do funky things with default
+       # compiler selection.  Force our own defaults instead.
+       tc-export CC
+
+       # LTO currently causes various segfaults in dev-embedded/sdcc
+       # sys-devel/gcc-11.3.0 '-O3 -flto'
+       filter-lto
+
+       local myeconfargs=(
+               $(use_enable doc html-doc)
+       )
+       econf "${myeconfargs[@]}"
+}
+
+src_install() {
+       default
+       use doc && dodoc doc/gputils.pdf
+}

Reply via email to