On Fri, 11 Jun 2021 19:13:46 +0000
Charlene Wendling <[email protected]> wrote:

> Hi,
> 
> As reported in the fediverse, sdl2 generates SIGILL on Mac G3s [0].
> 
> sdl2 is built with AltiVec support, runtime detection is present and
> valid (see $WRKSRC/src/cpuinfo/SDL_cpuinfo.c), yet failing. So the
> simple solution is to remove AltiVec from the build for now.
> 
> I've tested this on my PowerBook G4 against ffplay, mpv,
> openttd and scummvm, without issues.
> 
> I've also tested successfully these ports on my Mac Mini G4, but this
> time, using a kernel without the ALTIVEC option.
> 
> OK?

ok gkoehler@

SDL-1.x (devel/sdl) might need the same --enable-altivec=no fix, but
I didn't try it.

SDL was using ${CC} -maltivec, so it's altivec blitter can use
<altivec.h> operations.  The problem is that ${CC} -maltivec can also
optimize any *.c code with altivec.  (graphics/ffmpeg had the same
problem when we tried to enable altivec.)

Later, one might try to enable altivec again by moving the altivec
blitter to a separate file, and compiling only that file with
-maltivec (as xenocara/lib/pixman does now).

--George

> Charlène.
> 
> 
> [0] https://empty.cafe/@will/106329827929064693
> 
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/sdl2/Makefile,v
> retrieving revision 1.34
> diff -u -p -u -p -r1.34 Makefile
> --- Makefile  23 Jan 2021 17:47:43 -0000      1.34
> +++ Makefile  11 Jun 2021 19:07:43 -0000
> @@ -5,7 +5,7 @@ COMMENT=      cross-platform multimedia libra
>  V=           2.0.14
>  DISTNAME=    SDL2-${V}
>  PKGNAME=     sdl2-${V}
> -REVISION=    1
> +REVISION=    2
>  CATEGORIES=  devel
>  MASTER_SITES=        https://www.libsdl.org/release/
>  
> @@ -50,6 +50,13 @@ CONFIGURE_ENV+=    CPPFLAGS="-I${LOCALBASE}
>  
>  .if ${MACHINE_ARCH} == "hppa"
>  CONFIGURE_ARGS+= --disable-atomic
> +.endif
> +
> +# The assembly code contains AltiVec instructions, whose support is not
> +# properly detected at runtime. Fix SIGILLs on macppc G3s, while keeping
> +# it for powerpc64.
> +.if ${MACHINE_ARCH} == "powerpc"
> +CONFIGURE_ARGS+= --enable-altivec=no
>  .endif
>  
>  # tests in test subdir, but interactive and not hooked up to build
> 
> 
> 
> 


-- 
George Koehler <[email protected]>

Reply via email to