public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
       [not found] <bug-39176-4@http.gcc.gnu.org/bugzilla/>
@ 2024-04-08 20:07 ` pinskia at gcc dot gnu.org
  2024-04-08 20:08 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-08 20:07 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 114646 has been marked as a duplicate of this bug. ***

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

* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
       [not found] <bug-39176-4@http.gcc.gnu.org/bugzilla/>
  2024-04-08 20:07 ` [Bug libgomp/39176] -static and -fopenmp and io causes segfault pinskia at gcc dot gnu.org
@ 2024-04-08 20:08 ` hjl.tools at gmail dot com
  2024-04-08 20:14 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2024-04-08 20:08 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=5784
   Last reconfirmed|                            |2024-04-08
         Resolution|INVALID                     |---
             Status|RESOLVED                    |REOPENED

--- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> ---
Reopened.

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

* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
       [not found] <bug-39176-4@http.gcc.gnu.org/bugzilla/>
  2024-04-08 20:07 ` [Bug libgomp/39176] -static and -fopenmp and io causes segfault pinskia at gcc dot gnu.org
  2024-04-08 20:08 ` hjl.tools at gmail dot com
@ 2024-04-08 20:14 ` hjl.tools at gmail dot com
  2024-04-08 20:16 ` pinskia at gcc dot gnu.org
  2024-04-08 20:17 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2024-04-08 20:14 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |skpgkp2 at gmail dot com
             Status|REOPENED                    |NEW

--- Comment #11 from H.J. Lu <hjl.tools at gmail dot com> ---
r12-5108

commit 80fe172ba9820199c2bbce5d0611ffca27823049
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Nov 9 23:45:36 2021 +0000

    libstdc++: Disable gthreads weak symbols for glibc 2.34 [PR103133]

    Since Glibc 2.34 all pthreads symbols are defined directly in libc not
    libpthread, and since Glibc 2.32 we have used __libc_single_threaded to
    avoid unnecessary locking in single-threaded programs. This means there
    is no reason to avoid linking to libpthread now, and so no reason to use
    weak symbols defined in gthr-posix.h for all the pthread_xxx functions.

    libstdc++-v3/ChangeLog:

            PR libstdc++/100748
            PR libstdc++/103133
            * config/os/gnu-linux/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK):
            Define for glibc 2.34 and later.

fixed static C++ pthread programs.  libgfortran neeeds a similar fix.

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

* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
       [not found] <bug-39176-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2024-04-08 20:14 ` hjl.tools at gmail dot com
@ 2024-04-08 20:16 ` pinskia at gcc dot gnu.org
  2024-04-08 20:17 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-08 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This version was invalid, see the other bug.

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

* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
       [not found] <bug-39176-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2024-04-08 20:16 ` pinskia at gcc dot gnu.org
@ 2024-04-08 20:17 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-08 20:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #11)
> fixed static C++ pthread programs.  libgfortran neeeds a similar fix.

libgcc needs the fix instead. Maybe libgomp, maybe libobjc. But this is tracked
in the other bug.

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

* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
  2009-02-13 11:40 [Bug libfortran/39176] New: [4.4 Regression] " jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2009-02-13 21:00 ` jv244 at cam dot ac dot uk
@ 2009-02-13 21:10 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-02-13 21:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2009-02-13 21:10 -------
This is not a gcc bug, glibc either should not ship libpthread.a at all or
mv libpthread.a libpthreadx.a; gcc -r -nostdlib -o libpthread.a --whole-archive
libpthreadx.a; rm libpthreadx.a
I'll try the latter in Fedora soon.
In any case, users really shouldn't use -static except for a few system
recovery tools, see
http://people.redhat.com/drepper/no_static_linking.html


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39176


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

* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
  2009-02-13 11:40 [Bug libfortran/39176] New: [4.4 Regression] " jv244 at cam dot ac dot uk
  2009-02-13 14:01 ` [Bug libgomp/39176] " jv244 at cam dot ac dot uk
  2009-02-13 20:18 ` pinskia at gcc dot gnu dot org
