Bug 104733

Summary: memfd-wrappers.h : conflict with recent glibc
Product: PulseAudio Reporter: Rex Dieter <rdieter>
Component: coreAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart, raj.khem
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 102546    
Attachments: 0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch

Description Rex Dieter 2018-01-22 18:16:52 UTC
Recent glibc now includes a memfd_create implementation, which appears to conflict with the one provided by memfd_wrappers.h

Recent fedora rawhide builds for pulseaudio fail due to this:

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;
     ^~~~~~~~~~~~

(Temporary) link to full build.log:
https://kojipkgs.fedoraproject.org//work/tasks/9404/24079404/build.log

I can attach a copy if desired, but if ~344k size is acceptable
Comment 1 Tanu Kaskinen 2018-01-22 18:46:21 UTC
The build system should check if memfd_create() is available in system headers, and the internal memfd_create() should be defined only if the system implementation isn't available.

Marking as a release blocker.
Comment 2 Tanu Kaskinen 2018-01-24 01:56:44 UTC
Created attachment 136927 [details] [review]
0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch

Here's a patch. I tested it with an old glibc, can you test it with the new one?
Comment 3 Tanu Kaskinen 2018-01-29 00:48:46 UTC
*** Bug 104815 has been marked as a duplicate of this bug. ***
Comment 4 Khem Raj 2018-01-30 04:17:45 UTC
This patch works for me in OE/Yocto
Comment 5 Khem Raj 2018-01-30 04:20:19 UTC
Comment on attachment 136927 [details] [review]
0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch

Review of attachment 136927 [details] [review]:
-----------------------------------------------------------------

+1 LGTM
Comment 6 Tanu Kaskinen 2018-01-31 06:33:01 UTC
Thanks for testing and the review! I applied the patch now.
Comment 7 Albert Astals Cid 2018-05-16 07:32:27 UTC
Could we get a new pulseaudio release to make the life easier for those that like building from released tarballs?
Comment 8 Rex Dieter 2018-05-16 11:28:04 UTC
You're in luck,
"[ANNOUNCE] PulseAudio 11.99.1 (a.k.a. v12.0 release candidate 1)"
https://lists.freedesktop.org/archives/pulseaudio-discuss/2018-May/029927.html

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.