This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Support OpenMP for task parallelism on Android-ICS/GCC-4.7.2
- From: Richard Henderson <rth at redhat dot com>
- To: Geunsik Lim <geunsik dot lim at gmail dot com>
- Cc: gcc-patch <gcc-patches at gcc dot gnu dot org>, Tobias Burnus <burnus at net-b dot de>, Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 02 Jan 2013 12:05:07 -0800
- Subject: Re: [PATCH] Support OpenMP for task parallelism on Android-ICS/GCC-4.7.2
- References: <1356568757-32119-1-git-send-email-geunsik.lim@gmail.com>
On 12/26/2012 04:39 PM, Geunsik Lim wrote:
> diff --git a/gcc-4.7/gcc/config/linux-android.h b/gcc-4.7/gcc/config/linux-android.h
> index 033cfef..c6d9cdd 100644
> --- a/gcc-4.7/gcc/config/linux-android.h
> +++ b/gcc-4.7/gcc/config/linux-android.h
> @@ -53,7 +53,8 @@
> "--noexecstack"
>
> #define ANDROID_LIB_SPEC \
> - "%{!static: -ldl}"
> + "%{!static: -ldl}" \
> + "%{pthread:-lc}"
>
...
> diff --git a/gcc-4.7/libgomp/configure.ac b/gcc-4.7/libgomp/configure.ac
> index d87ed29..292db2a 100644
> --- a/gcc-4.7/libgomp/configure.ac
> +++ b/gcc-4.7/libgomp/configure.ac
> @@ -184,6 +184,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(
> @@ -191,7 +198,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])])])])
Why do you need this change to configure.ac?
It sure looks as if the linux-android.h patch
makes the -pthread gcc parameter DTRT, and the
first existing test here is configure.ac will
default to using -pthread.
> --- a/gcc-4.7/libgomp/env.c
> +++ b/gcc-4.7/libgomp/env.c
> @@ -44,6 +44,7 @@
> #endif
> #include <limits.h>
> #include <errno.h>
> +#include <asm/page.h>
This isn't correct. What declaration are you after?
r~