[packages/fdk-aac] - updated to 3.0.0 (introduces libfdk-xhe-aac) + runtime SSE detection fix (fixes compilation on x86

qboosh qboosh at pld-linux.org
Sun Oct 25 08:24:10 CET 2026


commit 34ad535a3421706d6d8876b73efdfb16d06971de
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Oct 25 08:24:50 2026 +0100

    - updated to 3.0.0 (introduces libfdk-xhe-aac) + runtime SSE detection fix (fixes compilation on x86)

 fdk-aac-runtime-sse-detection.patch | 77 +++++++++++++++++++++++++++++++++++++
 fdk-aac.spec                        | 28 ++++++++++----
 2 files changed, 98 insertions(+), 7 deletions(-)
---
diff --git a/fdk-aac.spec b/fdk-aac.spec
index 466c37c..8510926 100644
--- a/fdk-aac.spec
+++ b/fdk-aac.spec
@@ -1,14 +1,18 @@
 Summary:	Fraunhofer FDK AAC Codec library
 Summary(pl.UTF-8):	Biblioteka kodeka Fraunhofer FDK AAC
 Name:		fdk-aac
-Version:	2.0.3
+Version:	3.0.0
 Release:	1
 License:	distributable, patent license required in some countries
 Group:		Libraries
 Source0:	https://downloads.sourceforge.net/opencore-amr/%{name}-%{version}.tar.gz
-# Source0-md5:	f43e593991caefdce509ad837d3301bd
+# Source0-md5:	16d5d48fc7286e7d235fa299da49a935
+Patch0:		%{name}-runtime-sse-detection.patch
 URL:		https://github.com/mstorsjo/fdk-aac
+BuildRequires:	autoconf >= 2.50
+BuildRequires:	automake
 BuildRequires:	libstdc++-devel
+BuildRequires:	libtool >= 2:2
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -51,8 +55,13 @@ Statyczna biblioteka kodeka Fraunhofer FDK AAC.
 
 %prep
 %setup -q
+%patch -P0 -p1
 
 %build
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__automake}
 %configure \
 	--disable-silent-rules
 %{__make}
@@ -64,7 +73,7 @@ rm -rf $RPM_BUILD_ROOT
 	DESTDIR=$RPM_BUILD_ROOT
 
 # no dependencies and pkg-config file present
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/libfdk-aac.la
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libfdk*-aac.la
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -75,16 +84,21 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc ChangeLog NOTICE
-%attr(755,root,root) %{_libdir}/libfdk-aac.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/libfdk-aac.so.2
+%{_libdir}/libfdk-aac.so.*.*.*
+%ghost %{_libdir}/libfdk-aac.so.2
+%{_libdir}/libfdk-xhe-aac.so.*.*.*
+%ghost %{_libdir}/libfdk-xhe-aac.so.0
 
 %files devel
 %defattr(644,root,root,755)
-%doc documentation/aac{Decoder,Encoder}.pdf
-%attr(755,root,root) %{_libdir}/libfdk-aac.so
+%{_libdir}/libfdk-aac.so
+%{_libdir}/libfdk-xhe-aac.so
 %{_includedir}/fdk-aac
+%{_includedir}/fdk-xhe-aac
 %{_pkgconfigdir}/fdk-aac.pc
