Hi,

It was expected to happen one day :)

>From the current macppc bulk:

> obj/tiles/active_item_cache_test.o: In function 
> `::_ZL29____C_A_T_C_H____T_E_S_T__(void)':
> active_item_cache_test.cpp:(.text+0x1b4): relocation truncated to fit: 
> R_PPC_PLTREL24 [...]
> active_item_cache_test.cpp:(.text+0xcb4): additional relocation overflows 
> omitted from the output

The below diff allowed me to build CDDA [0].

Runtime test: it is slow, but OK.

LDFLAGS is empty and this version has never been built on macppc, so
REVISION bump is not needed.

Comments/feedback are welcome,

Charlène.


[0] https://bin.charlenew.xyz/cataclysm-dda-0.Fv0.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/games/cataclysm-dda/Makefile,v
retrieving revision 1.18
diff -u -p -u -p -r1.18 Makefile
--- Makefile    14 Jul 2021 03:50:15 -0000      1.18
+++ Makefile    27 Jul 2021 18:05:20 -0000
@@ -30,7 +30,7 @@ RUN_DEPENDS=          devel/desktop-file-utils \
 
 LIB_DEPENDS=           devel/gettext,-runtime
 
-MAKE_ENV=              CXX="${CXX}" CXXFLAGS="${CXXFLAGS}"
+MAKE_ENV=              CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}"
 
 MAKE_FLAGS=            ASTYLE=0 RELEASE=1 USE_XDG_DIR=1 \
                        LINTJSON=0 LANGUAGES=all
@@ -52,6 +52,12 @@ MAN_TILES=           -tiles
 USE_GMAKE=             Yes
 
 NO_TEST=               Yes
+
+# relocation truncated to fit: R_PPC_PLTREL24 -- to be removed once lld is the
+# default linker on powerpc
+.if ${MACHINE_ARCH} == "powerpc"
+LDFLAGS+=              -Wl,-relax
+.endif
 
 post-install:
        ${INSTALL_MAN} ${WRKSRC}/doc/cataclysm${MAN_TILES}.6 ${PREFIX}/man/man6/

Reply via email to