summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/flac/flac-1.2.1/0001-No-AltiVec-on-SPE.patch
blob: 5ca8b35142f3390ece9f58a979cbc2f7d6dad4d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Upstream-Status: Inappropriate [configuration]

From f9b017c2c958d968cc5dfd36dc68fc8e5fb89a58 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Fri, 11 Jun 2010 09:48:58 +0200
Subject: [PATCH] No AltiVec on SPE

Consider *gnuspe which matches powerpc-unknown-linux-gnuspe where
AltiVec is not available at all. This triplet uses SPE which is
incompatible with AltiVec shares the same opcode range and can't be used
at all.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 configure.in            |    8 ++++++++
 src/libFLAC/Makefile.am |   10 +++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index bfa6d8e..17b7c73 100644
--- a/configure.in
+++ b/configure.in
@@ -82,6 +82,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)
 
 # only needed because of ntohl() usage, can get rid of after that's gone:
 case "$host" in
diff --git a/src/libFLAC/Makefile.am b/src/libFLAC/Makefile.am
index cbfb0ac..5785372 100644
--- a/src/libFLAC/Makefile.am
+++ b/src/libFLAC/Makefile.am
@@ -40,8 +40,15 @@ 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
+if FLaC__USE_ALTIVEC
+CPUCFLAGS += -maltivec -mabi=altivec
+endif
+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@
 
-- 
1.5.6.5