diff options
author | Martin Liska <mliska@suse.cz> | 2018-11-09 10:14:36 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-11-09 09:14:36 +0000 |
commit | d1e2e13c4218a23152410e1a44218102d2e196e8 (patch) | |
tree | 3072ab5e6ec072c81d808da12ecb0ba5542c99a5 | |
parent | 2e62beb05e8224d7632f8dbe3cace6a60bbfbf46 (diff) | |
download | gcc-d1e2e13c4218a23152410e1a44218102d2e196e8.zip gcc-d1e2e13c4218a23152410e1a44218102d2e196e8.tar.gz gcc-d1e2e13c4218a23152410e1a44218102d2e196e8.tar.bz2 |
Fallback in libsanitizer for scudo sanitizer (PR sanitizer/87892).
2018-11-09 Martin Liska <mliska@suse.cz>
PR sanitizer/87892
* sanitizer_common/sanitizer_linux_libcdep.cc (defined): Return
1 when CPU_COUNT macro is not defined.
From-SVN: r265950
-rw-r--r-- | libsanitizer/ChangeLog | 6 | ||||
-rw-r--r-- | libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index 705e7ca..55d5a9b 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,9 @@ +2018-11-09 Martin Liska <mliska@suse.cz> + + PR sanitizer/87892 + * sanitizer_common/sanitizer_linux_libcdep.cc (defined): Return + 1 when CPU_COUNT macro is not defined. + 2018-11-08 Bill Seurer <seurer@linux.vnet.ibm.com> * libsanitizer/sanitizer_common/sanitizer_linux.cc (CheckASLR): diff --git a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc index 32f335e..28360f5 100644 --- a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc +++ b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc @@ -694,9 +694,13 @@ u32 GetNumberOfCPUs() { #elif SANITIZER_SOLARIS return sysconf(_SC_NPROCESSORS_ONLN); #else +#if defined(CPU_COUNT) cpu_set_t CPUs; CHECK_EQ(sched_getaffinity(0, sizeof(cpu_set_t), &CPUs), 0); return CPU_COUNT(&CPUs); +#else + return 1; +#endif #endif } |