From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 67C28385841E; Mon, 8 Apr 2024 20:03:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67C28385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712606601; bh=fQj8VirMMaGFTrxPMQSBQPsAe8rwPK4oxWf/vefeMJk=; h=From:To:Subject:Date:From; b=pMFMCobI+l3i7EzPaSLhcEWItbEYmncdzeMHQdmCrqWwKDhQvonqVyWmxLDD7GA42 5VN+X6MxoOerEa/IdH98HvfCvaiuelkXOv4yhpoACOMRUMRV4VBIKNuMgjoOt9IPdW tpz5sftFsKiqQeOHvJwOKg40YldaVxJ+6/rSHV1o= From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/114646] New: libgfortran doesn't work with static libpthread Date: Mon, 08 Apr 2024 20:03:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D114646 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=20 use omp_lib implicit none integer, parameter :: NT =3D 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) =3D omp_get_num_threads() !$omp end parallel print*, nThreads END [hjl@gnu-cfl-3 tmp]$ gfortran -static -fopenmp x.f90=20 /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=20 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 refere= nce. 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]$=