On Thu, Apr 17, 2014 at 03:40:10PM +0400, Alexander Ivchenko wrote: > That fixes "--disable-shared" case only, which is important for NDK build. > > Without "--disable-shared" build fails because there is no -lpthread > on Android and pthreads are in libc there. > Apparently, cilkrts configure does not check that. > > I can fix that in 4.9, but I'm ok with fixing it in trunk later as > well, depending on your decision.
Ugh, I guess depends on how the patch looks like. In any case, I think libgomp contains pretty much the same hunk as cilkrts, so why you don't run into issues in libgomp and only in libcilkrts? # Check to see if -pthread or -lpthread is needed. Prefer the former. # In case the pthread.h system header is not found, this test will fail. XPCFLAGS="" CFLAGS="$CFLAGS -pthread" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [#include <pthread.h> void *g(void *d) { return NULL; }], [pthread_t t; pthread_create(&t,NULL,g,NULL);])], [XPCFLAGS=" -Wc,-pthread"], [CFLAGS="$save_CFLAGS" LIBS="-lpthread $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);])], [], [AC_MSG_ERROR([Pthreads are required to build libgomp])])]) Jakub