summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Bara <benjamin.bara@skidata.com>2023-08-31 10:54:11 +0200
committerKhem Raj <raj.khem@gmail.com>2023-08-31 07:43:23 -0700
commit05e32934d064daa186742084586b3111036a8e1b (patch)
tree4d2f5f764fe89c8a43503429ef6dfe69acd1d1a6
parent57b37873c5b79294c061a5c44321e58b5572182e (diff)
downloadmeta-openembedded-05e32934d064daa186742084586b3111036a8e1b.tar.gz
openh264: make neon optional and disable if not supported
openh264 currently enforces neon on armv7, although it has fallbacks implemented in C/C++ and it is mentioned in the README that it is optional[1]. Therefore, make neon optional and disable it if the machine does not support it. [1] https://github.com/cisco/openh264/blob/v2.3.1/README.md?plain=1#L54 Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-multimedia/recipes-multimedia/openh264/openh264/0002-Makefile-add-possibility-to-disable-NEON-extension.patch103
-rw-r--r--meta-multimedia/recipes-multimedia/openh264/openh264_2.3.1.bb4
2 files changed, 107 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/openh264/openh264/0002-Makefile-add-possibility-to-disable-NEON-extension.patch b/meta-multimedia/recipes-multimedia/openh264/openh264/0002-Makefile-add-possibility-to-disable-NEON-extension.patch
new file mode 100644
index 000000000..298ac1c01
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/openh264/openh264/0002-Makefile-add-possibility-to-disable-NEON-extension.patch
@@ -0,0 +1,103 @@
1From bc3a3baeaccfe9c1286848b348baf92dfbd05346 Mon Sep 17 00:00:00 2001
2From: Benjamin Bara <benjamin.bara@skidata.com>
3Date: Thu, 31 Aug 2023 09:27:31 +0200
4Subject: [PATCH 2/2] Makefile: add possibility to disable NEON extension
5
6README states that the NEON extension is optional. However, currently it
7cannot be turned off, therefore add an option to disable it.
8
9Upstream-Status: Submitted [https://github.com/cisco/openh264/pull/3679]
10Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
11---
12 Makefile | 1 +
13 build/arch.mk | 4 ++++
14 build/msvc-common.mk | 10 ++++++++--
15 build/platform-mingw_nt.mk | 5 ++++-
16 4 files changed, 17 insertions(+), 3 deletions(-)
17
18diff --git a/Makefile b/Makefile
19index baed53a7..cc22c4aa 100644
20--- a/Makefile
21+++ b/Makefile
22@@ -35,6 +35,7 @@ CCASFLAGS=$(CFLAGS)
23 STATIC_LDFLAGS=-lstdc++
24 STRIP ?= strip
25 USE_STACK_PROTECTOR = Yes
26+USE_NEON=Yes
27
28 SHAREDLIB_MAJORVERSION=7
29 FULL_VERSION := 2.3.1
30diff --git a/build/arch.mk b/build/arch.mk
31index 4e1538c4..fd6a81e4 100644
32--- a/build/arch.mk
33+++ b/build/arch.mk
34@@ -17,18 +17,22 @@ ifneq ($(filter-out arm64 arm64e, $(filter arm%, $(ARCH))),)
35 ifeq ($(USE_ASM), Yes)
36 ASM_ARCH = arm
37 ASMFLAGS += -I$(SRC_PATH)codec/common/arm/
38+ifeq ($(USE_NEON), Yes)
39 CFLAGS += -DHAVE_NEON
40 endif
41 endif
42+endif
43
44 #for arm64
45 ifneq ($(filter arm64 aarch64 arm64e, $(ARCH)),)
46 ifeq ($(USE_ASM), Yes)
47 ASM_ARCH = arm64
48 ASMFLAGS += -I$(SRC_PATH)codec/common/arm64/
49+ifeq ($(USE_NEON), Yes)
50 CFLAGS += -DHAVE_NEON_AARCH64
51 endif
52 endif
53+endif
54
55 #for mips
56 ifneq ($(filter mips mips64, $(ARCH)),)
57diff --git a/build/msvc-common.mk b/build/msvc-common.mk
58index 5891ea4e..5a1e2582 100644
59--- a/build/msvc-common.mk
60+++ b/build/msvc-common.mk
61@@ -10,7 +10,10 @@ else
62 endif
63 ifeq ($(ASM_ARCH), arm)
64 CCAS = gas-preprocessor.pl -as-type armasm -force-thumb -- armasm
65-CCASFLAGS = -nologo -DHAVE_NEON -ignore 4509
66+CCASFLAGS = -nologo -ignore 4509
67+ifeq ($(USE_NEON), Yes)
68+CCASFLAGS += -DHAVE_NEON
69+endif
70 endif
71
72 CC=cl
73@@ -20,7 +23,10 @@ CXX_O=-Fo$@
74
75 ifeq ($(ASM_ARCH), arm64)
76 CCAS = clang-cl
77-CCASFLAGS = -nologo -DHAVE_NEON_AARCH64 --target=arm64-windows
78+CCASFLAGS = -nologo --target=arm64-windows
79+ifeq ($(USE_NEON), Yes)
80+CCASFLAGS += -DHAVE_NEON_AARCH64
81+endif
82 endif
83
84
85diff --git a/build/platform-mingw_nt.mk b/build/platform-mingw_nt.mk
86index b7a5495d..d73e362a 100644
87--- a/build/platform-mingw_nt.mk
88+++ b/build/platform-mingw_nt.mk
89@@ -17,7 +17,10 @@ endif
90 endif
91 ifeq ($(ASM_ARCH), arm)
92 CCAS = gas-preprocessor.pl -as-type clang -force-thumb -- $(CC)
93-CCASFLAGS = -DHAVE_NEON -mimplicit-it=always
94+CCASFLAGS = -mimplicit-it=always
95+ifeq ($(USE_NEON), Yes)
96+CCASFLAGS += -DHAVE_NEON
97+endif
98 endif
99 EXEEXT = .exe
100
101--
1022.34.1
103
diff --git a/meta-multimedia/recipes-multimedia/openh264/openh264_2.3.1.bb b/meta-multimedia/recipes-multimedia/openh264/openh264_2.3.1.bb
index 89b1ea58c..6dfd75935 100644
--- a/meta-multimedia/recipes-multimedia/openh264/openh264_2.3.1.bb
+++ b/meta-multimedia/recipes-multimedia/openh264/openh264_2.3.1.bb
@@ -16,6 +16,7 @@ SRCREV = "0a48f4d2e9be2abb4fb01b4c3be83cf44ce91a6e"
16BRANCH = "openh264v${PV}" 16BRANCH = "openh264v${PV}"
17SRC_URI = "git://github.com/cisco/openh264.git;protocol=https;branch=${BRANCH} \ 17SRC_URI = "git://github.com/cisco/openh264.git;protocol=https;branch=${BRANCH} \
18 file://0001-Makefile-Use-cp-options-to-preserve-file-mode.patch \ 18 file://0001-Makefile-Use-cp-options-to-preserve-file-mode.patch \
19 file://0002-Makefile-add-possibility-to-disable-NEON-extension.patch \
19 " 20 "
20 21
21COMPATIBLE_MACHINE:armv7a = "(.*)" 22COMPATIBLE_MACHINE:armv7a = "(.*)"
@@ -35,6 +36,9 @@ EXTRA_OEMAKE:mips = "ARCH=mips"
35EXTRA_OEMAKE:mips64 = "ARCH=mips64" 36EXTRA_OEMAKE:mips64 = "ARCH=mips64"
36EXTRA_OEMAKE:riscv64 = "ARCH=riscv64" 37EXTRA_OEMAKE:riscv64 = "ARCH=riscv64"
37 38
39EXTRA_OEMAKE:append:armv7a = "${@bb.utils.contains("TUNE_FEATURES","neon",""," USE_NEON=No",d)}"
40EXTRA_OEMAKE:append:armv7ve = "${@bb.utils.contains("TUNE_FEATURES","neon",""," USE_NEON=No",d)}"
41
38EXTRA_OEMAKE:append = " ENABLEPIC=Yes" 42EXTRA_OEMAKE:append = " ENABLEPIC=Yes"
39do_configure() { 43do_configure() {
40 : 44 :