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?

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"
+CFLAGS+=               -Umips
+.endif
+
 .include <bsd.port.mk>

Reply via email to