Commit 6a33ab8b authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

pax-utils: enable seccomp and fuzzong only on `linux`

On `darwin` the build fails on missing `memfd_create()` symbols as
https://hydra.nixos.org/build/314413362:

    ../fuzz-ar.c:18:7: error: call to undeclared function 'memfd_create'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
       18 |         fd = memfd_create("fuzz-input.a", MFD_CLOEXEC);
          |              ^
parent 6bb3244f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5,7 +5,9 @@
  buildPackages,
  docbook_xml_dtd_44,
  docbook_xsl,
  withFuzzing ? stdenv.hostPlatform.isLinux,
  withLibcap ? stdenv.hostPlatform.isLinux,
  withSeccomp ? stdenv.hostPlatform.isLinux,
  libcap,
  pkg-config,
  meson,
@@ -29,7 +31,9 @@ stdenv.mkDerivation rec {
  strictDeps = true;

  mesonFlags = [
    (lib.mesonBool "use_fuzzing" withFuzzing)
    (lib.mesonEnable "use_libcap" withLibcap)
    (lib.mesonBool "use_seccomp" withSeccomp)
  ];

  depsBuildBuild = [ buildPackages.stdenv.cc ];