On 11/8/18 9:50 PM, Jeff Law wrote:
> On 11/8/18 1:48 PM, Jakub Jelinek wrote:
>> On Thu, Nov 08, 2018 at 01:43:29PM -0700, Jeff Law wrote:
>>> On 11/8/18 1:27 AM, Martin Liška wrote:
>>>> libsanitizer/ChangeLog:
>>>>
>>>> 2018-11-08  Martin Liska  <mli...@suse.cz>
>>>>
>>>>    PR sanitizer/87892
>>>>    * (all files): Revert upstream r318802.
>>> Is it causing a build failure or somesuch?  ie, why specifically are you
>>> wanting to remove it?
>>
>> Yes.  But perhaps it would be enough to just guard the CPU_COUNT use with
>> #ifdef CPU_COUNT and have some fallback, including say returning just 1.
>> If we care about Scudo or whatever is (what would be needed for that on the
>> compiler side?), then we'd need a proper implementation, one that doesn't
>> fail if a machine has more CPUs than fit into cpu_set_t, or if old glibc is
>> used and CPU_COUNT isn't defined, or even if the kernel doesn't have
>> affinity stuff at all.
> The obvious idea being to disable it with a more minimal patch making
> future merges easier -- if there's a less intrusive way to disable the
> bits, then that's fine with me.
> 
> jeff
> 

Ok, then I'm going to install following patch.

Martin
>From 40766a658e15019c8fd03f678a988ce53c2495b1 Mon Sep 17 00:00:00 2001
From: marxin <mli...@suse.cz>
Date: Fri, 9 Nov 2018 09:44:15 +0100
Subject: [PATCH] Fallback in libsanitizer for scudo sanitizer (PR
 sanitizer/87892).

libsanitizer/ChangeLog:

2018-11-09  Martin Liska  <mli...@suse.cz>

	PR sanitizer/87892
	* sanitizer_common/sanitizer_linux_libcdep.cc (defined): Return
	1 when CPU_COUNT macro is not defined.
---
 libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
index 32f335eaf23..28360f5656a 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
 }
 
-- 
2.19.1

Reply via email to