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
This commit is contained in:
Martin Liska 2018-11-09 10:14:36 +01:00 committed by Martin Liska
parent 2e62beb05e
commit d1e2e13c42
2 changed files with 10 additions and 0 deletions

View File

@ -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):

View File

@ -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
}