All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] openal: Use upstream patch to fix FPU related build failures
@ 2016-09-11 15:49 André Hentschel
  2016-09-11 15:49 ` [Buildroot] [PATCH 2/2] openal: Use upstream patch to detect run-time NEON support André Hentschel
  2016-09-11 20:47 ` [Buildroot] [PATCH 1/2] openal: Use upstream patch to fix FPU related build failures Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: André Hentschel @ 2016-09-11 15:49 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Andr? Hentschel <nerv@dawncrow.de>
---
 .../0002-Build-NEON-code-with-mfpu-neon.patch      | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 package/openal/0002-Build-NEON-code-with-mfpu-neon.patch

diff --git a/package/openal/0002-Build-NEON-code-with-mfpu-neon.patch b/package/openal/0002-Build-NEON-code-with-mfpu-neon.patch
new file mode 100644
index 0000000..0801fba
--- /dev/null
+++ b/package/openal/0002-Build-NEON-code-with-mfpu-neon.patch
@@ -0,0 +1,26 @@
+upstream commit 27916ce3db023454a0295ee63ea196fbc246674c
+Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date:   Tue Sep 6 22:19:14 2016 +0200
+
+    Build NEON code with -mfpu=neon
+
+    The ARM-specific NEON code needs to be built with -mfpu=neon to avoid
+    build failures when a difference FPU is used by default by the
+    compiler.
+
+    Fixes issue #54.
+
+    Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d8f1515..d92bbb7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -763,6 +763,7 @@ IF(HAVE_ARM_NEON_H)
+         SET(HAVE_NEON 1)
+         SET(ALC_OBJS  ${ALC_OBJS} Alc/mixer_neon.c)
+         SET(CPU_EXTS "${CPU_EXTS}, Neon")
++        SET_SOURCE_FILES_PROPERTIES(Alc/mixer_neon.c PROPERTIES COMPILE_FLAGS -mfpu=neon)
+     ENDIF()
+ ENDIF()
+ IF(ALSOFT_REQUIRE_NEON AND NOT HAVE_NEON)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] openal: Use upstream patch to detect run-time NEON support
  2016-09-11 15:49 [Buildroot] [PATCH 1/2] openal: Use upstream patch to fix FPU related build failures André Hentschel
@ 2016-09-11 15:49 ` André Hentschel
  2016-09-11 20:48   ` Thomas Petazzoni
  2016-09-11 20:47 ` [Buildroot] [PATCH 1/2] openal: Use upstream patch to fix FPU related build failures Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: André Hentschel @ 2016-09-11 15:49 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Andr? Hentschel <nerv@dawncrow.de>
---
 .../0003-Check-for-run-time-NEON-support.patch     | 63 ++++++++++++++++++++++
 1 file changed, 63 insertions(+)
 create mode 100644 package/openal/0003-Check-for-run-time-NEON-support.patch

diff --git a/package/openal/0003-Check-for-run-time-NEON-support.patch b/package/openal/0003-Check-for-run-time-NEON-support.patch
new file mode 100644
index 0000000..abef66a
--- /dev/null
+++ b/package/openal/0003-Check-for-run-time-NEON-support.patch
@@ -0,0 +1,63 @@
+upstream commit a52cfc804813aef8e4b304e20cf843fa6907af6c
+together with the fix from commit c3c283a0b5d0130afafaa2a5b6ce6fbc30b6e6a1
+Author: Chris Robinson <chris.kcat@gmail.com>
+Date:   Wed Sep 7 09:57:40 2016 -0700
+
+    Check for run-time NEON support by reading /proc/cpuinfo
+
+    Less than ideal since documentations warn it may not list 'neon' even if it's
+    really supported. However, the "proper" APIs to check for NEON extensions don't
+    seem to exist in my toolchain.
+
+diff --git a/Alc/helpers.c b/Alc/helpers.c
+index 9b6c789..4ffda46 100644
+--- a/Alc/helpers.c
++++ b/Alc/helpers.c
+@@ -32,6 +32,7 @@
+ #include <time.h>
+ #include <errno.h>
+ #include <stdarg.h>
++#include <ctype.h>
+ #ifdef HAVE_MALLOC_H
+ #include <malloc.h>
+ #endif
+@@ -227,8 +227,37 @@ void FillCPUCaps(ALuint capfilter)
+ #endif
+ #endif
+ #ifdef HAVE_NEON
+-    /* Assume Neon support if compiled with it */
+-    caps |= CPU_CAP_NEON;
++    FILE *file = fopen("/proc/cpuinfo", "rt");
++    if(!file)
++        ERR("Failed to open /proc/cpuinfo, cannot check for NEON support\n");
++    else
++    {
++        char buf[256];
++        while(fgets(buf, sizeof(buf), file) != NULL)
++        {
++            char *str;
++
++            if(strncmp(buf, "Features\t:", 10) != 0)
++                continue;
++
++            TRACE("Got features string:%s\n", buf+10);
++
++            str = buf;
++            while((str=strstr(str, "neon")) != NULL)
++            {
++                if(isspace(*(str-1)) && (str[4] == 0 || isspace(str[4])))
++                {
++                    caps |= CPU_CAP_NEON;
++                    break;
++                }
++                str++;
++            }
++            break;
++        }
++
++        fclose(file);
++        file = NULL;
++    }
+ #endif
+ 
+     TRACE("Extensions:%s%s%s%s%s%s\n",
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/2] openal: Use upstream patch to fix FPU related build failures
  2016-09-11 15:49 [Buildroot] [PATCH 1/2] openal: Use upstream patch to fix FPU related build failures André Hentschel
  2016-09-11 15:49 ` [Buildroot] [PATCH 2/2] openal: Use upstream patch to detect run-time NEON support André Hentschel
@ 2016-09-11 20:47 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-09-11 20:47 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 11 Sep 2016 17:49:00 +0200, Andr? Hentschel wrote:
> Signed-off-by: Andr? Hentschel <nerv@dawncrow.de>
> ---
>  .../0002-Build-NEON-code-with-mfpu-neon.patch      | 26 ++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>  create mode 100644 package/openal/0002-Build-NEON-code-with-mfpu-neon.patch

I've applied, after:

 * Removing the patch itself, and instead download it from Github
   directly

 * Adding a reference to the autobuilder failure fixed by this patch.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 2/2] openal: Use upstream patch to detect run-time NEON support
  2016-09-11 15:49 ` [Buildroot] [PATCH 2/2] openal: Use upstream patch to detect run-time NEON support André Hentschel
@ 2016-09-11 20:48   ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-09-11 20:48 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 11 Sep 2016 17:49:01 +0200, Andr? Hentschel wrote:
> Signed-off-by: Andr? Hentschel <nerv@dawncrow.de>
> ---
>  .../0003-Check-for-run-time-NEON-support.patch     | 63 ++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
>  create mode 100644 package/openal/0003-Check-for-run-time-NEON-support.patch

Applied after changing from having the patch inside Buildroot to
downloading the patches from Github directly.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-11 20:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-11 15:49 [Buildroot] [PATCH 1/2] openal: Use upstream patch to fix FPU related build failures André Hentschel
2016-09-11 15:49 ` [Buildroot] [PATCH 2/2] openal: Use upstream patch to detect run-time NEON support André Hentschel
2016-09-11 20:48   ` Thomas Petazzoni
2016-09-11 20:47 ` [Buildroot] [PATCH 1/2] openal: Use upstream patch to fix FPU related build failures Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.