Skip to content

Commit

Permalink
external libs / opus: added a patch from opus PR149 on github
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Nov 14, 2019
1 parent 70fe970 commit 2547f41
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
43 changes: 43 additions & 0 deletions external/opus-1.3.1/0011-pic-configure.patch
@@ -0,0 +1,43 @@
https://github.com/xiph/opus/pull/149

From a729a53efcfd7c37c69d76a9ae11c89b48eca1f0 Mon Sep 17 00:00:00 2001
From: sezero <sezero@users.sourceforge.net>
Date: Sun, 6 Oct 2019 14:37:02 +0300
Subject: [PATCH] configure: adjust x86 get cpu info inline assembly method for PIC case

.. just like the way it is done in celt/x86/x86cpu.c.
---
configure.ac | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/configure.ac b/configure.ac
index 18ece291..f12f0aa9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -691,6 +691,18 @@ AS_IF([test x"$enable_intrinsics" = x"yes"],[
unsigned int CPUInfo2;
unsigned int CPUInfo3;
unsigned int InfoType;
+ #if defined(__i386__) && defined(__PIC__)
+ __asm__ __volatile__ (
+ "xchg %%ebx, %1\n"
+ "cpuid\n"
+ "xchg %%ebx, %1\n":
+ "=a" (CPUInfo0),
+ "=r" (CPUInfo1),
+ "=c" (CPUInfo2),
+ "=d" (CPUInfo3) :
+ "a" (InfoType), "c" (0)
+ );
+ #else
__asm__ __volatile__ (
"cpuid":
"=a" (CPUInfo0),
@@ -699,6 +711,7 @@ AS_IF([test x"$enable_intrinsics" = x"yes"],[
"=d" (CPUInfo3) :
"a" (InfoType), "c" (0)
);
+ #endif
]])],
[get_cpuid_by_asm="yes"
AC_MSG_RESULT([Inline Assembly])
13 changes: 13 additions & 0 deletions external/opus-1.3.1/configure
Expand Up @@ -14295,6 +14295,18 @@ main ()
unsigned int CPUInfo2;
unsigned int CPUInfo3;
unsigned int InfoType;
#if defined(__i386__) && defined(__PIC__)
__asm__ __volatile__ (
"xchg %%ebx, %1\n"
"cpuid\n"
"xchg %%ebx, %1\n":
"=a" (CPUInfo0),
"=r" (CPUInfo1),
"=c" (CPUInfo2),
"=d" (CPUInfo3) :
"a" (InfoType), "c" (0)
);
#else
__asm__ __volatile__ (
"cpuid":
"=a" (CPUInfo0),
Expand All @@ -14303,6 +14315,7 @@ main ()
"=d" (CPUInfo3) :
"a" (InfoType), "c" (0)
);
#endif
;
return 0;
Expand Down
13 changes: 13 additions & 0 deletions external/opus-1.3.1/configure.ac
Expand Up @@ -691,6 +691,18 @@ AS_IF([test x"$enable_intrinsics" = x"yes"],[
unsigned int CPUInfo2;
unsigned int CPUInfo3;
unsigned int InfoType;
#if defined(__i386__) && defined(__PIC__)
__asm__ __volatile__ (
"xchg %%ebx, %1\n"
"cpuid\n"
"xchg %%ebx, %1\n":
"=a" (CPUInfo0),
"=r" (CPUInfo1),
"=c" (CPUInfo2),
"=d" (CPUInfo3) :
"a" (InfoType), "c" (0)
);
#else
__asm__ __volatile__ (
"cpuid":
"=a" (CPUInfo0),
Expand All @@ -699,6 +711,7 @@ AS_IF([test x"$enable_intrinsics" = x"yes"],[
"=d" (CPUInfo3) :
"a" (InfoType), "c" (0)
);
#endif
]])],
[get_cpuid_by_asm="yes"
AC_MSG_RESULT([Inline Assembly])
Expand Down

0 comments on commit 2547f41

Please sign in to comment.