[oe-commits] [openembedded-core] 01/65: pulseaudio: Backport a patch to replace use of VLAIS

git at git.openembedded.org git at git.openembedded.org
Mon Sep 11 10:01:51 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit ff980856d1b6ec392d684bfe758c8304933c18bd
Author: Khem Raj <raj.khem at gmail.com>
AuthorDate: Thu Aug 31 22:20:40 2017 -0700

    pulseaudio: Backport a patch to replace use of VLAIS
    
    Fix build with clang
    
    Signed-off-by: Khem Raj <raj.khem at gmail.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 ...-don-t-use-variable-length-array-in-union.patch | 59 ++++++++++++++++++++++
 .../pulseaudio/pulseaudio_10.0.bb                  |  1 +
 2 files changed, 60 insertions(+)

diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-discuss-iochannel-don-t-use-variable-length-array-in-union.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-discuss-iochannel-don-t-use-variable-length-array-in-union.patch
new file mode 100644
index 0000000..11b56ab
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio-discuss-iochannel-don-t-use-variable-length-array-in-union.patch
@@ -0,0 +1,59 @@
+From patchwork Sat Feb  4 12:19:01 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [pulseaudio-discuss] iochannel: don't use variable length array in
+ union
+From: Tanu Kaskinen <tanuk at iki.fi>
+X-Patchwork-Id: 136885
+Message-Id: <20170204121901.17428-1-tanuk at iki.fi>
+To: pulseaudio-discuss at lists.freedesktop.org
+Date: Sat,  4 Feb 2017 14:19:01 +0200
+
+Clang didn't like the variable length array:
+
+pulsecore/iochannel.c:358:17: error: fields must have a constant size:
+'variable length array in structure' extension will never be supported
+        uint8_t data[CMSG_SPACE(sizeof(int) * nfd)];
+                ^
+
+Commit 451d1d6762 introduced the variable length array in order to have
+the correct value in msg_controllen. This patch reverts that commit and
+uses a different way to achieve the same goal.
+
+BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=99458
+---
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+
+ src/pulsecore/iochannel.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/pulsecore/iochannel.c b/src/pulsecore/iochannel.c
+index 8ace297ff..897337522 100644
+--- a/src/pulsecore/iochannel.c
++++ b/src/pulsecore/iochannel.c
+@@ -355,7 +355,7 @@ ssize_t pa_iochannel_write_with_fds(pa_iochannel*io, const void*data, size_t l,
+     struct iovec iov;
+     union {
+         struct cmsghdr hdr;
+-        uint8_t data[CMSG_SPACE(sizeof(int) * nfd)];
++        uint8_t data[CMSG_SPACE(sizeof(int) * MAX_ANCIL_DATA_FDS)];
+     } cmsg;
+ 
+     pa_assert(io);
+@@ -382,7 +382,13 @@ ssize_t pa_iochannel_write_with_fds(pa_iochannel*io, const void*data, size_t l,
+     mh.msg_iov = &iov;
+     mh.msg_iovlen = 1;
+     mh.msg_control = &cmsg;
+-    mh.msg_controllen = sizeof(cmsg);
++
++    /* If we followed the example on the cmsg man page, we'd use
++     * sizeof(cmsg.data) here, but if nfd < MAX_ANCIL_DATA_FDS, then the data
++     * buffer is larger than needed, and the kernel doesn't like it if we set
++     * msg_controllen to a larger than necessary value. The commit message for
++     * commit 451d1d6762 contains a longer explanation. */
++    mh.msg_controllen = CMSG_SPACE(sizeof(int) * nfd);
+ 
+     if ((r = sendmsg(io->ofd, &mh, MSG_NOSIGNAL)) >= 0) {
+         io->writable = io->hungup = false;
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_10.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_10.0.bb
index f3a8573..9a34afa 100644
--- a/meta/recipes-multimedia/pulseaudio/pulseaudio_10.0.bb
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_10.0.bb
@@ -3,6 +3,7 @@ require pulseaudio.inc
 SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
            file://0001-padsp-Make-it-compile-on-musl.patch \
            file://0001-client-conf-Add-allow-autospawn-for-root.patch \
+           file://pulseaudio-discuss-iochannel-don-t-use-variable-length-array-in-union.patch \
            file://volatiles.04_pulse \
 "
 SRC_URI[md5sum] = "4950d2799bf55ab91f6b7f990b7f0971"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list