This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Fortran-related libgomp failures in case of -fno-openmp
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Gerald Pfeifer <gerald at pfeifer dot com>
- Cc: fortran at gcc dot gnu dot org, gcc at gcc dot gnu dot org, Janis Johnson <janis187 at us dot ibm dot com>
- Date: Mon, 1 Jun 2009 11:14:31 -0700
- Subject: Re: Fortran-related libgomp failures in case of -fno-openmp
- References: <alpine.LSU.1.99.0906011954250.27711@acrux.dbai.tuwien.ac.at>
On Mon, Jun 01, 2009 at 07:59:15PM +0200, Gerald Pfeifer wrote:
> Excess errors:
> /pfeifer/OBJ-0531-2252/i386-unknown-freebsd7.1/./libgomp/.libs/libgomp.so:
> undefined reference to `pthread_create'
>
> And what all of these three testcases have in common is
>
> { dg-options "-fno-openmp" }
>
> So, it seems -fno-openmp in combination with an attempt to still link
> libgomp.so leads to this failure.
>
>
> Is it possible this is an issue with the testsuite rather than with
> the code on FreeBSD?
>
The code is fine. The problem is with the testsuite. When
-fopenmp is used on FreeBSD, the additional option -pthread
is added to the list of options.
REMOVE:kargl[28] gfortran -v -fopenmp -c d.f90
Using built-in specs.
Target: i386-portbld-freebsd8.0
Configured with: ./..//gcc-4.3-20081120/configure --disable-nls --with-system-zlib --with-libiconv-prefix=/usr/local --with-gmp=/usr/local --program-suffix=43 --libdir=/usr/local/lib/gcc-4.3.3 --with-gxx-include-dir=/usr/local/lib/gcc-4.3.3/include/c++/ --disable-rpath --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc43 --build=i386-portbld-freebsd8.0
Thread model: posix
gcc version 4.3.3 20081120 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-v' '-fopenmp' '-c' '-mtune=i386' '-pthread'
If someone uses -fno-openmp and still tries to link to libgomp,
then the -pthread option is missing and hence the test fail
because -lpthread is not included. On FreeBSD, libgomp.so.1
does not show a dependency on libpthread, so the dynamic linker
can't automagically work.
REMOVE:kargl[30] ldd /usr/home/kargl/work/lib/libgomp.so.1
/usr/home/kargl/work/lib/libgomp.so.1:
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x481a8000)
libc.so.7 => /lib/libc.so.7 (0x4808c000)
--
Steve