diff --git a/config.h.in b/config.h.in
index 19a264dadbcafe0c86817691aacbc7ea410b9658..f845cc620bb4d8dd1c5e99bd23764bb196347955 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,6 +1,3 @@
 #define _GNU_SOURCE
 #define G_LOG_DOMAIN "pressure-vessel"
-#mesondefine HAVE_DECL_COPY_FILE_RANGE
-#mesondefine HAVE_DECL_MEMFD_CREATE
-#mesondefine HAVE_DECL_RENAMEAT2
 #mesondefine VERSION
diff --git a/meson.build b/meson.build
index 72c348c644ef87103a290509d5aaab0c855df811..42daa055ff00a99faab493a64e03beebea7f3115 100644
--- a/meson.build
+++ b/meson.build
@@ -167,34 +167,6 @@ cc = meson.get_compiler('c')
 conf_data = configuration_data()
 conf_data.set('VERSION', version)
 
-check_functions = [
-  'renameat2',
-  'memfd_create',
-  'copy_file_range',
-]
-foreach check_function : check_functions
-  if cc.compiles('''
-    #include <sys/types.h>
-    #include <unistd.h>
-    #include <stdio.h>
-    #include <sys/mount.h>
-    #include <fcntl.h>
-    #include <sched.h>
-    #include <linux/loop.h>
-    #include <linux/random.h>
-    #include <sys/mman.h>
-
-    int func (void) {
-      (void) ''' + check_function + ''';
-    }
-    ''',
-    args : '-D_GNU_SOURCE',
-    name : check_function + '() is declared',
-  )
-    conf_data.set('HAVE_DECL_' + check_function.underscorify().to_upper(), 1)
-  endif
-endforeach
-
 configure_file(
   input : 'config.h.in',
   output : 'config.h',
diff --git a/src/flatpak-bwrap.c b/src/flatpak-bwrap.c
index 1f8e976eb109fe979a42bad5570486918ff58851..aecedf4062dd923472d517988e6f48ca9cfa681b 100644
--- a/src/flatpak-bwrap.c
+++ b/src/flatpak-bwrap.c
@@ -19,6 +19,7 @@
  */
 
 #include "config.h"
+#include "subprojects/libglnx/config.h"
 
 #include <string.h>
 #include <fcntl.h>
diff --git a/src/flatpak-utils.c b/src/flatpak-utils.c
index d86832134e38a50adfc0a940861dababd1fea042..3cbc5726714f47a94c5cc2cc07eb411cf2ff1bb2 100644
--- a/src/flatpak-utils.c
+++ b/src/flatpak-utils.c
@@ -21,6 +21,7 @@
  */
 
 #include "config.h"
+#include "subprojects/libglnx/config.h"
 
 #include "flatpak-utils-private.h"
 
diff --git a/src/wrap.c b/src/wrap.c
index d606fa9cadad88f8462ca909d7096598398b3949..9cccc972c2a561bf7604fb281bc99291967117ed 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -23,6 +23,7 @@
  */
 
 #include "config.h"
+#include "subprojects/libglnx/config.h"
 
 #include <glib.h>
 #include <glib/gstdio.h>