[Bug other/58996] [4.9 regression] build failure in libcilkrts

bviyer at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 9 20:53:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58996

Balaji V. Iyer <bviyer at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bviyer at gmail dot com

--- Comment #2 from Balaji V. Iyer <bviyer at gmail dot com> ---
Hi Paul,
    We do not have a Red Hat 8 machine readily available, and are in the
process of getting one. In the mean time, can you please let me know if the
following fix works for you?

Thanks,

Balaji V. Iyer.

diff --git a/libcilkrts/runtime/os-unix.c b/libcilkrts/runtime/os-unix.c
index dbca21f..eabb17b 100644
--- a/libcilkrts/runtime/os-unix.c
+++ b/libcilkrts/runtime/os-unix.c
@@ -311,6 +311,15 @@ static pid_t linux_gettid(void)
  */
 static int linux_get_affinity_count (int tid)
 {
+#if ! defined __cpu_set_t_defined
+      // Returning 0 will cause __cilkrts_hardware_cpu_count to return the
+      // value from sysconf(_SC_NPROCESSORS_ONLN).
+      //
+      // This should work around the problem with cpu_set_t, CPU_SETSIZE and
+      // CPU_ISSET not being defined on Red Hat 8.
+      return 0;
+#else
+
     cpu_set_t process_mask;

     // Extract the thread affinity mask
@@ -337,6 +346,7 @@ static int linux_get_affinity_count (int tid)
     }

     return available_procs;
+#endif // ! defined __cpu_set_t_defined
 }
 #endif



More information about the Gcc-bugs mailing list