@ 2009-02-13 21:00 ` jv244 at cam dot ac dot uk
  2009-02-13 21:10 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 9+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-02-13 21:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jv244 at cam dot ac dot uk  2009-02-13 21:00 -------
(In reply to comment #6)
> Not a gcc bug so closing as invalid.  

The gcc  'bug' is that -fopenmp -static should link to pthreads as 
-Wl,--whole-archive -lpthread -Wl,--no-whole-archive, if that is required, or
error out if that is not possible. 

The current way of just adding -lpthread and hoping it is correct (even in the
presence of -static) is leading to wrong code.


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|INVALID                     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39176


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

* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
  2009-02-13 11:40 [Bug libfortran/39176] New: [4.4 Regression] " jv244 at cam dot ac dot uk
  2009-02-13 14:01 ` [Bug libgomp/39176] " jv244 at cam dot ac dot uk
@ 2009-02-13 20:18 ` pinskia at gcc dot gnu dot org
  2009-02-13 21:00 ` jv244 at cam dot ac dot uk
  2009-02-13 21:10 ` jakub at gcc dot gnu dot org
  3 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-02-13 20:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2009-02-13 20:18 -------
Not a gcc bug so closing as invalid.  That warning comes from glibc anyways.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39176


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

* [Bug libgomp/39176] -static and -fopenmp and io causes segfault
  2009-02-13 11:40 [Bug libfortran/39176] New: [4.4 Regression] " jv244 at cam dot ac dot uk
@ 2009-02-13 14:01 ` jv244 at cam dot ac dot uk
  2009-02-13 20:18 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: jv244 at cam dot ac dot uk @ 2009-02-13 14:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jv244 at cam dot ac dot uk  2009-02-13 14:01 -------
(In reply to comment #4)
> It is glibc specific, on the other hand it isn't particularly -fopenmp related.
> I guess easiest will be if glibc stops shipping libpthread.a.

but if -fopenmp automatically adds -lpthread maybe it should do it in the
'proper' way if -static is also on the command line (eventually bailing out if
libpthread.a can not be found)? 

Note, e.g. a warning is produced for similar issues already, e.g. I see:

/home/u1/vondele/gcc_trunk/build/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.4.0/../../../../lib64/libgfortran.a(getlog.o):
In function `_gfortran_getlog':
/home/u1/vondele/gcc_trunk/gcc/libgfortran/intrinsics/getlog.c:82: warning:
Using 'getpwuid' in statically linked applications requires at runtime the
shared libraries from the glibc version used for linking

let me reopen the bug, removing the regression marker, and as an enhancement. I
think that a warning, or adding -lpthread in the 'proper' way if -static will
save many other users from loosing time on this one.


-- 

jv244 at cam dot ac dot uk changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|RESOLVED                    |UNCONFIRMED
          Component|libfortran                  |libgomp
         Resolution|INVALID                     |
            Summary|[4.4 Regression] -static and|-static and -fopenmp and io
                   |-fopenmp and io causes      |causes segfault
                   |segfault                    |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39176


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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-39176-4@http.gcc.gnu.org/bugzilla/>
2024-04-08 20:07 ` [Bug libgomp/39176] -static and -fopenmp and io causes segfault pinskia at gcc dot gnu.org
2024-04-08 20:08 ` hjl.tools at gmail dot com
2024-04-08 20:14 ` hjl.tools at gmail dot com
2024-04-08 20:16 ` pinskia at gcc dot gnu.org
2024-04-08 20:17 ` pinskia at gcc dot gnu.org
2009-02-13 11:40 [Bug libfortran/39176] New: [4.4 Regression] " jv244 at cam dot ac dot uk
2009-02-13 14:01 ` [Bug libgomp/39176] " jv244 at cam dot ac dot uk
2009-02-13 20:18 ` pinskia at gcc dot gnu dot org
2009-02-13 21:00 ` jv244 at cam dot ac dot uk
2009-02-13 21:10 ` jakub at gcc dot gnu dot org

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).