1 Add memfd-create option
3 Add a meson build option, memfd-create, that controls whether the
4 memfd_create system call support will be enabled. The default value
5 is true so that it will be enabled, but it allows users like AGL
6 that currently has issues with security labels and memfd to disable
9 Upstream-Status: Pending
11 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
13 diff --git a/meson.build b/meson.build
14 index 82107e1..9d042ca 100644
17 @@ -78,8 +78,12 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
20 optional_libc_funcs = [
21 - 'mkostemp', 'strchrnul', 'initgroups', 'posix_fallocate', 'memfd_create'
22 + 'mkostemp', 'strchrnul', 'initgroups', 'posix_fallocate'
24 +if get_option('memfd-create')
25 + optional_libc_funcs += [ 'memfd_create' ]
28 foreach func : optional_libc_funcs
29 if cc.has_function(func)
30 config_h.set('HAVE_' + func.to_upper(), 1)
31 diff --git a/meson_options.txt b/meson_options.txt
32 index 80a2ad7..4a93472 100644
33 --- a/meson_options.txt
34 +++ b/meson_options.txt
35 @@ -99,6 +99,13 @@ option(
36 description: 'systemd service plugin: state notify, watchdog, socket activation'
43 + description: 'Use memfd_create system call'