opus: revert to autotools

Latest update in 6c3db5d has switched build system to Meson,
which is broken on several non-SIMD platforms. Turns out,
Meson support is not yet stable enough in the upstream,
so we revert to autotools and drop meson-related patch.

Signed-off-by: krant <aleksey.vasilenko@gmail.com>
This commit is contained in:
krant 2024-03-23 11:40:34 +02:00 committed by Tianling Shen
parent b8d0049e7c
commit e616f879c0
2 changed files with 9 additions and 116 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=opus
PKG_VERSION:=1.5.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.xiph.org/releases/opus
@ -24,7 +24,6 @@ PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/meson.mk
define Package/libopus
SECTION:=libs
@ -39,23 +38,23 @@ define Package/libopus/description
is also intended for storage and streaming applications.
endef
MESON_ARGS+= \
-Ddocs=disabled \
-Dextra-programs=disabled
CONFIGURE_ARGS+= \
--disable-doc \
--disable-extra-programs
ifeq ($(CONFIG_SOFT_FLOAT),y)
MESON_ARGS+= \
-Dfixed-point=true
CONFIGURE_ARGS+= \
--enable-fixed-point
endif
ifneq ($(findstring neon,$(CONFIG_CPU_TYPE))$(findstring aarch64,$(CONFIG_ARCH)),)
MESON_ARGS+= \
-Dfixed-point=true
CONFIGURE_ARGS+= \
--enable-fixed-point
endif
CPU_ASM_BLACKLIST:=xscale arm926ej-s
ifneq ($(findstring $(call qstrip,$(CONFIG_CPU_TYPE)),$(CPU_ASM_BLACKLIST)),)
MESON_ARGS+= -Dasm=disabled
CONFIGURE_ARGS+= --disable-asm
endif
define Build/InstallDev

View File

@ -1,106 +0,0 @@
From 49d4effeea9107d18f6897255139d30fc80204df Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Wed, 6 Mar 2024 11:21:07 +0000
Subject: [PATCH] fix arm asm meson source build
meson does mot support output with paths; add a meson.build file in the arm
directory. The output files were being incorrectly placed in the celt/ directory.
Program arm/arm2gnu.pl found: YES (/var/media/DATA/home-rudi/LibreELEC.kernel11/build.LibreELEC-H3.arm-12.0-devel/build/opus-v1.5.1/celt/arm/arm2gnu.pl)
Configuring celt_pitch_xcorr_arm-gnu.S with command
../celt/meson.build:51:25: ERROR: configure_file keyword argument "output" Output 'arm/armopts.s' must not contain a path segment.
before:
celt/celt_pitch_xcorr_arm-gnu.S
after:
celt/arm/celt_pitch_xcorr_arm-gnu.S
celt/arm/armopts.s
celt/arm/armopts-gnu.S
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
---
celt/arm/meson.build | 12 ++++++++++++
celt/meson.build | 9 +--------
2 files changed, 13 insertions(+), 8 deletions(-)
create mode 100644 celt/arm/meson.build
--- /dev/null
+++ b/celt/arm/meson.build
@@ -0,0 +1,12 @@
+arm2gnu = [find_program('arm2gnu.pl')] + arm2gnu_args
+celt_sources_arm_asm = configure_file(input: 'celt_pitch_xcorr_arm.s',
+ output: '@BASENAME@-gnu.S',
+ command: arm2gnu + ['@INPUT@'],
+ capture: true)
+celt_arm_armopts_s_in = configure_file(input: 'armopts.s.in',
+ output: 'armopts.s',
+ configuration: opus_conf)
+celt_arm_armopts_s = configure_file(input: [celt_arm_armopts_s_in],
+ output: '@BASENAME@-gnu.S',
+ command: arm2gnu + ['@INPUT@'],
+ capture: true)
--- a/celt/meson.build
+++ b/celt/meson.build
@@ -43,14 +43,7 @@ if host_cpu_family in ['arm', 'aarch64']
celt_sources += sources['CELT_SOURCES_ARM_NE10']
endif
if opus_arm_external_asm
- arm2gnu = [find_program('arm/arm2gnu.pl')] + arm2gnu_args
- celt_sources_arm_asm = configure_file(input: 'arm/celt_pitch_xcorr_arm.s',
- output: '@BASENAME@-gnu.S',
- command: arm2gnu + ['@INPUT@'],
- capture: true)
- celt_arm_armopts_s = configure_file(input: 'arm/armopts.s.in',
- output: 'arm/armopts.s',
- configuration: opus_conf)
+ subdir('arm')
celt_static_libs += static_library('celt-armasm',
celt_arm_armopts_s, celt_sources_arm_asm,
install: false)
--- a/meson.build
+++ b/meson.build
@@ -252,6 +252,13 @@ if not opt_asm.disabled()
opus_conf.set('OPUS_ARM_INLINE_NEON', 1)
inline_optimization += ['NEON']
endif
+
+ # AS_ASM_ARM_DOTPROD
+ if cc.compiles(asm_tmpl.format('udot v0.4s,v1.16b,v2.16b'),
+ name : 'assembler supports DOTPROD instructions on ARM')
+ opus_conf.set('OPUS_ARM_INLINE_DOTPROD', 1)
+ inline_optimization += ['DOTPROD']
+ endif
endif
# We need Perl to translate RVCT-syntax asm to gas syntax
@@ -273,21 +280,24 @@ if not opt_asm.disabled()
opus_arm_may_have_neon = opus_conf.has('OPUS_ARM_INLINE_NEON')
opus_arm_presume_neon = opus_arm_may_have_neon and opus_can_presume_simd
+ opus_arm_may_have_dotprod = opus_conf.has('OPUS_ARM_INLINE_DOTPROD')
+ opus_arm_presume_dotprod = opus_arm_may_have_dotprod and opus_can_presume_simd
+
if not opt_rtcd.disabled()
if not opus_arm_may_have_edsp
message('Trying to force-enable armv5e EDSP instructions...')
# AS_ASM_ARM_EDSP_FORCE
- opus_arm_may_have_edsp = cc.compiles(asm_tmpl.format('.arch armv5te\n.object_arch armv4t\nqadd r3,r3,r3'),
+ opus_arm_may_have_edsp = cc.compiles(asm_tmpl.format('.arch armv5te;.object_arch armv4t;qadd r3,r3,r3'),
name : 'Assembler supports EDSP instructions on ARM (forced)')
endif
if not opus_arm_may_have_media
message('Trying to force-enable ARMv6 media instructions...')
- opus_arm_may_have_media = cc.compiles(asm_tmpl.format('.arch armv6\n.object_arch armv4t\nshadd8 r3,r3,r3'),
+ opus_arm_may_have_media = cc.compiles(asm_tmpl.format('.arch armv6;.object_arch armv4t;shadd8 r3,r3,r3'),
name : 'Assembler supports ARMv6 media instructions on ARM (forced)')
endif
if not opus_arm_may_have_neon
message('Trying to force-enable NEON instructions...')
- opus_arm_may_have_neon = cc.compiles(asm_tmpl.format('.arch armv7-a\n.fpu neon\n.object_arch armv4t\nvorr d0,d0,d0'),
+ opus_arm_may_have_neon = cc.compiles(asm_tmpl.format('.arch armv7-a;.fpu neon;.object_arch armv4t;vorr d0,d0,d0'),
name : 'Assembler supports NEON instructions on ARM (forced)')
endif
endif