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~