]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix non-glibc build of the test suite with s390x_features
authorRhys Kidd <rhyskidd@gmail.com>
Tue, 28 Jan 2020 08:33:03 +0000 (19:33 +1100)
committerRhys Kidd <rhyskidd@gmail.com>
Tue, 28 Jan 2020 08:33:03 +0000 (19:33 +1100)
s390x_features is built unconditionally on a range of platforms, accordingly
any non-portable or glibc-specific functionality must be guarded.

Fixes error reported when running 'make check' or 'make regtest' on a platform
with an alternative libc that Valgrind supports, in this case Apple's libc:

  s390x_features.c:13:10: fatal error: 'features.h' file not found
  #include <features.h>  // __GLIBC_PREREQ
           ^
  1 error generated.

Fixes: 161d22f0a ("s390x: Fix vector facility (vx) check in test suite")
NEWS
tests/s390x_features.c

diff --git a/NEWS b/NEWS
index 6de1db7cf4cd28ccd036ccf2e8576429e632580a..d409c1307a67cae8f47118fd9f11f64462d911e2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -111,6 +111,7 @@ n-i-bz  Fix minor one time leaks in dhat.
 n-i-bz  Add --run-cxx-freeres=no in outer args to avoid inner crashes.
 n-i-bz  Add support for the Linux io_uring system calls
 n-i-bz  sys_statx: don't complain if both |filename| and |buf| are NULL.
+n-i-bz  Fix non-glibc build of test suite with s390x_features
 
 
 Release 3.15.0 (12 April 2019)
index 16f9220f77e0b27862116fcbcd7bc67305f364b4..baa349311f788eef8243dcfceb53926db335c745 100644 (file)
 #include <fcntl.h>     // open
 #include <unistd.h>    // lseek
 #include <sys/stat.h>  // S_IRUSR
+
+// <features.h> is a glibc-specific extension, other libc's may not provide it
+#ifdef __GLIBC__
 #include <features.h>  // __GLIBC_PREREQ
+#endif
 
 // This file determines s390x features a processor supports.
 //