diff mbox series

package/opus: fix build with BR2_OPTIMIZE_FAST

Message ID 20220405093902.2038437-1-peter@korsgaard.com
State Accepted
Headers show
Series package/opus: fix build with BR2_OPTIMIZE_FAST | expand

Commit Message

Peter Korsgaard April 5, 2022, 9:39 a.m. UTC
Fixes:
http://autobuild.buildroot.net/results/194/1941e194e1f5ad0bc4982ad39c3e34d266bc49c6/

opus requires that it is configured with --enable-float-approx when
-ffast-math (BR2_OPTIMIZE_FAST) is used, otherwise it errors out at build
time:

celt/arch.h:198:2: error: #error Cannot build libopus with -ffast-math
unless FLOAT_APPROX is defined.  This could result in crashes on extreme
(e.g.  NaN) input

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 package/opus/opus.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Peter Korsgaard April 5, 2022, 5:12 p.m. UTC | #1
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

 > Fixes:
 > http://autobuild.buildroot.net/results/194/1941e194e1f5ad0bc4982ad39c3e34d266bc49c6/

 > opus requires that it is configured with --enable-float-approx when
 > -ffast-math (BR2_OPTIMIZE_FAST) is used, otherwise it errors out at build
 > time:

 > celt/arch.h:198:2: error: #error Cannot build libopus with -ffast-math
 > unless FLOAT_APPROX is defined.  This could result in crashes on extreme
 > (e.g.  NaN) input

 > Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Committed, thanks.
diff mbox series

Patch

diff --git a/package/opus/opus.mk b/package/opus/opus.mk
index 4f816df477..2fa929c7df 100644
--- a/package/opus/opus.mk
+++ b/package/opus/opus.mk
@@ -23,6 +23,10 @@  ifeq ($(BR2_PACKAGE_OPUS_FIXED_POINT),y)
 OPUS_CONF_OPTS += --enable-fixed-point
 endif
 
+ifeq ($(BR2_OPTIMIZE_FAST),y)
+OPUS_CONF_OPTS += --enable-float-approx
+endif
+
 # When we're on ARM, but we don't have ARM instructions (only
 # Thumb-2), disable the usage of assembly as it is not Thumb-ready.
 ifeq ($(BR2_arm)$(BR2_armeb):$(BR2_ARM_CPU_HAS_ARM),y:)