diff --git a/configure.ac b/configure.ac index 1d327d51d..8f60bf4be 100644 --- a/configure.ac +++ b/configure.ac @@ -317,6 +317,17 @@ case "$host_os" in [CXXFLAGS="$LIBSECCOMP_CFLAGS $CXXFLAGS"]) have_seccomp=1 AC_DEFINE([HAVE_SECCOMP], [1], [Whether seccomp is available and should be used for sandboxing.]) + AC_COMPILE_IFELSE([ + AC_LANG_SOURCE([[ + #include + #ifndef __SNR_fchmodat2 + # error "Missing support for fchmodat2" + #endif + ]]) + ], [], [ + echo "libseccomp is missing __SNR_fchmodat2. Please provide libseccomp 2.5.5 or later" + exit 1 + ]) else have_seccomp= fi diff --git a/package.nix b/package.nix index d11743427..59265f522 100644 --- a/package.nix +++ b/package.nix @@ -1,4 +1,5 @@ { lib +, fetchurl , stdenv , releaseTools , autoconf-archive @@ -248,7 +249,13 @@ in { ] ++ lib.optionals buildUnitTests [ gtest rapidcheck - ] ++ lib.optional stdenv.isLinux libseccomp + ] ++ lib.optional stdenv.isLinux (libseccomp.overrideAttrs (_: rec { + version = "2.5.5"; + src = fetchurl { + url = "https://github.com/seccomp/libseccomp/releases/download/v${version}/libseccomp-${version}.tar.gz"; + hash = "sha256-JIosik2bmFiqa69ScSw0r+/PnJ6Ut23OAsHJqiX7M3U="; + }; + })) ++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid # There have been issues building these dependencies ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform && (stdenv.isLinux || stdenv.isDarwin))