diff options
author | Mingli Yu <mingli.yu@windriver.com> | 2021-07-02 16:09:51 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-07-02 23:14:33 +0100 |
commit | 692c2b365242b801cee99c60267cc8b2cfea960d (patch) | |
tree | c5adb4f221473da90a4e202ca0e1f1a624cf5f70 /meta/recipes-multimedia/pulseaudio | |
parent | 6a9449f0c1d51eda782d482146ef9ecfb9565adf (diff) | |
download | poky-692c2b365242b801cee99c60267cc8b2cfea960d.tar.gz |
pulseaudio: check if NEON code can be compiled on arm
Backport a patch to check if NEON code can be compiled on arm to
fix below issue:
| /prj/tmp-glibc/work/armv5e-wrs-linux-gnueabi/pulseaudio/14.0-r0/recipe-sysroot-native/usr/lib/arm-wrs-linux-gnueabi/gcc/arm-wrs-linux-gnueabi/10.2.0/include/arm_neon.h:31:2: error: #error "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
| 31 | #error "NEON intrinsics not available with the soft-float ABI. Please use -mfloat-abi=softfp or -mfloat-abi=hard"
| ^~~~~
| ../pulseaudio-14.0/src/pulsecore/mix_neon.c: In function 'pa_mix_ch2_s16ne_neon':
| ../pulseaudio-14.0/src/pulsecore/mix_neon.c:38:9: error: unknown type name 'int32x4_t'; did you mean 'int32_t'?
| 38 | int32x4_t sum0, sum1;
(From OE-Core rev: 79dedfbae5edceecca2b0abfacb3c61abcab7cfa)
Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
Tested-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia/pulseaudio')
-rw-r--r-- | meta/recipes-multimedia/pulseaudio/pulseaudio/0001-build-sys-meson-check-if-NEON-code-can-be-compiled-o.patch | 71 | ||||
-rw-r--r-- | meta/recipes-multimedia/pulseaudio/pulseaudio_14.2.bb | 1 |
2 files changed, 72 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-build-sys-meson-check-if-NEON-code-can-be-compiled-o.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-build-sys-meson-check-if-NEON-code-can-be-compiled-o.patch new file mode 100644 index 0000000000..5d9370fb16 --- /dev/null +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-build-sys-meson-check-if-NEON-code-can-be-compiled-o.patch | |||
@@ -0,0 +1,71 @@ | |||
1 | From 09f846fbdeb19193e778ce51baa77bd03c38372e Mon Sep 17 00:00:00 2001 | ||
2 | From: garrison <garrison@qemu15.qemu-network> | ||
3 | Date: Fri, 4 Jun 2021 22:13:02 +0000 | ||
4 | Subject: [PATCH] build-sys: meson: check if NEON code can be compiled on arm | ||
5 | |||
6 | When Meson SIMD module returns HAVE_NEON=1 on arm host, do extra compile check | ||
7 | to verify compiler can actually handle NEON code. | ||
8 | |||
9 | Related Meson issue #6361 https://github.com/mesonbuild/meson/issues/6361 | ||
10 | |||
11 | Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/574> | ||
12 | |||
13 | Upstream-Status: Backport[https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/6d2a49a6a1eacc2096d0d9473a074421c181ab56] | ||
14 | |||
15 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
16 | --- | ||
17 | src/pulsecore/meson.build | 41 +++++++++++++++++++++++++++++---------- | ||
18 | 1 file changed, 31 insertions(+), 10 deletions(-) | ||
19 | |||
20 | diff --git a/src/pulsecore/meson.build b/src/pulsecore/meson.build | ||
21 | index 99a702e..d0b7990 100644 | ||
22 | --- a/src/pulsecore/meson.build | ||
23 | +++ b/src/pulsecore/meson.build | ||
24 | @@ -172,16 +172,37 @@ endif | ||
25 | |||
26 | # FIXME: SIMD support (ORC) | ||
27 | simd = import('unstable-simd') | ||
28 | -libpulsecore_simd = simd.check('libpulsecore_simd', | ||
29 | - mmx : ['remap_mmx.c', 'svolume_mmx.c'], | ||
30 | - sse : ['remap_sse.c', 'sconv_sse.c', 'svolume_sse.c'], | ||
31 | - neon : ['remap_neon.c', 'sconv_neon.c', 'mix_neon.c'], | ||
32 | - c_args : [pa_c_args], | ||
33 | - include_directories : [configinc, topinc], | ||
34 | - implicit_include_directories : false, | ||
35 | - compiler : cc) | ||
36 | -libpulsecore_simd_lib = libpulsecore_simd[0] | ||
37 | -cdata.merge_from(libpulsecore_simd[1]) | ||
38 | +simd_variants = [ | ||
39 | + { 'mmx' : ['remap_mmx.c', 'svolume_mmx.c'] }, | ||
40 | + { 'sse' : ['remap_sse.c', 'sconv_sse.c', 'svolume_sse.c'] }, | ||
41 | + { 'neon' : ['remap_neon.c', 'sconv_neon.c', 'mix_neon.c'] }, | ||
42 | +] | ||
43 | + | ||
44 | +libpulsecore_simd_lib = [] | ||
45 | + | ||
46 | +foreach simd_kwargs : simd_variants | ||
47 | + | ||
48 | + if host_machine.cpu_family() == 'arm' and 'neon' in simd_kwargs | ||
49 | + if not cc.compiles(''' | ||
50 | + #include <arm_neon.h> | ||
51 | + int main() { | ||
52 | + return sizeof(uint8x8_t) + sizeof(int32x4_t) + sizeof(float32x4_t); | ||
53 | + } | ||
54 | + ''', name : 'neon code') | ||
55 | + continue | ||
56 | + endif | ||
57 | + endif | ||
58 | + | ||
59 | + libpulsecore_simd = simd.check('libpulsecore_simd', | ||
60 | + kwargs : simd_kwargs, | ||
61 | + c_args : [pa_c_args], | ||
62 | + include_directories : [configinc, topinc], | ||
63 | + implicit_include_directories : false, | ||
64 | + compiler : cc) | ||
65 | + | ||
66 | + libpulsecore_simd_lib += libpulsecore_simd[0] | ||
67 | + cdata.merge_from(libpulsecore_simd[1]) | ||
68 | +endforeach | ||
69 | |||
70 | # FIXME: Implement Windows support | ||
71 | #'mutex-win32.c', | ||
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_14.2.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_14.2.bb index 9b8338a665..a7ea8caccb 100644 --- a/meta/recipes-multimedia/pulseaudio/pulseaudio_14.2.bb +++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_14.2.bb | |||
@@ -7,6 +7,7 @@ SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \ | |||
7 | file://0001-meson-Check-for-__get_cpuid.patch \ | 7 | file://0001-meson-Check-for-__get_cpuid.patch \ |
8 | file://volatiles.04_pulse \ | 8 | file://volatiles.04_pulse \ |
9 | file://0001-doxygen-meson.build-remove-dependency-on-doxygen-bin.patch \ | 9 | file://0001-doxygen-meson.build-remove-dependency-on-doxygen-bin.patch \ |
10 | file://0001-build-sys-meson-check-if-NEON-code-can-be-compiled-o.patch \ | ||
10 | " | 11 | " |
11 | SRC_URI[md5sum] = "1efc916251910f1e9d4df7810e3e69f8" | 12 | SRC_URI[md5sum] = "1efc916251910f1e9d4df7810e3e69f8" |
12 | SRC_URI[sha256sum] = "75d3f7742c1ae449049a4c88900e454b8b350ecaa8c544f3488a2562a9ff66f1" | 13 | SRC_URI[sha256sum] = "75d3f7742c1ae449049a4c88900e454b8b350ecaa8c544f3488a2562a9ff66f1" |