[packages/OpenAL] - ALSOFT_CPUEXT_* are safe (runtime detected); but ALSOFT_ENABLE_SSE2_CODEGEN makes sse2 obligatory

qboosh qboosh at pld-linux.org
Wed Dec 4 19:39:30 CET 2019


commit b90768b3c922a147e47db0b715c66ba0604f6875
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Dec 4 19:40:00 2019 +0100

    - ALSOFT_CPUEXT_* are safe (runtime detected); but ALSOFT_ENABLE_SSE2_CODEGEN makes sse2 obligatory
    - added nosse patch to allow build on x86 with ALSOFT_ENABLE_SSE2_CODEGEN disabled
    - release 2

 OpenAL-nosse.patch | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 OpenAL.spec        | 15 ++++++---------
 2 files changed, 55 insertions(+), 9 deletions(-)
---
diff --git a/OpenAL.spec b/OpenAL.spec
index 9eb05d1..993e9c1 100644
--- a/OpenAL.spec
+++ b/OpenAL.spec
@@ -5,27 +5,23 @@
 %bcond_without	portaudio	# PortAudio backend
 %bcond_without	pulseaudio	# PulseAudio backend
 %bcond_with	sdl		# SDL2 backend
-%bcond_with	sse		# force use of SSE instructions (x86)
 %bcond_with	sse2		# force use of SSE2 instructions (x86)
 %bcond_without	gui		# alsoft-config GUI
 %bcond_with	qt4		# Qt 4 instead of Qt 5 for GUI
-#
-%ifarch pentium3 pentium4
-%define	with_sse	1
-%endif
-%ifarch pentium4
+%ifarch pentium4 x32 %{x8664}
 %define	with_sse2	1
 %endif
 Summary:	Open Audio Library
 Summary(pl.UTF-8):	Otwarta Biblioteka Dźwięku
 Name:		OpenAL
 Version:	1.20.0
-Release:	1
+Release:	2
 License:	LGPL v2+
 Group:		Libraries
 Source0:	http://openal-soft.org/openal-releases/openal-soft-%{version}.tar.bz2
 # Source0-md5:	f6349071db03e48994ea09daa031ef6e
 Patch0:		%{name}-pc.patch
+Patch1:		%{name}-nosse.patch
 URL:		http://www.openal.org/
 %{?with_sdl:BuildRequires:	SDL2-devel >= 2}
 %{?with_alsa:BuildRequires:	alsa-lib-devel}
@@ -49,6 +45,7 @@ BuildRequires:	Qt5Widgets-devel >= 5
 BuildRequires:	qt5-build >= 5
 %endif
 %endif
+%{?with_sse2:Requires:	cpuinfo(sse2)}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -98,6 +95,7 @@ Graficzny interfejs do konfiguracji biblioteki OpenAL.
 %prep
 %setup -q -n openal-soft-%{version}
 %patch0 -p1
+%patch1 -p1
 
 %build
 cd build
@@ -107,8 +105,7 @@ cd build
 	%{!?with_portaudio:-DALSOFT_BACKEND_PORTAUDIO=OFF} \
 	%{!?with_pulseaudio:-DALSOFT_BACKEND_PULSEAUDIO=OFF} \
 	%{?with_sdl:-DALSOFT_BACKEND_SDL2=ON} \
-	%{!?with_sse:-DALSOFT_CPUEXT_SSE=OFF} \
-	%{!?with_sse2:-DALSOFT_CPUEXT_SSE2=OFF} \
+	%{!?with_sse2:-DALSOFT_ENABLE_SSE2_CODEGEN=OFF} \
 	-DALSOFT_EXAMPLES=OFF \
 	%{!?with_gui:-DALSOFT_NO_CONFIG_UTIL=ON} \
 	%{?with_qt4:-DALSOFT_NO_QT5=ON} \
diff --git a/OpenAL-nosse.patch b/OpenAL-nosse.patch
new file mode 100644
index 0000000..cf2a9d6
--- /dev/null
+++ b/OpenAL-nosse.patch
@@ -0,0 +1,49 @@
+--- openal-soft-1.20.0/common/alnumeric.h.orig	2019-11-28 09:45:08.000000000 +0100
++++ openal-soft-1.20.0/common/alnumeric.h	2019-12-04 05:28:38.843039338 +0100
+@@ -191,7 +191,7 @@
+  */
+ inline int fastf2i(float f) noexcept
+ {
+-#if defined(HAVE_SSE_INTRINSICS)
++#if defined(HAVE_SSE_INTRINSICS) && defined(__SSE_MATH__)
+     return _mm_cvt_ss2si(_mm_set_ss(f));
+ 
+ #elif defined(_MSC_VER) && defined(_M_IX86_FP)
+@@ -222,7 +222,7 @@
+ /** Converts float-to-int using standard behavior (truncation). */
+ inline int float2int(float f) noexcept
+ {
+-#if defined(HAVE_SSE_INTRINSICS)
++#if defined(HAVE_SSE_INTRINSICS) && defined(__SSE_MATH__)
+     return _mm_cvtt_ss2si(_mm_set_ss(f));
+ 
+ #elif ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \
+@@ -257,7 +257,7 @@
+ /** Converts double-to-int using standard behavior (truncation). */
+ inline int double2int(double d) noexcept
+ {
+-#if defined(HAVE_SSE_INTRINSICS)
++#if defined(HAVE_SSE_INTRINSICS) && defined(__SSE_MATH__)
+     return _mm_cvttsd_si32(_mm_set_sd(d));
+ 
+ #elif ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \
+--- openal-soft-1.20.0/alc/helpers.cpp.orig	2019-11-28 09:45:08.000000000 +0100
++++ openal-soft-1.20.0/alc/helpers.cpp	2019-12-04 18:37:09.810067181 +0100
+@@ -209,7 +209,7 @@
+ 
+ FPUCtl::FPUCtl()
+ {
+-#if defined(HAVE_SSE_INTRINSICS)
++#if defined(HAVE_SSE_INTRINSICS) && defined(__SSE_MATH__)
+     this->sse_state = _mm_getcsr();
+     unsigned int sseState = this->sse_state;
+     sseState |= 0x8000; /* set flush-to-zero */
+@@ -236,7 +236,7 @@
+ {
+     if(!this->in_mode) return;
+ 
+-#if defined(HAVE_SSE_INTRINSICS)
++#if defined(HAVE_SSE_INTRINSICS) && defined(__SSE_MATH__)
+     _mm_setcsr(this->sse_state);
+ 
+ #elif defined(__GNUC__) && defined(HAVE_SSE)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/OpenAL.git/commitdiff/b90768b3c922a147e47db0b715c66ba0604f6875



More information about the pld-cvs-commit mailing list