On Thu, Apr 17, 2014 at 02:04:03PM +0200, Jakub Jelinek wrote: > 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])])])
Ah, I see, while it checks for that, it then happily ignores it. libgomp instead propagates it into XCFLAGS and LIBS vars that are substituted in the Makefile and used for the build, libcilkrts hardcodes -lpthread. I guess I'd prefer to see this fixed on the trunk first and then backported to 4.9.1. Jakub