Thanks everyone for your valuable suggestions! A new diff follows...
On Tue, 9 May 2017, Stuart Henderson wrote: > On 2017/05/09 12:25, Juan Francisco Cantero Hurtado wrote: > > On Tue, May 09, 2017 at 11:24:27AM +1000, Jonathan Gray wrote: > > > On Mon, May 08, 2017 at 10:47:56PM +0200, Donovan Watteau wrote: > > > > Hi, > > > > > > > > ScummVM and ResidualVM share some code, and it looks like they > > > > trigger an old bug with GCC 4.2.1 on ppc. > > > > > > > > All the games having voices crash at startup on macppc, with what > > > > looks like some miscompiled code in audio/decoders/voc.cpp for > > > > ScummVM, and common/stream.cpp for ResidualVM. > > > > > > > > After some trial and error, it looks like this is a bug with > > > > -funit-at-a-time on GCC 4.2.1. I see this problem on macppc, > > > > but it could also happen on arm, judging by the following > > > > similar reports: > > > > http://www.smartmontools.org/ticket/219 > > > > https://gcc.gnu.org/ml/gcc-help/2010-11/msg00038.html > > > > > > I think you should only do this for powerpc for now, as > > > otherwise aarch64 has no chance of building. > > > > > > > With MODGCC4_ARCHS=${GCC3_ARCHS} ${GCC4_ARCHS}, the port will use clang > > on aarch64. > > But if you just change that, WANTLIB will be missing the c++ libs. IMHO, it should be MODGCC4's job to "fix" your current ${LIBCXX} for archs where the module is enabled... Other MODGCC4 C++ ports don't have any ${LIBCXX} (and probably miss aarch64), and other ports have both stdc++ and estdc++. I think the latter is the "best" trade-off at the moment. games/scummvm: Index: Makefile =================================================================== RCS file: /cvs/ports/games/scummvm/Makefile,v retrieving revision 1.68 diff -u -p -r1.68 Makefile --- Makefile 10 Apr 2017 11:46:19 -0000 1.68 +++ Makefile 9 May 2017 18:20:50 -0000 @@ -2,6 +2,7 @@ COMMENT= graphical adventure game interpreter V= 1.9.0 +REVISION= 0 DISTNAME= scummvm-${V} CATEGORIES= games x11 emulators MASTER_SITES= http://www.scummvm.org/frs/scummvm/${V}/ @@ -19,6 +20,12 @@ WANTLIB += theoradec z .if ${MACHINE_ARCH} == "i386" BUILD_DEPENDS= devel/nasm .endif + +# GCC 4.2.1 miscompiles this on at least ppc, so play safe and +# just use a newer compiler everywhere. +MODULES= gcc4 +MODGCC4_ARCHS= ${GCC3_ARCHS} ${GCC4_ARCHS} +MODGCC4_LANGS= c++ RUN_DEPENDS= devel/desktop-file-utils LIB_DEPENDS= audio/libmad \ games/residualvm: Index: Makefile =================================================================== RCS file: /cvs/ports/games/residualvm/Makefile,v retrieving revision 1.7 diff -u -p -r1.7 Makefile --- Makefile 10 Apr 2017 11:46:19 -0000 1.7 +++ Makefile 9 May 2017 18:22:45 -0000 @@ -3,9 +3,9 @@ COMMENT = interpreter for some LucasArts 3D games V = 0.2.1 +REVISION = 2 DISTNAME = residualvm-${V}-sources PKGNAME = residualvm-${V} -REVISION = 1 CATEGORIES = games @@ -29,6 +29,12 @@ LIB_DEPENDS = audio/libmad \ multimedia/libtheora RUN_DEPENDS = devel/desktop-file-utils \ x11/gtk+3,-guic + +# GCC 4.2.1 miscompiles this on at least ppc, so play safe and +# just use a newer compiler everywhere. +MODULES = gcc4 +MODGCC4_ARCHS = ${GCC3_ARCHS} ${GCC4_ARCHS} +MODGCC4_LANGS = c++ SEPARATE_BUILD = Yes USE_GMAKE = Yes