[packages/SDL2_sound] - added use-builtin-clz patch (rely on gcc to choose proper instruction for target CPU; fixes build
qboosh
qboosh at pld-linux.org
Sat Sep 24 21:03:11 CEST 2022
commit 387801cc77ed4b5baf978d009703e229a23cd6c1
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Sep 24 21:03:34 2022 +0200
- added use-builtin-clz patch (rely on gcc to choose proper instruction for target CPU; fixes build on x32)
SDL2_sound.spec | 2 ++
SDL_sound-use-builtin-clz.patch | 29 +++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
---
diff --git a/SDL2_sound.spec b/SDL2_sound.spec
index 3243290..d5f71b8 100644
--- a/SDL2_sound.spec
+++ b/SDL2_sound.spec
@@ -9,6 +9,7 @@ Group: Libraries
#Source0Download: https://github.com/icculus/SDL_sound/releases
Source0: https://github.com/icculus/SDL_sound/archive/v%{version}/SDL_sound-%{version}.tar.gz
# Source0-md5: 4917a87b45f7b940a68cd1b60881cabb
+Patch0: SDL_sound-use-builtin-clz.patch
URL: http://www.icculus.org/SDL_sound/
BuildRequires: SDL2-devel >= 2.0
BuildRequires: cmake >= 2.8.12
@@ -82,6 +83,7 @@ Statyczne biblioteki SDL_sound.
%prep
%setup -q -n SDL_sound-%{version}
+%patch0 -p1
%build
install -d build
diff --git a/SDL_sound-use-builtin-clz.patch b/SDL_sound-use-builtin-clz.patch
new file mode 100644
index 0000000..27ce659
--- /dev/null
+++ b/SDL_sound-use-builtin-clz.patch
@@ -0,0 +1,29 @@
+--- SDL_sound-2.0.1/src/dr_flac.h.orig 2022-03-25 21:17:50.000000000 +0100
++++ SDL_sound-2.0.1/src/dr_flac.h 2022-09-24 20:46:30.681153334 +0200
+@@ -2768,25 +2768,7 @@ static DRFLAC_INLINE drflac_uint32 drfla
+ #endif
+ #else
+ #if defined(__GNUC__) || defined(__clang__)
+- #if defined(DRFLAC_X64)
+- {
+- drflac_uint64 r;
+- __asm__ __volatile__ (
+- "lzcnt{ %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc"
+- );
+-
+- return (drflac_uint32)r;
+- }
+- #elif defined(DRFLAC_X86)
+- {
+- drflac_uint32 r;
+- __asm__ __volatile__ (
+- "lzcnt{l %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc"
+- );
+-
+- return r;
+- }
+- #elif defined(DRFLAC_ARM) && (defined(__ARM_ARCH) && __ARM_ARCH >= 5) && !defined(DRFLAC_64BIT) /* <-- I haven't tested 64-bit inline assembly, so only enabling this for the 32-bit build for now. */
++ #if defined(DRFLAC_ARM) && (defined(__ARM_ARCH) && __ARM_ARCH >= 5) && !defined(DRFLAC_64BIT) /* <-- I haven't tested 64-bit inline assembly, so only enabling this for the 32-bit build for now. */
+ {
+ unsigned int r;
+ __asm__ __volatile__ (
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/SDL2_sound.git/commitdiff/387801cc77ed4b5baf978d009703e229a23cd6c1
More information about the pld-cvs-commit
mailing list