Disable Altivec on host triplet powerpc-unknown-linux-gnuspe.
authorErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 13 Feb 2012 08:46:32 +0000 (19:46 +1100)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Mon, 13 Feb 2012 08:46:32 +0000 (19:46 +1100)
SPE is incompatible with AltiVec because it shares the same opcode range.

Patch from Sebastian Andrzej Siewior <bigeasy@linutronix.de> via Debian.

configure.ac
src/libFLAC/Makefile.am

index 549024a..63a0984 100644 (file)
@@ -112,6 +112,14 @@ case "$host" in
        *) OBJ_FORMAT=elf ;;
 esac
 AC_SUBST(OBJ_FORMAT)
+case "$host" in
+       *-gnuspe)
+               abi_spe=true
+               AC_DEFINE(FLAC__CPU_PPC_SPE)
+               AH_TEMPLATE(FLAC__CPU_PPC_SPE, [define if building for PowerPC with SPE ABI])
+               ;;
+esac
+AM_CONDITIONAL(FLaC__CPU_PPC_SPE, test "x$abi_spe" = xtrue)
 
 case "$host" in
        *-*-cygwin|*mingw*|*emx*)
index 636d4ab..2deb958 100644 (file)
@@ -40,8 +40,13 @@ if FLaC__SYS_DARWIN
 CPUCFLAGS = -faltivec -force_cpusubtype_ALL -DFLAC__NO_ASM
 else
 # Linux-gcc for PPC does not have -force_cpusubtype_ALL, it is Darwin-specific
+CPUCFLAGS =
+if FLaC__CPU_PPC_SPE
+else
+CPUCFLAGS += -maltivec -mabi=altivec
+endif
 #@@@ PPC optimizations temporarily disabled
-CPUCFLAGS = -maltivec -mabi=altivec -DFLAC__NO_ASM
+CPUCFLAGS += -DFLAC__NO_ASM
 endif
 endif
 
@@ -58,6 +63,8 @@ endif
 if FLaC__CPU_PPC
 ARCH_SUBDIRS = ppc
 if FLaC__HAS_AS__TEMPORARILY_DISABLED
+if FLaC__CPU_PPC_SPE
+else
 LOCAL_EXTRA_LIBADD = ppc/as/libFLAC-asm.la
 LOCAL_EXTRA_LDFLAGS = "-Wl,-read_only_relocs,warning"
 else
@@ -68,6 +75,7 @@ endif
 endif
 endif
 endif
+endif
 
 libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@