summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/pulseaudio
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2020-12-20 08:05:35 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-21 22:29:57 +0000
commit41bb5e7cb7ef0ed8a270971444de469db80dadaa (patch)
treeae90c1b7d5794dd6f78d633a1ce0a90fdad57c0a /meta/recipes-multimedia/pulseaudio
parent23999cdaace744c9b82272ff648a7e262145817c (diff)
downloadpoky-41bb5e7cb7ef0ed8a270971444de469db80dadaa.tar.gz
pulseaudio: Fix build with clang for non-x86 target
(From OE-Core rev: 01d21bd4c48aa3f899c012a2c3fd72c689e75944) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Tanu Kaskinen <tanuk@iki.fi> 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-meson-Check-for-__get_cpuid.patch82
-rw-r--r--meta/recipes-multimedia/pulseaudio/pulseaudio_14.0.bb1
2 files changed, 83 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-meson-Check-for-__get_cpuid.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-meson-Check-for-__get_cpuid.patch
new file mode 100644
index 0000000000..c9d8abcbf2
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-meson-Check-for-__get_cpuid.patch
@@ -0,0 +1,82 @@
1From 9d0dc8aedd08d77797f90fa6075a59613f18bf0d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 20 Dec 2020 07:56:07 -0800
4Subject: [PATCH] meson: Check for __get_cpuid
5
6checking for presence of cpuid.h header alone is not sufficient in some case to use
7cpuid related functions. e.g. when using clang which is built for
8multiple targets will have cpuid.h header as part of compiler headers in
9distribution but one maybe compiling pulseaudion for non-x86 target. The
10current check in meson succeeds and then compile fails later because
11cpuid.h is x86-specific header. Therefore checking for symbol that is
12needed makes this robust, so even if header exist it will try to ensure
13the given symbol can be used
14
15Fixes
16src/pulsecore/core-util.c:113:
17| /mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/pulseaudio/14.0-r0/recipe-sysroot-native/usr/lib/clang/11.0.1/include/cpuid.h:11:2: error: this header is for x86 only
18| #error this header is for x86 only
19| ^
20
21Upstream-Status: Pending
22
23Signed-off-by: Khem Raj <raj.khem@gmail.com>
24Cc: Tanu Kaskinen <tanuk@iki.fi>
25---
26 meson.build | 5 ++++-
27 src/pulsecore/core-util.c | 2 +-
28 src/pulsecore/cpu-x86.c | 2 +-
29 3 files changed, 6 insertions(+), 3 deletions(-)
30
31diff --git a/meson.build b/meson.build
32index 2589627..5f5127e 100644
33--- a/meson.build
34+++ b/meson.build
35@@ -185,7 +185,6 @@ endif
36 check_headers = [
37 'arpa/inet.h',
38 'byteswap.h',
39- 'cpuid.h',
40 'dlfcn.h',
41 'execinfo.h',
42 'grp.h',
43@@ -243,6 +242,10 @@ if cc.has_header_symbol('pthread.h', 'PTHREAD_PRIO_INHERIT')
44 cdata.set('HAVE_PTHREAD_PRIO_INHERIT', 1)
45 endif
46
47+if cc.has_header_symbol('cpuid.h', '__get_cpuid')
48+ cdata.set('HAVE_GET_CPUID', 1)
49+endif
50+
51 # Functions
52
53 check_functions = [
54diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
55index 601b1d1..6f34e7c 100644
56--- a/src/pulsecore/core-util.c
57+++ b/src/pulsecore/core-util.c
58@@ -109,7 +109,7 @@
59 #include <sys/personality.h>
60 #endif
61
62-#ifdef HAVE_CPUID_H
63+#ifdef HAVE_GET_CPUID
64 #include <cpuid.h>
65 #endif
66
67diff --git a/src/pulsecore/cpu-x86.c b/src/pulsecore/cpu-x86.c
68index 4e59e14..86595d4 100644
69--- a/src/pulsecore/cpu-x86.c
70+++ b/src/pulsecore/cpu-x86.c
71@@ -24,7 +24,7 @@
72
73 #include <stdint.h>
74
75-#ifdef HAVE_CPUID_H
76+#ifdef HAVE_GET_CPUID
77 #include <cpuid.h>
78 #endif
79
80--
812.29.2
82
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_14.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_14.0.bb
index 63ef3a9c12..fccca1ba48 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio_14.0.bb
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_14.0.bb
@@ -4,6 +4,7 @@ SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
4 file://0001-client-conf-Add-allow-autospawn-for-root.patch \ 4 file://0001-client-conf-Add-allow-autospawn-for-root.patch \
5 file://0002-do-not-display-CLFAGS-to-improve-reproducibility-bui.patch \ 5 file://0002-do-not-display-CLFAGS-to-improve-reproducibility-bui.patch \
6 file://0001-build-sys-Add-an-option-for-enabling-disabling-Valgr.patch \ 6 file://0001-build-sys-Add-an-option-for-enabling-disabling-Valgr.patch \
7 file://0001-meson-Check-for-__get_cpuid.patch \
7 file://volatiles.04_pulse \ 8 file://volatiles.04_pulse \
8 " 9 "
9SRC_URI[md5sum] = "84a7776e63dd55c40db8fbd7c7e2e18e" 10SRC_URI[md5sum] = "84a7776e63dd55c40db8fbd7c7e2e18e"