git: 9fb2d7b2e747 - main - emulators/mame: fix build on armv7

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Thu, 18 May 2023 08:20:42 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9fb2d7b2e7473d6bf8bb18d5e457ed4c7ac933df

commit 9fb2d7b2e7473d6bf8bb18d5e457ed4c7ac933df
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2023-05-16 23:36:32 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-05-18 08:19:48 +0000

    emulators/mame: fix build on armv7
    
    Mame fails to link on armv7 due to an address space exhaustion in lld.
    As a bandaid, tell lld to not generate symbols.  This frees up enough
    address space to make mame link.
    
    PR:             271374
    MFH:            2023Q2
    Approved by:    agh@riseup.net (maintainer)
---
 emulators/mame/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/emulators/mame/Makefile b/emulators/mame/Makefile
index aebdb69da8a3..d13f1e2cc8dd 100644
--- a/emulators/mame/Makefile
+++ b/emulators/mame/Makefile
@@ -84,6 +84,9 @@ MAKE_ENV+=	DEBUG="1" \
 		OPTIMIZE="0" \
 		PROFILER="1" \
 		SYMBOLS="1"
+.else
+# avoid address space exhaustion in linker on armv7
+LDFLAGS+=	-s
 .endif
 
 .if ${ARCH} == amd64 || ${ARCH:Mpowerpc64*}
@@ -160,11 +163,11 @@ post-patch:
 		 s| .(ARCH)||g' \
 		 ${WRKSRC}/makefile \
 		 ${GENIE}/build/gmake.bsd/genie.make
-	@${REINPLACE_CMD} -e 's|gcc|cc|; s|g++|c++|' \
+	@${REINPLACE_CMD} -e 's|gcc|${CC}|; s|g++|${CXX}|' \
 		${GENIE}/src/tools/gcc.lua \
 		${GENIE}/src/tools/snc.lua \
 		${GENIE}/tests/test_gmake_cpp.lua
-	@${REINPLACE_CMD} -e 's|= \"gcc|= \"cc|; s|= \"g++|= \"c++|' \
+	@${REINPLACE_CMD} -e 's|= \"gcc|= \"${CC}|; s|= \"g++|= \"${CXX}|' \
 		-e "s|'CXX =|'#CXX =|; s|'CC  =|'#CC  =|; s| .(ARCH)| |g" \
 		${GENIE}/src/host/scripts.c
 	@${GREP} -rl '"png.h"' ${WRKSRC}/src | \