--- Comment #4 from janus at gcc dot gnu dot org 2009-12-26 21:44 ---
I'm curious why this problem only appears for Fortran code and not for C. If it
is a 'glibc feature', then both should be equally affected, or am I mistaken?
The following C program does not show the runtime segfault
--- Comment #5 from pinskia at gcc dot gnu dot org 2009-12-26 22:10 ---
Still a glibc feature as using the shared glibc/pthreads works. Also does on
darwin and other targets.
--
pinskia at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #6 from pinskia at gcc dot gnu dot org 2009-12-26 22:11 ---
Oh and the most likely reason is that why Fortran fails and C works is because
libgfortran weakly imports some pthread symbols which causes the pthread static
library not to be fully included.
--
--- Comment #1 from janus at gcc dot gnu dot org 2009-12-23 13:29 ---
Btw, one also gets the segfault without actually calling 'omp_get_num_procs':
subroutine s
!$ use omp_lib
!$ print *, 'Number of processors:', omp_get_num_procs()
end subroutine
end
This program
--- Comment #2 from dfranke at gcc dot gnu dot org 2009-12-23 13:32 ---
Dupe of PR30471?
--
dfranke at gcc dot gnu dot org changed:
What|Removed |Added
--- Comment #3 from janus at gcc dot gnu dot org 2009-12-23 13:41 ---
(In reply to comment #2)
Dupe of PR30471?
Ah, yes, indeed. The segfault is cured by the workaround from comment #7 of
that PR (i.e. compiling with -fopenmp -static -Wl,--whole-archive -lpthread