aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.6
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2013-03-08 05:47:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-03-08 05:47:27 +0000
commit45ba0cf7812270b97cce13afcd15f3e669336ffb (patch)
treeb1baae26a6a97fbd12609cd2543100d1074ed2df /gcc-4.6
parentfe1a20404b19d5dd0cd0988d080cff8a455c2a76 (diff)
parenta38e7b29885b25278b1d356b2efd21622376695d (diff)
downloadtoolchain_gcc-45ba0cf7812270b97cce13afcd15f3e669336ffb.zip
toolchain_gcc-45ba0cf7812270b97cce13afcd15f3e669336ffb.tar.gz
toolchain_gcc-45ba0cf7812270b97cce13afcd15f3e669336ffb.tar.bz2
Merge "Fix GCC 4.4.3/4.6/4.7 openmp support to use libgomp/config/linux"
Diffstat (limited to 'gcc-4.6')
-rw-r--r--gcc-4.6/libgomp/config/linux/futex.h4
-rw-r--r--gcc-4.6/libgomp/config/linux/mips/futex.h5
-rw-r--r--gcc-4.6/libgomp/config/linux/proc.c10
-rwxr-xr-xgcc-4.6/libgomp/configure12
4 files changed, 28 insertions, 3 deletions
diff --git a/gcc-4.6/libgomp/config/linux/futex.h b/gcc-4.6/libgomp/config/linux/futex.h
index bab088a..3731b36 100644
--- a/gcc-4.6/libgomp/config/linux/futex.h
+++ b/gcc-4.6/libgomp/config/linux/futex.h
@@ -38,6 +38,10 @@
#pragma GCC visibility pop
+#if !defined(SYS_futex)
+#define SYS_futex __NR_futex
+#endif
+
static inline void
futex_wait (int *addr, int val)
{
diff --git a/gcc-4.6/libgomp/config/linux/mips/futex.h b/gcc-4.6/libgomp/config/linux/mips/futex.h
index 576ada4..fcac717 100644
--- a/gcc-4.6/libgomp/config/linux/mips/futex.h
+++ b/gcc-4.6/libgomp/config/linux/mips/futex.h
@@ -25,6 +25,11 @@
/* Provide target-specific access to the futex system call. */
#include <sys/syscall.h>
+
+#if !defined(SYS_futex)
+#define SYS_futex __NR_futex
+#endif
+
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
diff --git a/gcc-4.6/libgomp/config/linux/proc.c b/gcc-4.6/libgomp/config/linux/proc.c
index 82e58f4..6cefc76 100644
--- a/gcc-4.6/libgomp/config/linux/proc.c
+++ b/gcc-4.6/libgomp/config/linux/proc.c
@@ -235,7 +235,7 @@ sc_nprocessors_actu ()
if (buffer_len < 0) /* should not happen */ {
fprintf(stderr,"Could not find %s: %s\n", file_name, strerror(errno));
- return;
+ return 1;
}
/* Count the CPU cores, the value may be 0 for single-core CPUs */
@@ -265,8 +265,10 @@ gomp_init_num_threads (void)
return;
}
#endif
-#ifdef _SC_NPROCESSORS_ONLN
+#if defined(__ANDROID__)
gomp_global_icv.nthreads_var = sc_nprocessors_actu ();
+#elif defined(_SC_NPROCESSORS_ONLN)
+ gomp_global_icv.nthreads_var = sysconf (_SC_NPROCESSORS_ONLN);
#endif
}
@@ -297,8 +299,10 @@ get_num_procs (void)
return gomp_available_cpus;
}
#endif
-#ifdef _SC_NPROCESSORS_ONLN
+#if defined(__ANDROID__)
return sc_nprocessors_actu ();
+#elif defined(_SC_NPROCESSORS_ONLN)
+ return sysconf (_SC_NPROCESSORS_ONLN);
#else
return gomp_icv (false)->nthreads_var;
#endif
diff --git a/gcc-4.6/libgomp/configure b/gcc-4.6/libgomp/configure
index 623b1a9..fe3c10e 100755
--- a/gcc-4.6/libgomp/configure
+++ b/gcc-4.6/libgomp/configure
@@ -15157,6 +15157,12 @@ case "$target" in
/* end confdefs.h. */
#include <sys/syscall.h>
int lk;
+#if !defined(SYS_gettid)
+#define SYS_gettid __NR_gettid
+#endif
+#if !defined(SYS_futex)
+#define SYS_futex __NR_futex
+#endif
int
main ()
{
@@ -15209,6 +15215,12 @@ rm -f core conftest.err conftest.$ac_objext \
/* end confdefs.h. */
#include <sys/syscall.h>
int lk;
+#if !defined(SYS_gettid)
+#define SYS_gettid __NR_gettid
+#endif
+#if !defined(SYS_futex)
+#define SYS_futex __NR_futex
+#endif
int
main ()
{