diff options
author | Balaji V. Iyer <balaji.v.iyer@intel.com> | 2014-01-20 17:49:22 +0000 |
---|---|---|
committer | Balaji V. Iyer <bviyer@gcc.gnu.org> | 2014-01-20 09:49:22 -0800 |
commit | ef132d593eb8b2423687ea820f01c4539c9f7151 (patch) | |
tree | eb5a127638b9e145246c0b66ed3d8260ff8064dd /libcilkrts/configure | |
parent | eee0e4879f81a53293079c3398656ebc03758431 (diff) | |
download | gcc-ef132d593eb8b2423687ea820f01c4539c9f7151.zip gcc-ef132d593eb8b2423687ea820f01c4539c9f7151.tar.gz gcc-ef132d593eb8b2423687ea820f01c4539c9f7151.tar.bz2 |
re PR other/58996 (build failure in libcilkrts)
Fix for PR other/58996.
+2014-01-20 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ PR other/58996
+ * configure.ac: Added a check for pthread affinity support.
+ * runtime/os-unix.c: Likewise.
+ * configure: Regenerate.
+
From-SVN: r206846
Diffstat (limited to 'libcilkrts/configure')
-rw-r--r-- | libcilkrts/configure | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/libcilkrts/configure b/libcilkrts/configure index 91da0a8..63181d7 100644 --- a/libcilkrts/configure +++ b/libcilkrts/configure @@ -14420,6 +14420,38 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +# Check for pthread_{,attr_}[sg]etaffinity_np. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _GNU_SOURCE + #include <pthread.h> +int +main () +{ +cpu_set_t cpuset; + pthread_attr_t attr; + pthread_getaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset); + if (CPU_ISSET (0, &cpuset)) + CPU_SET (1, &cpuset); + else + CPU_ZERO (&cpuset); + pthread_setaffinity_np (pthread_self (), sizeof (cpu_set_t), &cpuset); + pthread_attr_init (&attr); + pthread_attr_getaffinity_np (&attr, sizeof (cpu_set_t), &cpuset); + pthread_attr_setaffinity_np (&attr, sizeof (cpu_set_t), &cpuset); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +$as_echo "#define HAVE_PTHREAD_AFFINITY_NP 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + # Must be last cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure |