Bug 104733 - memfd-wrappers.h : conflict with recent glibc
Summary: memfd-wrappers.h : conflict with recent glibc
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
: 104815 (view as bug list)
Depends on:
Blocks: 102546
  Show dependency treegraph
Reported: 2018-01-22 18:16 UTC by Rex Dieter
Modified: 2018-05-16 11:28 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch (2.20 KB, patch)
2018-01-24 01:56 UTC, Tanu Kaskinen
Details | Splinter Review

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:

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]

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]

Review of attachment 136927 [details] [review]:

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)"

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.