diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2012-12-26 17:08:36 -0800 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-12-26 17:08:36 -0800 |
commit | 001afd51a767aef75b27675b0fafe203bada4774 (patch) | |
tree | 79fa72516bc66d239799bef4f68526df11188b7d /gcc-4.4.3 | |
parent | 946c2a6b57ac7d3b2b656ac628bcb14a216ec635 (diff) | |
parent | 1271761f530c0050154e8d526b95f952df551751 (diff) | |
download | toolchain_gcc-001afd51a767aef75b27675b0fafe203bada4774.tar.gz toolchain_gcc-001afd51a767aef75b27675b0fafe203bada4774.tar.bz2 toolchain_gcc-001afd51a767aef75b27675b0fafe203bada4774.zip |
Merge "Modifications to enable OpenMP in Android."
Diffstat (limited to 'gcc-4.4.3')
-rw-r--r-- | gcc-4.4.3/gcc/config/arm/linux-eabi.h | 2 | ||||
-rw-r--r-- | gcc-4.4.3/gcc/config/linux-android.h | 3 | ||||
-rwxr-xr-x | gcc-4.4.3/libgomp/configure | 50 | ||||
-rw-r--r-- | gcc-4.4.3/libgomp/configure.ac | 9 | ||||
-rw-r--r-- | gcc-4.4.3/libgomp/env.c | 1 |
5 files changed, 62 insertions, 3 deletions
diff --git a/gcc-4.4.3/gcc/config/arm/linux-eabi.h b/gcc-4.4.3/gcc/config/arm/linux-eabi.h index 9004f0171..d44fcddda 100644 --- a/gcc-4.4.3/gcc/config/arm/linux-eabi.h +++ b/gcc-4.4.3/gcc/config/arm/linux-eabi.h @@ -87,7 +87,7 @@ #undef LIB_SPEC #define LIB_SPEC \ LINUX_OR_ANDROID_LD (LINUX_TARGET_LIB_SPEC, \ - LINUX_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC) + ANDROID_LIB_SPEC " " LINUX_TARGET_LIB_SPEC ) #undef STARTFILE_SPEC #define STARTFILE_SPEC \ diff --git a/gcc-4.4.3/gcc/config/linux-android.h b/gcc-4.4.3/gcc/config/linux-android.h index f9fcf5ba3..b5bc2bb64 100644 --- a/gcc-4.4.3/gcc/config/linux-android.h +++ b/gcc-4.4.3/gcc/config/linux-android.h @@ -53,7 +53,8 @@ "--noexecstack" #define ANDROID_LIB_SPEC \ - "%{!static: -ldl}" + "%{!static: -ldl} \ + %{pthread:-lc}" #define ANDROID_STARTFILE_SPEC \ "%{!shared:" \ diff --git a/gcc-4.4.3/libgomp/configure b/gcc-4.4.3/libgomp/configure index 5db715cf3..b5cfeb9ef 100755 --- a/gcc-4.4.3/libgomp/configure +++ b/gcc-4.4.3/libgomp/configure @@ -17364,6 +17364,50 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +CFLAGS="$save_CFLAGS" LIBS="$LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <pthread.h> + void *g(void *d) { return NULL; } +int +main () +{ +pthread_t t; pthread_create(&t,NULL,g,NULL); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17417,6 +17461,9 @@ rm -f conftest.err conftest.$ac_objext \ fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext # Check for functions needed. @@ -22302,6 +22349,9 @@ ac_configure_args="${multilib_arg} ${ac_configure_args}" multi_basedir="$multi_basedir" CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} CC="$CC" +CXX="$CXX" +GFORTRAN="$GFORTRAN" +GCJ="$GCJ" AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" diff --git a/gcc-4.4.3/libgomp/configure.ac b/gcc-4.4.3/libgomp/configure.ac index a46f99c60..5bafe61d1 100644 --- a/gcc-4.4.3/libgomp/configure.ac +++ b/gcc-4.4.3/libgomp/configure.ac @@ -168,6 +168,13 @@ AC_LINK_IFELSE( void *g(void *d) { return NULL; }], [pthread_t t; pthread_create(&t,NULL,g,NULL);])], [XPCFLAGS=" -Wc,-pthread"], + [CFLAGS="$save_CFLAGS" LIBS="$LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include <pthread.h> + void *g(void *d) { return NULL; }], + [pthread_t t; pthread_create(&t,NULL,g,NULL);])], + [], [CFLAGS="$save_CFLAGS" LIBS="-lpthread $LIBS" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -175,7 +182,7 @@ AC_LINK_IFELSE( void *g(void *d) { return NULL; }], [pthread_t t; pthread_create(&t,NULL,g,NULL);])], [], - [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) + [AC_MSG_ERROR([Pthreads are required to build libgomp])])])]) # Check for functions needed. AC_CHECK_FUNCS(getloadavg clock_gettime strtoull) diff --git a/gcc-4.4.3/libgomp/env.c b/gcc-4.4.3/libgomp/env.c index c870433f3..6809fdfa1 100644 --- a/gcc-4.4.3/libgomp/env.c +++ b/gcc-4.4.3/libgomp/env.c @@ -43,6 +43,7 @@ #endif #include <limits.h> #include <errno.h> +#include <asm/page.h> #ifndef HAVE_STRTOULL # define strtoull(ptr, eptr, base) strtoul (ptr, eptr, base) |