From: Fabrice Fontaine Date: Wed, 9 Jun 2021 17:11:27 +0000 (+0200) Subject: package/pipewire: remove already-applied patch and renumber X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=026d447c2c2a3b0092c45c2afa3d17284aa31276;p=buildroot.git package/pipewire: remove already-applied patch and renumber Drop 0002-meson.build-fix-build-with-uclibc-ng.patch which is not needed since 0dda1a44a0859fc15b318e493c151ca1d807ba24 which has been merged in master in commit 8d07baab43b5624ad6d73ee58f5a9d4ab8b27049 While at it, renumber 0002-meson-fix-getrandom-detection-for-uclibc.patch to 0001-meson-fix-getrandom-detection-for-uclibc.patch (patch number was wrong since its addition in commit b003cb5d16de9c92baba7dea7a6626c71cefc4fb) and also renumber remaining patch Fixes: - http://autobuild.buildroot.org/results/4d442c61b137ca1bd2dd32c6802ff0251d39e7a5 Signed-off-by: Fabrice Fontaine Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- diff --git a/package/pipewire/0001-meson-fix-getrandom-detection-for-uclibc.patch b/package/pipewire/0001-meson-fix-getrandom-detection-for-uclibc.patch new file mode 100644 index 0000000000..e902869ce9 --- /dev/null +++ b/package/pipewire/0001-meson-fix-getrandom-detection-for-uclibc.patch @@ -0,0 +1,49 @@ +From a36bc959768e100d2d72e027746e3a9d95cf29af Mon Sep 17 00:00:00 2001 +From: Peter Seiderer +Date: Wed, 12 May 2021 22:08:39 +0200 +Subject: [PATCH] meson: fix getrandom detection for uclibc +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The getrandom() detection from meson.build failes with the following error +message: + + .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t' + 27 | extern int getrandom(void *__buf, size_t count, unsigned int flags) + | ^~~~~~ + .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header ''; did you forget to '#include '? + +Fix it by adding stddef.h include to the meson getrandom() detection. + +Fixes: + + ../src/pipewire/impl-core.c:54:9: error: conflicting types for ‘getrandom’ + 54 | ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { + | ^~~~~~~~~ + In file included from ../src/pipewire/impl-core.c:34: + .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:12: note: previous declaration of ‘getrandom’ was here + 27 | extern int getrandom(void *__buf, size_t count, unsigned int flags) + | ^~~~~~~~~ + +Signed-off-by: Peter Seiderer +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 03a9d174..01b4c7c8 100644 +--- a/meson.build ++++ b/meson.build +@@ -274,7 +274,7 @@ if cc.has_function('memfd_create', prefix : '#include ', args : [ '- + cdata.set('HAVE_MEMFD_CREATE', 1) + endif + +-if cc.has_function('getrandom', prefix : '#include ', args : [ '-D_GNU_SOURCE' ]) ++if cc.has_function('getrandom', prefix : '#include \n#include ', args : [ '-D_GNU_SOURCE' ]) + cdata.set('HAVE_GETRANDOM', 1) + endif + +-- +2.31.1 + diff --git a/package/pipewire/0002-fix-linking-with-latomic.patch b/package/pipewire/0002-fix-linking-with-latomic.patch new file mode 100644 index 0000000000..77132173e4 --- /dev/null +++ b/package/pipewire/0002-fix-linking-with-latomic.patch @@ -0,0 +1,108 @@ +From 5068aa54bde4e40d6faa8de43d93216bc3001a3e Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 21 May 2021 07:47:46 +0200 +Subject: [PATCH] fix linking with -latomic + +Linking with -latomic has been added to pipewire-jack since +https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/b8c58c74d835ee2918f9e391abd65f9e0132bdb4 + +However, this is not the right place to add this dependency, atomic_dep +should be added to pipewire_dep to avoid the following build failure: + +/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/9.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/pipewire/libpipewire-0.3.so.0.326.0.p/filter.c.o: in function `impl_node_process': +filter.c:(.text+0xf28): undefined reference to `__atomic_fetch_add_4' + +Indeed, atomic operation such as __atomic_fetch_add is used in libcamera +as well as in ./spa/plugins/libcamera/libcamera_wrapper.cpp, +./spa/include/spa/utils/ringbuffer.h and ./spa/include/spa/graph/graph.h + +Fixes: + - http://autobuild.buildroot.org/results/b5305e8e7dd1a5e8bfaba72b06251056ba7d1af1 + +Signed-off-by: Fabrice Fontaine +[Upstream status: +https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/689] +--- + meson.build | 11 +++++------ + pipewire-jack/src/meson.build | 4 ++-- + src/pipewire/meson.build | 4 ++-- + 3 files changed, 9 insertions(+), 10 deletions(-) + +diff --git a/meson.build b/meson.build +index b6b4553b..1308373a 100644 +--- a/meson.build ++++ b/meson.build +@@ -157,7 +157,7 @@ test_8_byte_atomic = ''' + int main(void) + { + int64_t eight; +- __atomic_store_n(&eight, 123, __ATOMIC_SEQ_CST); ++ __atomic_fetch_add(&eight, 123, __ATOMIC_SEQ_CST); + return 0; + } + ''' +@@ -166,16 +166,15 @@ int main(void) + # operations on any reasonable architecture. + if cc.links( + test_8_byte_atomic, +- name : '8-byte __atomic_store_n without libatomic') ++ name : '8-byte __atomic_fetch_add without libatomic') + atomic_dep = dependency('', required: false) + elif cc.links( + test_8_byte_atomic, + dependencies : libatomic, +- name : '8-byte __atomic_store_n with libatomic') ++ name : '8-byte __atomic_fetch_add with libatomic') + atomic_dep = libatomic +-elif get_option('pipewire-jack').enabled() +- # Currently only required for the JACK backend +- error('8-byte atomic operations are required for pipewire-jack') ++else ++ error('8-byte atomic operations are required') + endif + + cdata = configuration_data() +diff --git a/pipewire-jack/src/meson.build b/pipewire-jack/src/meson.build +index 83e340ba..386abc7f 100644 +--- a/pipewire-jack/src/meson.build ++++ b/pipewire-jack/src/meson.build +@@ -42,7 +42,7 @@ pipewire_jack = shared_library('jack', + version : libversion, + c_args : pipewire_jack_c_args, + include_directories : [configinc, jack_inc], +- dependencies : [pipewire_dep, atomic_dep, mathlib], ++ dependencies : [pipewire_dep, mathlib], + install : true, + install_dir : libjack_path, + ) +@@ -53,7 +53,7 @@ pipewire_jackserver = shared_library('jackserver', + version : libversion, + c_args : pipewire_jack_c_args, + include_directories : [configinc, jack_inc], +- dependencies : [pipewire_dep, atomic_dep, mathlib], ++ dependencies : [pipewire_dep, mathlib], + install : true, + install_dir : libjack_path, + ) +diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build +index e80f3633..0fa6643a 100644 +--- a/src/pipewire/meson.build ++++ b/src/pipewire/meson.build +@@ -102,12 +102,12 @@ libpipewire = shared_library(pipewire_name, pipewire_sources, + c_args : libpipewire_c_args, + include_directories : [pipewire_inc, configinc, spa_inc], + install : true, +- dependencies : [dl_lib, mathlib, pthread_lib, libintl_dep, ], ++ dependencies : [dl_lib, mathlib, pthread_lib, libintl_dep, atomic_dep, ], + ) + + pipewire_dep = declare_dependency(link_with : libpipewire, + include_directories : [pipewire_inc, configinc, spa_inc], +- dependencies : [pthread_lib, ], ++ dependencies : [pthread_lib, atomic_dep, ], + ) + + pkgconfig.generate(filebase : 'lib@0@'.format(pipewire_name), +-- +2.30.2 + diff --git a/package/pipewire/0002-meson-fix-getrandom-detection-for-uclibc.patch b/package/pipewire/0002-meson-fix-getrandom-detection-for-uclibc.patch deleted file mode 100644 index e902869ce9..0000000000 --- a/package/pipewire/0002-meson-fix-getrandom-detection-for-uclibc.patch +++ /dev/null @@ -1,49 +0,0 @@ -From a36bc959768e100d2d72e027746e3a9d95cf29af Mon Sep 17 00:00:00 2001 -From: Peter Seiderer -Date: Wed, 12 May 2021 22:08:39 +0200 -Subject: [PATCH] meson: fix getrandom detection for uclibc -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The getrandom() detection from meson.build failes with the following error -message: - - .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:35: error: unknown type name 'size_t' - 27 | extern int getrandom(void *__buf, size_t count, unsigned int flags) - | ^~~~~~ - .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:8:1: note: 'size_t' is defined in header ''; did you forget to '#include '? - -Fix it by adding stddef.h include to the meson getrandom() detection. - -Fixes: - - ../src/pipewire/impl-core.c:54:9: error: conflicting types for ‘getrandom’ - 54 | ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { - | ^~~~~~~~~ - In file included from ../src/pipewire/impl-core.c:34: - .../host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:27:12: note: previous declaration of ‘getrandom’ was here - 27 | extern int getrandom(void *__buf, size_t count, unsigned int flags) - | ^~~~~~~~~ - -Signed-off-by: Peter Seiderer ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 03a9d174..01b4c7c8 100644 ---- a/meson.build -+++ b/meson.build -@@ -274,7 +274,7 @@ if cc.has_function('memfd_create', prefix : '#include ', args : [ '- - cdata.set('HAVE_MEMFD_CREATE', 1) - endif - --if cc.has_function('getrandom', prefix : '#include ', args : [ '-D_GNU_SOURCE' ]) -+if cc.has_function('getrandom', prefix : '#include \n#include ', args : [ '-D_GNU_SOURCE' ]) - cdata.set('HAVE_GETRANDOM', 1) - endif - --- -2.31.1 - diff --git a/package/pipewire/0002-meson.build-fix-build-with-uclibc-ng.patch b/package/pipewire/0002-meson.build-fix-build-with-uclibc-ng.patch deleted file mode 100644 index 36b14d3f16..0000000000 --- a/package/pipewire/0002-meson.build-fix-build-with-uclibc-ng.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 8f1de87381d270a8f4e5927187ae0466a9c9504a Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Tue, 4 May 2021 22:56:54 +0200 -Subject: [PATCH] meson.build: fix build with uclibc-ng - -Build with uclib-ng fails since commit -a4b0b9afe5a782a7f4a8fe153ecf51bcb0180ae3 on: - -FAILED: src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o -/srv/storage/autobuild/run/instance-2/output-1/host/bin/mips64el-linux-gcc -Isrc/pipewire/libpipewire-0.3.so.0.326.0.p -Isrc/pipewire -I../src/pipewire -Isrc -I../src -I. -I.. -Ispa/include -I../spa/include -fdiagnostics-color=always -pipe -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -O3 -fvisibility=hidden -Werror=suggest-attribute=format -Wsign-compare -Wpointer-arith -Wpointer-sign -Wformat -Wformat-security -Wimplicit-fallthrough -Wmissing-braces -Wtype-limits -Wvariadic-macros -Wno-missing-field-initializers -Wno-unused-parameter -Wno-pedantic -Wold-style-declaration -Wunused-result -DFASTPATH -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fPIC -pthread -DHAVE_CONFIG_H -D_GNU_SOURCE -D_POSIX_C_SOURCE -MD -MQ src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o -MF src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o.d -o src/pipewire/libpipewire-0.3.so.0.326.0.p/impl-core.c.o -c ../src/pipewire/impl-core.c -../src/pipewire/impl-core.c:54:9: error: conflicting types for 'getrandom' - ssize_t getrandom(void *buf, size_t buflen, unsigned int flags) { - ^~~~~~~~~ -In file included from ../src/pipewire/impl-core.c:34: -/srv/storage/autobuild/run/instance-2/output-1/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/sys/random.h:28:12: note: previous declaration of 'getrandom' was here - extern int getrandom(void *__buf, size_t count, unsigned int flags) - ^~~~~~~~~ - -Fix this build failure by adding -D_GNU_SOURCE as getrandom is protected -by: - -if defined __UCLIBC_LINUX_SPECIFIC__ && defined __USE_GNU - -Extracted from: - - https://github.com/wbx-github/uclibc-ng/blob/master/libc/sysdeps/linux/common/sys/random.h - -Fixes: - - http://autobuild.buildroot.org/results/a45f0ee009d90cef867dee4b1093225610fa10df - -Signed-off-by: Fabrice Fontaine -[Upstream status: -https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/649] ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 0a9963fb..11b63c08 100644 ---- a/meson.build -+++ b/meson.build -@@ -274,7 +274,7 @@ if cc.has_function('memfd_create', prefix : '#include ', args : [ '- - cdata.set('HAVE_MEMFD_CREATE', 1) - endif - --if cc.has_function('getrandom', prefix : '#include ') -+if cc.has_function('getrandom', prefix : '#include ', args : [ '-D_GNU_SOURCE' ]) - cdata.set('HAVE_GETRANDOM', 1) - endif - --- -2.30.2 - diff --git a/package/pipewire/0003-fix-linking-with-latomic.patch b/package/pipewire/0003-fix-linking-with-latomic.patch deleted file mode 100644 index 77132173e4..0000000000 --- a/package/pipewire/0003-fix-linking-with-latomic.patch +++ /dev/null @@ -1,108 +0,0 @@ -From 5068aa54bde4e40d6faa8de43d93216bc3001a3e Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Fri, 21 May 2021 07:47:46 +0200 -Subject: [PATCH] fix linking with -latomic - -Linking with -latomic has been added to pipewire-jack since -https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/b8c58c74d835ee2918f9e391abd65f9e0132bdb4 - -However, this is not the right place to add this dependency, atomic_dep -should be added to pipewire_dep to avoid the following build failure: - -/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/9.3.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: src/pipewire/libpipewire-0.3.so.0.326.0.p/filter.c.o: in function `impl_node_process': -filter.c:(.text+0xf28): undefined reference to `__atomic_fetch_add_4' - -Indeed, atomic operation such as __atomic_fetch_add is used in libcamera -as well as in ./spa/plugins/libcamera/libcamera_wrapper.cpp, -./spa/include/spa/utils/ringbuffer.h and ./spa/include/spa/graph/graph.h - -Fixes: - - http://autobuild.buildroot.org/results/b5305e8e7dd1a5e8bfaba72b06251056ba7d1af1 - -Signed-off-by: Fabrice Fontaine -[Upstream status: -https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/689] ---- - meson.build | 11 +++++------ - pipewire-jack/src/meson.build | 4 ++-- - src/pipewire/meson.build | 4 ++-- - 3 files changed, 9 insertions(+), 10 deletions(-) - -diff --git a/meson.build b/meson.build -index b6b4553b..1308373a 100644 ---- a/meson.build -+++ b/meson.build -@@ -157,7 +157,7 @@ test_8_byte_atomic = ''' - int main(void) - { - int64_t eight; -- __atomic_store_n(&eight, 123, __ATOMIC_SEQ_CST); -+ __atomic_fetch_add(&eight, 123, __ATOMIC_SEQ_CST); - return 0; - } - ''' -@@ -166,16 +166,15 @@ int main(void) - # operations on any reasonable architecture. - if cc.links( - test_8_byte_atomic, -- name : '8-byte __atomic_store_n without libatomic') -+ name : '8-byte __atomic_fetch_add without libatomic') - atomic_dep = dependency('', required: false) - elif cc.links( - test_8_byte_atomic, - dependencies : libatomic, -- name : '8-byte __atomic_store_n with libatomic') -+ name : '8-byte __atomic_fetch_add with libatomic') - atomic_dep = libatomic --elif get_option('pipewire-jack').enabled() -- # Currently only required for the JACK backend -- error('8-byte atomic operations are required for pipewire-jack') -+else -+ error('8-byte atomic operations are required') - endif - - cdata = configuration_data() -diff --git a/pipewire-jack/src/meson.build b/pipewire-jack/src/meson.build -index 83e340ba..386abc7f 100644 ---- a/pipewire-jack/src/meson.build -+++ b/pipewire-jack/src/meson.build -@@ -42,7 +42,7 @@ pipewire_jack = shared_library('jack', - version : libversion, - c_args : pipewire_jack_c_args, - include_directories : [configinc, jack_inc], -- dependencies : [pipewire_dep, atomic_dep, mathlib], -+ dependencies : [pipewire_dep, mathlib], - install : true, - install_dir : libjack_path, - ) -@@ -53,7 +53,7 @@ pipewire_jackserver = shared_library('jackserver', - version : libversion, - c_args : pipewire_jack_c_args, - include_directories : [configinc, jack_inc], -- dependencies : [pipewire_dep, atomic_dep, mathlib], -+ dependencies : [pipewire_dep, mathlib], - install : true, - install_dir : libjack_path, - ) -diff --git a/src/pipewire/meson.build b/src/pipewire/meson.build -index e80f3633..0fa6643a 100644 ---- a/src/pipewire/meson.build -+++ b/src/pipewire/meson.build -@@ -102,12 +102,12 @@ libpipewire = shared_library(pipewire_name, pipewire_sources, - c_args : libpipewire_c_args, - include_directories : [pipewire_inc, configinc, spa_inc], - install : true, -- dependencies : [dl_lib, mathlib, pthread_lib, libintl_dep, ], -+ dependencies : [dl_lib, mathlib, pthread_lib, libintl_dep, atomic_dep, ], - ) - - pipewire_dep = declare_dependency(link_with : libpipewire, - include_directories : [pipewire_inc, configinc, spa_inc], -- dependencies : [pthread_lib, ], -+ dependencies : [pthread_lib, atomic_dep, ], - ) - - pkgconfig.generate(filebase : 'lib@0@'.format(pipewire_name), --- -2.30.2 -