devel/gcc-arm-embedded: fix build with clang 21
With clang 21 devel/gcc-arm-embedded fails to build, with errors similar
to:
/wrkdirs/usr/ports/devel/gcc-arm-embedded/work-default/src/binutils-gdb/binutils/readelf.c:23278:37: error: pointer comparison always evaluates to false [-Werror,-Wtautological-compare]
23278 | || inote.namedata + inote.namesz < inote.namedata)
| ^and later many instances of:
In file included from <built-in>:1:
In file included from /wrkdirs/usr/ports/devel/gcc-arm-embedded/work-default/src/binutils-gdb--gdb/gdb/defs.h:63:
/wrkdirs/usr/ports/devel/gcc-arm-embedded/work-default/src/binutils-gdb--gdb/gdb/../gdbsupport/enum-flags.h:97:34: error: non-type
template argument is not a constant expression
97 | integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/devel/gcc-arm-embedded/work-default/src/binutils-gdb--gdb/gdb/../gdbsupport/enum-flags.h:134:20: note: in
instantiation of template class 'enum_underlying_type<ui_out_flag>' requested here
134 | typedef typename enum_underlying_type<enum_type>::type underlying_type;
| ^
/wrkdirs/usr/ports/devel/gcc-arm-embedded/work-default/src/binutils-gdb--gdb/gdb/ui-out.h:385:16: note: in instantiation of template
class 'enum_flags<ui_out_flag>' requested here
385 | ui_out_flags m_flags;
| ^
/wrkdirs/usr/ports/devel/gcc-arm-embedded/work-default/src/binutils-gdb--gdb/gdb/../gdbsupport/enum-flags.h:97:52: note: integer value
-1 is outside the valid range of values [0, 15] for the enumeration type 'ui_out_flag'
97 | integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type
| ^The readelf error is due to it assuming pointer wrapping, which is
undefined behavior. This can be worked around by casting the pointers to
uintptr_t, or by adding -fno-strict-overflow to the CFLAGS (but if you
are messing with the CFLAGS, you might as well disable -Werror).
The enum errors are because it is no longer allowed to cast integer
values to enum values, if they fall outside of the valid range. Upstream
fixed this in
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=4a0b2cb7210,
which applies with a small bit of editing.
PR: 293168
Approved by: maintainer timeout (2 weeks)
MFH: 2026Q1
(cherry picked from commit 37ed2bf6371b0b273013a710ee32f6addf768a62)