diff options
-rw-r--r-- | recipes-containers/lxc/files/0001-syscall_wrappers-rename-internal-memfd_create-to-mem.patch | 46 | ||||
-rw-r--r-- | recipes-containers/lxc/lxc_3.2.1.bb | 1 |
2 files changed, 47 insertions, 0 deletions
diff --git a/recipes-containers/lxc/files/0001-syscall_wrappers-rename-internal-memfd_create-to-mem.patch b/recipes-containers/lxc/files/0001-syscall_wrappers-rename-internal-memfd_create-to-mem.patch new file mode 100644 index 00000000..9d5b5b8a --- /dev/null +++ b/recipes-containers/lxc/files/0001-syscall_wrappers-rename-internal-memfd_create-to-mem.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | From b1694cccddadc8b084cd9eb502d9e86e0728709b Mon Sep 17 00:00:00 2001 | ||
2 | From: Patrick Havelange <patrick.havelange@essensium.com> | ||
3 | Date: Tue, 22 Oct 2019 12:29:54 +0200 | ||
4 | Subject: [PATCH v2] syscall_wrappers: rename internal memfd_create to | ||
5 | memfd_create_lxc | ||
6 | |||
7 | In case the internal memfd_create has to be used, make sure we don't | ||
8 | clash with the already existing memfd_create function from glibc. | ||
9 | |||
10 | This can happen if this glibc function is a stub. In this case, at | ||
11 | ./configure time, the test for this function will return false, however | ||
12 | the declaration of that function is still available. This leads to | ||
13 | compilation errors. | ||
14 | |||
15 | Upstream-Status: Backport [lxc-3.2.1 https://github.com/lxc/lxc/pull/3168] | ||
16 | |||
17 | Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com> | ||
18 | (cherry picked from commit 40b06c78773dfd5e12e568a576b1abb133f61b71) | ||
19 | Signed-off-by: Oleksii Kurochko <olkuroch@cisco.com> | ||
20 | --- | ||
21 | v2: added Upstream-Status | ||
22 | |||
23 | src/lxc/syscall_wrappers.h | 3 ++- | ||
24 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
25 | |||
26 | diff --git a/src/lxc/syscall_wrappers.h b/src/lxc/syscall_wrappers.h | ||
27 | index ce67da5b5308..b7edba63f5d7 100644 | ||
28 | --- a/src/lxc/syscall_wrappers.h | ||
29 | +++ b/src/lxc/syscall_wrappers.h | ||
30 | @@ -74,7 +74,7 @@ static inline long __keyctl(int cmd, unsigned long arg2, unsigned long arg3, | ||
31 | #endif | ||
32 | |||
33 | #ifndef HAVE_MEMFD_CREATE | ||
34 | -static inline int memfd_create(const char *name, unsigned int flags) { | ||
35 | +static inline int memfd_create_lxc(const char *name, unsigned int flags) { | ||
36 | #ifndef __NR_memfd_create | ||
37 | #if defined __i386__ | ||
38 | #define __NR_memfd_create 356 | ||
39 | @@ -113,6 +113,7 @@ static inline int memfd_create(const char *name, unsigned int flags) { | ||
40 | return -1; | ||
41 | #endif | ||
42 | } | ||
43 | +#define memfd_create memfd_create_lxc | ||
44 | #else | ||
45 | extern int memfd_create(const char *name, unsigned int flags); | ||
46 | #endif | ||
diff --git a/recipes-containers/lxc/lxc_3.2.1.bb b/recipes-containers/lxc/lxc_3.2.1.bb index bedcf137..9592dd9b 100644 --- a/recipes-containers/lxc/lxc_3.2.1.bb +++ b/recipes-containers/lxc/lxc_3.2.1.bb | |||
@@ -49,6 +49,7 @@ SRC_URI = "http://linuxcontainers.org/downloads/${BPN}-${PV}.tar.gz \ | |||
49 | file://0002-container.conf-Add-option-to-disable-session-keyring.patch \ | 49 | file://0002-container.conf-Add-option-to-disable-session-keyring.patch \ |
50 | file://dnsmasq.conf \ | 50 | file://dnsmasq.conf \ |
51 | file://lxc-net \ | 51 | file://lxc-net \ |
52 | file://0001-syscall_wrappers-rename-internal-memfd_create-to-mem.patch \ | ||
52 | " | 53 | " |
53 | 54 | ||
54 | SRC_URI[md5sum] = "4886c8d1c8e221fe526eefcb47857b85" | 55 | SRC_URI[md5sum] = "4886c8d1c8e221fe526eefcb47857b85" |