Hello.
While building PulseAudio with the latest Glibc-2.27 I get the following error:
[...]
In file included from pulsecore/shm.c:48:0:
./pulsecore/memfd-wrappers.h:36:19: error: static declaration of 'memfd_create'
follows non-static declaration
static inline int memfd_create(const char *name, unsigned int flags) {
^~~~~~~~~~~~
In file included from /usr/include/bits/mman-linux.h:115:0,
from /usr/include/bits/mman.h:45,
from /usr/include/sys/mman.h:41,
from pulsecore/shm.c:37:
/usr/include/bits/mman-shared.h:46:5: note: previous declaration of
'memfd_create' was here
int memfd_create (const char *__name, unsigned int __flags) __THROW;
^~~~~~~~~~~~
make[3]: *** [Makefile:8008: pulsecore/libpulsecommon_11.1_la-shm.lo] Error 1
[...]
I've included a patch that fixes the issue.
Reference: https://patchwork.openembedded.org/patch/147648/
Regards,
Ryan
--
Ryan Marsaw
[email protected]--- pulseaudio-11.1-orig/configure.ac 2017-09-05 06:46:23.000000000 -0400
+++ pulseaudio-11.1/configure.ac 2018-02-04 14:46:52.647465714 -0500
@@ -603,6 +603,10 @@
AC_CHECK_DECL(SYS_memfd_create, [HAVE_MEMFD=1], [HAVE_MEMFD=0], [#include
<sys/syscall.h>]),
[HAVE_MEMFD=0])
+AS_IF([test "x$enable_memfd" != "xno"],
+ AC_CHECK_FUNC(memfd_create, [HAVE_MEMFD_CREATE=1], [HAVE_MEMFD_CREATE=0],
[#include <sys/mman.h>]),
+ [HAVE_MEMFD_CREATE=0])
+
AS_IF([test "x$enable_memfd" = "xyes" && test "x$HAVE_MEMFD" = "x0"],
[AC_MSG_ERROR([*** Your Linux kernel does not support memfd shared memory.
*** Use linux v3.17 or higher for such a feature.])])
@@ -610,6 +614,9 @@
AC_SUBST(HAVE_MEMFD)
AM_CONDITIONAL([HAVE_MEMFD], [test "x$HAVE_MEMFD" = x1])
AS_IF([test "x$HAVE_MEMFD" = "x1"], AC_DEFINE([HAVE_MEMFD], 1, [Have memfd
shared memory.]))
+AC_SUBST(HAVE_MEMFD_CREATE)
+AM_CONDITIONAL([HAVE_MEMFD_CREATE], [test "x$HAVE_MEMFD_CREATE" = x1])
+AS_IF([test "x$HAVE_MEMFD_CREATE" = "x1"], AC_DEFINE([HAVE_MEMFD_CREATE], 1,
[Define to 1 if you have the `memfd_create` function.]))
#### X11 (optional) ####
--- pulseaudio-11.1-orig/src/pulsecore/memfd-wrappers.h 2016-08-23
08:50:11.000000000 -0400
+++ pulseaudio-11.1/src/pulsecore/memfd-wrappers.h 2018-02-04
14:46:52.648465714 -0500
@@ -32,11 +32,11 @@
* defined in the kernel header file <linux/fcntl.h>, that file as
* a whole conflicts with the original glibc header <fnctl.h>.
*/
-
+#ifndef HAVE_MEMFD_CREATE
static inline int memfd_create(const char *name, unsigned int flags) {
return syscall(SYS_memfd_create, name, flags);
}
-
+#endif
/* memfd_create(2) flags */
#ifndef MFD_CLOEXEC
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page