linux: Enable kernel configs for SystemTap
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston / 0005-add-memfd-create-option.patch
1 Add memfd-create option
2
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
7 it.
8
9 Upstream-Status: Pending
10
11 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
12
13 diff --git a/meson.build b/meson.build
14 index 82107e1..9d042ca 100644
15 --- a/meson.build
16 +++ b/meson.build
17 @@ -78,8 +78,12 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major')
18  endif
19  
20  optional_libc_funcs = [
21 -       'mkostemp', 'strchrnul', 'initgroups', 'posix_fallocate', 'memfd_create'
22 +       'mkostemp', 'strchrnul', 'initgroups', 'posix_fallocate'
23  ]
24 +if get_option('memfd-create')
25 +       optional_libc_funcs += [ 'memfd_create' ]
26 +endif
27 +
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'
37  )
38  
39 +option(
40 +       'memfd-create',
41 +       type: 'boolean',
42 +       value: true,
43 +       description: 'Use memfd_create system call'
44 +)
45 +
46  option(
47         'remoting',
48         type: 'boolean',