[Buildroot] [PATCH 1/1] package/pipewire: fix uclibc build

Fabrice Fontaine fontaine.fabrice at gmail.com
Sun May 29 21:05:54 UTC 2022


Yann,

Le dim. 29 mai 2022 à 23:02, Yann E. MORIN <yann.morin.1998 at free.fr> a écrit :
>
> Fabrice, All,
>
> On 2022-05-27 14:27 +0200, Fabrice Fontaine spake thusly:
> > Fix the following uclibc build failure:
> >
> > /home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/10.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: src/pipewire/libpipewire-0.3.so.0.351.0.p/introspect.c.o: in function `pw_node_info_merge':
> > /home/buildroot/autobuild/instance-0/output-1/build/pipewire-0.3.51/build/../src/pipewire/introspect.c:216: undefined reference to `reallocarray'
> >
> > Fixes:
> >  - http://autobuild.buildroot.org/results/374582f75713c4116ae23f972c5bc55214879502
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
>
> This patch is marked "Superseded" in patchwork, is that expected?

Yes, this patch is broken and raises a runtime build failure with
glibc (and reallocarray).
Upstream applies [1] to "fix" it.
However, reallocarray detection is still broken, a MR is pending [2].

[1] https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/3e7f975f83c7918dea1c02a5bf334940e82c2591
[2] https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1251
>
> Regards,
> Yann E. MORIN.
>
> > ---
> >  .../0001-fix-build-without-reallocarray.patch | 46 +++++++++++++++++++
> >  1 file changed, 46 insertions(+)
> >  create mode 100644 package/pipewire/0001-fix-build-without-reallocarray.patch
> >
> > diff --git a/package/pipewire/0001-fix-build-without-reallocarray.patch b/package/pipewire/0001-fix-build-without-reallocarray.patch
> > new file mode 100644
> > index 0000000000..ee80dfb3bb
> > --- /dev/null
> > +++ b/package/pipewire/0001-fix-build-without-reallocarray.patch
> > @@ -0,0 +1,46 @@
> > +From 0708a39b439cec2871cfe3b705191028397e5b8b Mon Sep 17 00:00:00 2001
> > +From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > +Date: Fri, 27 May 2022 10:57:50 +0200
> > +Subject: [PATCH] src/pipewire/utils.h: fix build without reallocarray
> > +
> > +Fix the following build failure without reallocarray (e.g. on uclibc):
> > +
> > +/home/buildroot/autobuild/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/mipsel-buildroot-linux-uclibc/10.3.0/../../../../mipsel-buildroot-linux-uclibc/bin/ld: src/pipewire/libpipewire-0.3.so.0.351.0.p/introspect.c.o: in function `pw_node_info_merge':
> > +/home/buildroot/autobuild/instance-0/output-1/build/pipewire-0.3.51/build/../src/pipewire/introspect.c:216: undefined reference to `reallocarray'
> > +
> > +Fixes:
> > + - http://autobuild.buildroot.org/results/374582f75713c4116ae23f972c5bc55214879502
> > +
> > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > +[Retrieved from:
> > +https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/0708a39b439cec2871cfe3b705191028397e5b8b]
> > +---
> > + src/pipewire/utils.h | 5 +++++
> > + 1 file changed, 5 insertions(+)
> > +
> > +diff --git a/src/pipewire/utils.h b/src/pipewire/utils.h
> > +index 351216eb3..5a0dc6fd2 100644
> > +--- a/src/pipewire/utils.h
> > ++++ b/src/pipewire/utils.h
> > +@@ -29,6 +29,7 @@
> > + extern "C" {
> > + #endif
> > +
> > ++#include <stdlib.h>
> > + #include <string.h>
> > + #include <sys/un.h>
> > + #ifndef _POSIX_C_SOURCE
> > +@@ -86,6 +87,10 @@ pw_strip(char *str, const char *whitespace);
> > + #endif
> > +
> > + ssize_t pw_getrandom(void *buf, size_t buflen, unsigned int flags);
> > ++
> > ++#if !defined(reallocarray)
> > ++# define reallocarray(ptr, nmemb, size)             realloc(ptr, nmemb * size)
> > ++#endif
> > + /**
> > +  * \}
> > +  */
> > +--
> > +GitLab
> > +
> > --
> > 2.35.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at buildroot.org
> > https://lists.buildroot.org/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'

Best Regards,

Fabrice



More information about the buildroot mailing list