From 213831192dc3cc8785c98c97482a3ec46df6dd47 Mon Sep 17 00:00:00 2001 From: Marco Varlese Date: Tue, 6 Mar 2018 08:09:04 +0100 Subject: glibc 2.27 fix With glibc 2.27 the memfd_create has been added to the devel libraries. That's causing the internally defined static function to clash with the system wide one. This patch addresses that issue on systems with latest glibc libraries. Change-Id: I788bf49b23d5b5f1cb1c0374e243d8a429178a71 Signed-off-by: Marco Varlese (cherry picked from commit 3f6ede3ab3df9624ba3682d5bc82c4f2aa2e0506) --- src/configure.ac | 1 + src/vppinfra/linux/syscall.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/configure.ac b/src/configure.ac index db6484f5141..dafb962c7b1 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -227,6 +227,7 @@ PLUGIN_ENABLED(l2e) ############################################################################### # Dependency checks ############################################################################### +AC_CHECK_FUNC([memfd_create], [AC_DEFINE([HAVE_MEMFD_CREATE], [1], [Define if memfd exists])]) AM_COND_IF([ENABLE_DPDK_SHARED], [ diff --git a/src/vppinfra/linux/syscall.h b/src/vppinfra/linux/syscall.h index f8ec5919f3f..4511b85ac1d 100644 --- a/src/vppinfra/linux/syscall.h +++ b/src/vppinfra/linux/syscall.h @@ -39,11 +39,13 @@ move_pages (int pid, unsigned long count, void **pages, const int *nodes, return syscall (__NR_move_pages, pid, count, pages, nodes, status, flags); } +#ifndef HAVE_MEMFD_CREATE static inline int memfd_create (const char *name, unsigned int flags) { return syscall (__NR_memfd_create, name, flags); } +#endif #endif /* included_linux_syscall_h */ -- cgit 1.2.3-korg