Skip to contentSkip to conversation

openal: Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains

PATCH New André Hentschel 3 participants 4 messages Aug 28, 2016 – Aug 31, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openal: Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains

Fixes:
http://autobuild.buildroot.net/results/d7ccef77a355ccc23f26d012e8441af931469ae4
http://autobuild.buildroot.net/results/b5777a0ed33f6bb7a5fc0486ea21ecef58615dac

---
 package/openal/openal.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/openal/openal.mk +7 -0
index 2916aa6..8205f9e 100644
@@ -50,4 +50,11 @@ ifeq ($(BR2_STATIC_LIBS),y)
 OPENAL_CONF_OPTS += -DLIBTYPE=STATIC
 endif
 
+# Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains
+ifeq ($(BR2_ARM_FPU_NEON)$(BR2_ARM_FPU_NEON_VFPV4),y)
+OPENAL_CONF_OPTS += -DALSOFT_CPUEXT_NEON=ON
+else
+OPENAL_CONF_OPTS += -DALSOFT_CPUEXT_NEON=OFF
+endif
+
 $(eval $(cmake-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 openal: Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains

Hello,

Why do you think the problem is with "precompiled" toolchains only?

Quoted 13 lines · Andr? Hentschel

Fixes:
http://autobuild.buildroot.net/results/d7ccef77a355ccc23f26d012e8441af931469ae4
http://autobuild.buildroot.net/results/b5777a0ed33f6bb7a5fc0486ea21ecef58615dac

---
 package/openal/openal.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/openal/openal.mk +0 -0
index 2916aa6..8205f9e 100644

package/openal/openal.mk ifeq ($(BR2_STATIC_LIBS),y) · line 54

Quoted 5 lines
package/openal/openal.mk +2 -0
@@ -50,4 +50,11 @@ ifeq ($(BR2_STATIC_LIBS),y)
 OPENAL_CONF_OPTS += -DLIBTYPE=STATIC
 endif
 
+# Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains
+ifeq ($(BR2_ARM_FPU_NEON)$(BR2_ARM_FPU_NEON_VFPV4),y)

I believe you should use BR2_ARM_CPU_HAS_NEON instead.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 openal: Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains

Am 28.08.2016 um 15:50 schrieb Thomas Petazzoni:

Quoted 3 lines

Hello,

Why do you think the problem is with "precompiled" toolchains only?

Because the bug is about mismatch between target settings made in the buildroot config and the toolchain default target settings.

Quoted 18 lines · Andr? Hentschel
Quoted 16 lines

Fixes:
http://autobuild.buildroot.net/results/d7ccef77a355ccc23f26d012e8441af931469ae4
http://autobuild.buildroot.net/results/b5777a0ed33f6bb7a5fc0486ea21ecef58615dac

---
 package/openal/openal.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/openal/openal.mk +0 -0
index 2916aa6..8205f9e 100644
@@ -50,4 +50,11 @@ ifeq ($(BR2_STATIC_LIBS),y)
 OPENAL_CONF_OPTS += -DLIBTYPE=STATIC
 endif
 
Quoted 4 lines

package/openal/openal.mk ifeq ($(BR2_STATIC_LIBS),y) · line 54

Quoted 2 lines
package/openal/openal.mk +2 -0
+# Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains
+ifeq ($(BR2_ARM_FPU_NEON)$(BR2_ARM_FPU_NEON_VFPV4),y)

I believe you should use BR2_ARM_CPU_HAS_NEON instead.

Thought so too, looked into it, failed. It really depends on the FPU setting.
I know there's no other package doing this kind of check...
Other options are to always disable neon or to extend the checking in openal cmake script with a patch. (I won't be able to patch it as my cmake skills are very low)

#3 lore raw

PATCH 1/1 openal: Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains

Quoted 6 lines · Andr? Hentschel

Am 28.08.2016 um 15:50 schrieb Thomas Petazzoni:

Quoted 3 lines

Hello,

Why do you think the problem is with "precompiled" toolchains only?

Because the bug is about mismatch between target settings made in the buildroot config and the toolchain default target settings.

I also believe that the same problem would occur with an internal build, but
couldn't be bothered to test it :-)

Quoted 24 lines
Quoted 19 lines · Andr? Hentschel
Quoted 16 lines

Fixes:
http://autobuild.buildroot.net/results/d7ccef77a355ccc23f26d012e8441af931469ae4
http://autobuild.buildroot.net/results/b5777a0ed33f6bb7a5fc0486ea21ecef58615dac

---
 package/openal/openal.mk | 7 +++++++
 1 file changed, 7 insertions(+)
package/openal/openal.mk +0 -0
index 2916aa6..8205f9e 100644
@@ -50,4 +50,11 @@ ifeq ($(BR2_STATIC_LIBS),y)
 OPENAL_CONF_OPTS += -DLIBTYPE=STATIC
 endif
 
Quoted 4 lines

package/openal/openal.mk ifeq ($(BR2_STATIC_LIBS),y) · line 54

Quoted 2 lines
package/openal/openal.mk +2 -0
+# Explicitly enable/disable NEON support to avoid trouble with precompiled toolchains
+ifeq ($(BR2_ARM_FPU_NEON)$(BR2_ARM_FPU_NEON_VFPV4),y)

I believe you should use BR2_ARM_CPU_HAS_NEON instead.

Quoted 4 lines

Thought so too, looked into it, failed. It really depends on the FPU setting.
I know there's no other package doing this kind of check...
Other options are to always disable neon or to extend the checking in openal cmake script with a patch. (I won't be able to patch it as my cmake skills are very low)

The checking in the cmake script is fairly basic: it just checks for the
presence of the arm_neon.h header with the intrinsics. That header will always be there (except for Linaro toolchains, which are as usual broken: the header is in /usr/lib/include, which isn't in the search path).

The error is that we build everything with e.g. -mfpu=vfpv3, while the neon
intrinsics are marked always_inline so they will be inlined in the vfpv3 function. That is not possible (you need to save registers to switch between VFP and NEON, so you can't mix the two in the same function). So, any FPU selection that is not NEON will trigger the issue.

However, a better solution would be to pass -mfpu=neon or -mfpu=neon-vfpv4 to
the compilation of the files that use neon intrinsics. But that's more for upstream to fix.

So, I'd give it my

but the comment has to be improved.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF