--- a/libtest/cmdline.cc
+++ b/libtest/cmdline.cc
@@ -61,10 +61,6 @@
 #include <algorithm>
 #include <stdexcept>

-#ifndef __USE_GNU
-static char **environ= NULL;
-#endif
-
 #ifndef FD_CLOEXEC
 # define FD_CLOEXEC 0
 #endif
@@ -201,7 +197,7 @@

   fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);

-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
+#if defined(POSIX_SPAWN_USEVFORK) && defined(__linux__)
   // Use USEVFORK on linux
   flags |= POSIX_SPAWN_USEVFORK;
 #endif
