On cygwin, gfortran -fopenmp gives the warning gfortran: unrecognized option '-pthread' which gives a heap of failures in the testsuite. This is set in gcc.c: /* Adding -fopenmp should imply pthreads. This is particularly important for targets that use different start files and suchlike. */ #ifndef GOMP_SELF_SPECS #define GOMP_SELF_SPECS "%{fopenmp: -pthread}" #endif I think the fix is to override it, as is done in gcc/config/darwin.h /* Every program on darwin links against libSystem which contains the pthread routines, so there's no need to explicitly call out when doing threaded work. */ #undef GOMP_SELF_SPECS #define GOMP_SELF_SPECS "" I'll prepare a patch at some stage.
I am testing this. 2006-03-07 David Billinghurst (David.Billinghurst@riotinto.com) PR target/26588 * config/i386/cygwin.h (GOMP_SELF_SPECS): Define. --- cygwin.h~ 2006-02-01 14:17:44.000000000 +1100 +++ cygwin.h 2006-03-07 13:08:52.420324700 +1100 @@ -232,3 +232,10 @@ /* Binutils does not handle weak symbols from dlls correctly. For now, do not use them unnecessarily in gthr-posix.h. */ #define GTHREAD_USE_WEAK 0 + +/* Every program on cygwin links against cygwin.dll which contains + the pthread routines. There is no need to explicitly link them + and the -pthread flag is not recognised. */ +#undef GOMP_SELF_SPECS +#define GOMP_SELF_SPECS ""
Subject: Bug 26588 Author: billingd Date: Tue Mar 7 23:51:34 2006 New Revision: 111824 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111824 Log: 2006-03-08 David Billinghurst <David.Billinghurst@riotinto.com> PR target/26588 * config/i386/cygwin.h (GOMP_SELF_SPECS): Define. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/cygwin.h
Fixed by patch.