mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	meson.build: fix build with uclibc-ng
Build with uclib-ng fails since commit
a4b0b9afe5 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 <fontaine.fabrice@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									5f09b9f4d1
								
							
						
					
					
						commit
						ce89ce3844
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -274,7 +274,7 @@ if cc.has_function('memfd_create', prefix : '#include <sys/mman.h>', args : [ '- | |||
|   cdata.set('HAVE_MEMFD_CREATE', 1) | ||||
| endif | ||||
| 
 | ||||
| if cc.has_function('getrandom', prefix : '#include <sys/random.h>') | ||||
| if cc.has_function('getrandom', prefix : '#include <sys/random.h>', args : [ '-D_GNU_SOURCE' ]) | ||||
|   cdata.set('HAVE_GETRANDOM', 1) | ||||
| endif | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Fabrice Fontaine
						Fabrice Fontaine