On Mon, Aug 24 2020, Visa Hankala <[email protected]> wrote:
> Build of devel/cgdb fails on mips64:
>
> /pobj/cgdb-0.7.1/cgdb-0.7.1/lib/tgdb/gdbwire.c:1692:24: error: expected member
> name or ';' after declaration specifiers
> gdbwire_mi_pstate *mips;
> ~~~~~~~~~~~~~~~~~ ^
> <built-in>:310:14: note: expanded from here
> #define mips 1
> ^
>
> `mips' is one of the platform's builtin macros that GCC 4.2.1 has
> defined when in GNU C mode. This has been carried to clang.
>
> The patch below works around the issue by undefining the macro. This
> helps at least when building on octeon.
>
> OK?
ok jca@, suggestion below
> Index: Makefile
> ===================================================================
> RCS file: ports/devel/cgdb/Makefile,v
> retrieving revision 1.11
> diff -u -p -r1.11 Makefile
> --- Makefile 11 Nov 2019 20:08:25 -0000 1.11
> +++ Makefile 24 Aug 2020 14:44:54 -0000
> @@ -29,4 +29,8 @@ CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/
>
> AUTOCONF_VERSION= 2.69
>
> +.if ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el"
Maybe add a comment like
# Avoid clash with identifier in source code
> +CFLAGS+= -Umips
> +.endif
> +
> .include <bsd.port.mk>
>
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE