Skip to content

Commit 0d7ef9d

Browse files
committed
fdk-aac: fix compilation with powerpc64
Backported upstream patch. Signed-off-by: Rosen Penev <[email protected]>
1 parent 26ceccc commit 0d7ef9d

File tree

3 files changed

+131
-1
lines changed

3 files changed

+131
-1
lines changed

sound/fdk-aac/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
77

88
PKG_NAME:=fdk-aac
99
PKG_VERSION:=2.0.1
10-
PKG_RELEASE:=4
10+
PKG_RELEASE:=5
1111

1212
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
1313
PKG_SOURCE_URL:=https://codeload.github.com/mstorsjo/fdk-aac/tar.gz/v$(PKG_VERSION)?
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
From 7f328b93ee2aa8bb4e94613b6ed218e7525d8dc0 Mon Sep 17 00:00:00 2001
2+
From: David Seifert <[email protected]>
3+
Date: Sat, 10 Jul 2021 13:06:57 +0200
4+
Subject: [PATCH] Do not force inlining of indirect functions
5+
6+
* A function called indirectly cannot be decorated
7+
with `__attribute((always_inline))`, as this is
8+
guaranteed to only work with direct calls:
9+
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63220#c1
10+
11+
Bug: https://bugs.gentoo.org/798045
12+
---
13+
libFDK/include/fft.h | 4 ++--
14+
libFDK/src/fft.cpp | 6 +++---
15+
2 files changed, 5 insertions(+), 5 deletions(-)
16+
17+
--- a/libFDK/include/fft.h
18+
+++ b/libFDK/include/fft.h
19+
@@ -139,7 +139,7 @@ void ifft(int length, FIXP_DBL *pInput,
20+
* bit scale headroom. The values are interleaved, real/imag pairs.
21+
*/
22+
LNK_SECTION_CODE_L1
23+
-static FDK_FORCEINLINE void fft_4(FIXP_DBL *x) {
24+
+static inline void fft_4(FIXP_DBL *x) {
25+
FIXP_DBL a00, a10, a20, a30, tmp0, tmp1;
26+
27+
a00 = (x[0] + x[4]) >> 1; /* Re A + Re B */
28+
@@ -168,7 +168,7 @@ static FDK_FORCEINLINE void fft_4(FIXP_D
29+
30+
#ifndef FUNCTION_fft_8
31+
LNK_SECTION_CODE_L1
32+
-static FDK_FORCEINLINE void fft_8(FIXP_DBL *x) {
33+
+static inline void fft_8(FIXP_DBL *x) {
34+
FIXP_SPK w_PiFOURTH = {{FIXP_SGL(0x5A82), FIXP_SGL(0x5A82)}};
35+
36+
FIXP_DBL a00, a10, a20, a30;
37+
--- a/libFDK/src/fft.cpp
38+
+++ b/libFDK/src/fft.cpp
39+
@@ -170,7 +170,7 @@ [email protected]
40+
41+
/* Performs the FFT of length 2. Input vector unscaled, output vector scaled
42+
* with factor 0.5 */
43+
-static FDK_FORCEINLINE void fft2(FIXP_DBL *RESTRICT pDat) {
44+
+static inline void fft2(FIXP_DBL *RESTRICT pDat) {
45+
FIXP_DBL r1, i1;
46+
FIXP_DBL r2, i2;
47+
48+
@@ -196,7 +196,7 @@ static FDK_FORCEINLINE void fft2(FIXP_DB
49+
50+
#ifndef FUNCTION_fft3
51+
/* Performs the FFT of length 3 according to the algorithm after winograd. */
52+
-static FDK_FORCEINLINE void fft3(FIXP_DBL *RESTRICT pDat) {
53+
+static inline void fft3(FIXP_DBL *RESTRICT pDat) {
54+
FIXP_DBL r1, r2;
55+
FIXP_DBL s1, s2;
56+
FIXP_DBL pD;
57+
@@ -233,7 +233,7 @@ static FDK_FORCEINLINE void fft3(FIXP_DB
58+
59+
/* performs the FFT of length 5 according to the algorithm after winograd */
60+
/* This version works with a prescale of 2 instead of 3 */
61+
-static FDK_FORCEINLINE void fft5(FIXP_DBL *RESTRICT pDat) {
62+
+static inline void fft5(FIXP_DBL *RESTRICT pDat) {
63+
FIXP_DBL r1, r2, r3, r4;
64+
FIXP_DBL s1, s2, s3, s4;
65+
FIXP_DBL t;
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
From 7f328b93ee2aa8bb4e94613b6ed218e7525d8dc0 Mon Sep 17 00:00:00 2001
2+
From: David Seifert <[email protected]>
3+
Date: Sat, 10 Jul 2021 13:06:57 +0200
4+
Subject: [PATCH] Do not force inlining of indirect functions
5+
6+
* A function called indirectly cannot be decorated
7+
with `__attribute((always_inline))`, as this is
8+
guaranteed to only work with direct calls:
9+
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63220#c1
10+
11+
Bug: https://bugs.gentoo.org/798045
12+
---
13+
libFDK/include/fft.h | 4 ++--
14+
libFDK/src/fft.cpp | 6 +++---
15+
2 files changed, 5 insertions(+), 5 deletions(-)
16+
17+
--- a/libFDK/include/fft.h
18+
+++ b/libFDK/include/fft.h
19+
@@ -139,7 +139,7 @@ void ifft(int length, FIXP_DBL *pInput,
20+
* bit scale headroom. The values are interleaved, real/imag pairs.
21+
*/
22+
LNK_SECTION_CODE_L1
23+
-static FDK_FORCEINLINE void fft_4(FIXP_DBL *x) {
24+
+static inline void fft_4(FIXP_DBL *x) {
25+
FIXP_DBL a00, a10, a20, a30, tmp0, tmp1;
26+
27+
a00 = (x[0] + x[4]) >> 1; /* Re A + Re B */
28+
@@ -168,7 +168,7 @@ static FDK_FORCEINLINE void fft_4(FIXP_D
29+
30+
#ifndef FUNCTION_fft_8
31+
LNK_SECTION_CODE_L1
32+
-static FDK_FORCEINLINE void fft_8(FIXP_DBL *x) {
33+
+static inline void fft_8(FIXP_DBL *x) {
34+
FIXP_SPK w_PiFOURTH = {{FIXP_SGL(0x5A82), FIXP_SGL(0x5A82)}};
35+
36+
FIXP_DBL a00, a10, a20, a30;
37+
--- a/libFDK/src/fft.cpp
38+
+++ b/libFDK/src/fft.cpp
39+
@@ -170,7 +170,7 @@ [email protected]
40+
41+
/* Performs the FFT of length 2. Input vector unscaled, output vector scaled
42+
* with factor 0.5 */
43+
-static FDK_FORCEINLINE void fft2(FIXP_DBL *RESTRICT pDat) {
44+
+static inline void fft2(FIXP_DBL *RESTRICT pDat) {
45+
FIXP_DBL r1, i1;
46+
FIXP_DBL r2, i2;
47+
48+
@@ -196,7 +196,7 @@ static FDK_FORCEINLINE void fft2(FIXP_DB
49+
50+
#ifndef FUNCTION_fft3
51+
/* Performs the FFT of length 3 according to the algorithm after winograd. */
52+
-static FDK_FORCEINLINE void fft3(FIXP_DBL *RESTRICT pDat) {
53+
+static inline void fft3(FIXP_DBL *RESTRICT pDat) {
54+
FIXP_DBL r1, r2;
55+
FIXP_DBL s1, s2;
56+
FIXP_DBL pD;
57+
@@ -233,7 +233,7 @@ static FDK_FORCEINLINE void fft3(FIXP_DB
58+
59+
/* performs the FFT of length 5 according to the algorithm after winograd */
60+
/* This version works with a prescale of 2 instead of 3 */
61+
-static FDK_FORCEINLINE void fft5(FIXP_DBL *RESTRICT pDat) {
62+
+static inline void fft5(FIXP_DBL *RESTRICT pDat) {
63+
FIXP_DBL r1, r2, r3, r4;
64+
FIXP_DBL s1, s2, s3, s4;
65+
FIXP_DBL t;

0 commit comments

Comments
 (0)