public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/114646] New: libgfortran doesn't work with static libpthread
@ 2024-04-08 20:03 hjl.tools at gmail dot com
  2024-04-08 20:05 ` [Bug libfortran/114646] " hjl.tools at gmail dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: hjl.tools at gmail dot com @ 2024-04-08 20:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114646

            Bug ID: 114646
           Summary: libgfortran doesn't work with static libpthread
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

[hjl@gnu-cfl-3 tmp]$ cat x.f90 
      use omp_lib
      implicit none
      integer, parameter :: NT = 4
      integer :: nThreads(NT)

      print *, 'Call omp_set_dynamic'
!$    call omp_set_dynamic(.false.)
      print *, 'Call omp_set_num_threads'
!$    call omp_set_num_threads(NT)
      print *, 'Now enter the parallel region'

!$omp parallel default(none) shared(nThreads)
      nThreads(omp_get_thread_num()+1) = omp_get_num_threads()
!$omp end parallel

      print*, nThreads

      END
[hjl@gnu-cfl-3 tmp]$ gfortran -static -fopenmp x.f90 
/usr/local/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/13/libgomp.a(target.o): in
function `gomp_target_init.part.0':
(.text+0x4d6): warning: Using 'dlopen' in statically linked applications
requires at runtime the shared libraries from the glibc version used for
linking
[hjl@gnu-cfl-3 tmp]$ ./a.out 
 Call omp_set_dynamic
 Call omp_set_num_threads
 Now enter the parallel region
           4           4           4           4

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
Segmentation fault (core dumped)
[hjl@gnu-cfl-3 tmp]$

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-04-09 17:03 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-08 20:03 [Bug libfortran/114646] New: libgfortran doesn't work with static libpthread hjl.tools at gmail dot com
2024-04-08 20:05 ` [Bug libfortran/114646] " hjl.tools at gmail dot com
2024-04-08 20:07 ` pinskia at gcc dot gnu.org
2024-04-08 20:07 ` pinskia at gcc dot gnu.org
2024-04-08 20:10 ` fw at gcc dot gnu.org
2024-04-08 20:11 ` [Bug libfortran/114646] libgcc's gthr.h still defines GTHREAD_USE_WEAK to 1 for newer glibc pinskia at gcc dot gnu.org
2024-04-08 20:15 ` [Bug libgcc/114646] " pinskia at gcc dot gnu.org
2024-04-08 20:18 ` hjl.tools at gmail dot com
2024-04-08 20:22 ` fw at gcc dot gnu.org
2024-04-08 21:36 ` pinskia at gcc dot gnu.org
2024-04-08 21:43 ` hjl.tools at gmail dot com
2024-04-08 21:45 ` bruno at clisp dot org
2024-04-08 21:46 ` [Bug libfortran/114646] libgfortran still doesn't define GTHREAD_USE_WEAK to 0 " hjl.tools at gmail dot com
2024-04-08 21:50 ` pinskia at gcc dot gnu.org
2024-04-08 21:51 ` pinskia at gcc dot gnu.org
2024-04-08 21:53 ` hjl.tools at gmail dot com
2024-04-08 21:58 ` pinskia at gcc dot gnu.org
2024-04-08 22:02 ` pinskia at gcc dot gnu.org
2024-04-09 17:03 ` skpgkp2 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).