git: 9064a6d5dadb - 2023Q2 - emulators/mame: fix build on armv7

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

URL: https://cgit.FreeBSD.org/ports/commit/?id=9064a6d5dadb703432cccee830b381102205b340

commit 9064a6d5dadb703432cccee830b381102205b340
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:22:19 +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)
    
    (cherry picked from commit 9fb2d7b2e7473d6bf8bb18d5e457ed4c7ac933df)
---
 emulators/mame/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/emulators/mame/Makefile b/emulators/mame/Makefile
index 26c2b886b6a9..c2a975d1d698 100644
--- a/emulators/mame/Makefile
+++ b/emulators/mame/Makefile
@@ -80,6 +80,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*}
@@ -172,11 +175,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 | ${XARGS} ${REINPLACE_CMD} \