+%{_pkgconfigdir}/fdk-xhe-aac.pc
 
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libfdk-aac.a
+%{_libdir}/libfdk-xhe-aac.a
diff --git a/fdk-aac-runtime-sse-detection.patch b/fdk-aac-runtime-sse-detection.patch
new file mode 100644
index 0000000..7972b13
--- /dev/null
+++ b/fdk-aac-runtime-sse-detection.patch
@@ -0,0 +1,77 @@
+--- fdk-aac-3.0.0/xhe-aac/mathlib/src/opt/fpucontrol_opt.h.orig	2026-10-11 12:42:54.000000000 +0200
++++ fdk-aac-3.0.0/xhe-aac/mathlib/src/opt/fpucontrol_opt.h	2026-10-24 19:43:34.723901292 +0200
+@@ -99,20 +99,11 @@ amm-info at iis.fraunhofer.de
+ #define FPUCONTROL_OPT_H
+ 
+ #if (defined _M_IX86 || defined _M_X64 || defined __i386__ || defined __x86_64__)
+-#if defined(_MSC_VER)
+-#include <intrin.h>
+-#elif defined(__GNUC__)
+-#include <x86intrin.h>
+-#endif
+ 
+-static unsigned int fpuctrl_getSSE_mxcsr(void) {
+-  return _mm_getcsr();
+-}
++unsigned int fpuctrl_getSSE_mxcsr(void);
++
++unsigned int fpuctrl_setSSE_mxcsr(unsigned int ctrlWord);
+ 
+-static unsigned int fpuctrl_setSSE_mxcsr(unsigned int ctrlWord) {
+-  _mm_setcsr(ctrlWord);
+-  return _mm_getcsr();
+-}
+ #endif
+ 
+ #endif
+--- fdk-aac-3.0.0/xhe-aac/mathlib/src/opt/fpucontrol_opt.c.orig	1970-01-01 01:00:00.000000000 +0100
++++ fdk-aac-3.0.0/xhe-aac/mathlib/src/opt/fpucontrol_opt.c	1970-01-01 01:00:00.000000000 +0100
+@@ -0,0 +1,20 @@
++#include "fpucontrol_opt.h"
++
++#pragma GCC target("sse")
++#if (defined _M_IX86 || defined _M_X64 || defined __i386__ || defined __x86_64__)
++#if defined(_MSC_VER)
++#include <intrin.h>
++#elif defined(__GNUC__)
++#include <x86intrin.h>
++#endif
++
++unsigned int fpuctrl_getSSE_mxcsr(void) {
++  return _mm_getcsr();
++}
++
++unsigned int fpuctrl_setSSE_mxcsr(unsigned int ctrlWord) {
++  _mm_setcsr(ctrlWord);
++  return _mm_getcsr();
++}
++
++#endif
+--- fdk-aac-3.0.0/CMakeLists.txt.orig	2026-10-11 12:42:54.000000000 +0200
++++ fdk-aac-3.0.0/CMakeLists.txt	2026-10-24 19:49:55.041840933 +0200
+@@ -620,6 +620,7 @@ set(MATH_SRC
+   mathlib/src/cfft.c
+   mathlib/src/cpuinfo.c
+   mathlib/src/fpucontrol.c
++  mathlib/src/opt/fpucontrol_opt.c
+   mathlib/src/iis_dxt.c
+   mathlib/src/iis_fft.c
+   mathlib/src/iis_mdxt.c
+@@ -871,6 +872,7 @@ if(MSVC)
+   target_compile_options(fdk-aac PRIVATE /EHsc)
+ else()
+   target_compile_options(fdk-aac PRIVATE -fno-exceptions -fno-rtti)
++  set_source_files_properties(mathlib/src/opt/fpucontrol_opt.c PROPERTIES COMPILE_OPTIONS "-msse")
+ endif()
+ 
+ ### Set proper name for MinGW or Cygwin DLL
+--- fdk-aac-3.0.0/Makefile.am.orig	2026-10-11 12:42:54.000000000 +0200
++++ fdk-aac-3.0.0/Makefile.am	2026-10-24 20:01:53.314616382 +0200
+@@ -479,6 +479,7 @@ MATH_SRC = \
+     xhe-aac/mathlib/src/cfft.c \
+     xhe-aac/mathlib/src/cpuinfo.c \
+     xhe-aac/mathlib/src/fpucontrol.c \
++    xhe-aac/mathlib/src/opt/fpucontrol_opt.c \
+     xhe-aac/mathlib/src/iis_dxt.c \
+     xhe-aac/mathlib/src/iis_fft.c \
+     xhe-aac/mathlib/src/iis_mdxt.c \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/fdk-aac.git/commitdiff/34ad535a3421706d6d8876b73efdfb16d06971de



More information about the pld-cvs-commit mailing list