git: ef0c6dcb3d07 - main - games/trigger-rally: fix build with lld 15 on i386

From: Alfonso S. Siciliano <asiciliano_at_FreeBSD.org>
Date: Wed, 01 Mar 2023 17:46:41 UTC
The branch main has been updated by asiciliano:

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

commit ef0c6dcb3d0725c090609342ce8239427d39ce3b
Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
AuthorDate: 2023-03-01 17:39:38 +0000
Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
CommitDate: 2023-03-01 17:46:10 +0000

    games/trigger-rally: fix build with lld 15 on i386
    
    ld: error: ../bin/trigger-rally:(.eh_frame+0xa40b): internal linker
    error: wrote incorrect addend value 0x4A042E4A instead of 0x0 for
    dynamic relocation R_386_32 at offset 0x429B53 against symbol
    __gxx_personality_v0
    
    PR:             269812
    Reported by:    pkg-fallout
    Approved by:    fernape
---
 games/trigger-rally/Makefile | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/games/trigger-rally/Makefile b/games/trigger-rally/Makefile
index 747b5404bdb5..ff6d08904240 100644
--- a/games/trigger-rally/Makefile
+++ b/games/trigger-rally/Makefile
@@ -34,6 +34,16 @@ PORTDOCS=	README-stereo.txt README.txt DATA_AUTHORS.txt
 
 OPTIONS_DEFINE=	DOCS
 
+.include <bsd.port.pre.mk>
+
+# The following is actually meant for lld 15.0 and later, but the ports
+# framework does not support LINKER_TYPE and LINKER_VERSION yet.
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 150
+# Turn off checking of dynamic relocations, to avoid lld diagnostics about
+# possibly incorrect addend values.
+LDFLAGS_i386+=	-Wl,--no-check-dynamic-relocations
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/Trigger/main.cpp
 
@@ -53,4 +63,4 @@ do-install:
 	${MV} ${STAGEDIR}${DATADIR}/icon/trigger-rally-icons.svg \
 		${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/trigger-rally-icons.svg
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>