public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49811] New: Crash at __do_global_dtors_aux when compiled with '-shared -static'
@ 2011-07-22 4:14 nn.dm55 at gmail dot com
2011-07-22 4:16 ` [Bug c++/49811] " nn.dm55 at gmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: nn.dm55 at gmail dot com @ 2011-07-22 4:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49811
Summary: Crash at __do_global_dtors_aux when compiled with
'-shared -static'
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: nn.dm55@gmail.com
Created attachment 24806
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24806
Program which crashes when run.
While trying to statically include a library for a game, I compiled with both
'-shared' and '-static'. I ran the program and it crashed with "Segmentation
fault".
I reduced the program down to the minimum required to make it crash. When I
compiled the test with 'gcc -o segment_test -shared -static main.cpp' and ran
the program ('./segment_test'), the program still crashed with the same error
as the original.
System information:
openSUSE 11.3
Linux linux-d9bc 2.6.34.8-0.2-default #1 SMP 2011-04-06 18:11:26 +0200 i686
i686 i386 GNU/Linux
GCC is packaged in gcc-4.4-4.2-i586.rpm from
http://download.opensuse.org/distribution/11.2/repo/oss/
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/49811] Crash at __do_global_dtors_aux when compiled with '-shared -static'
2011-07-22 4:14 [Bug c++/49811] New: Crash at __do_global_dtors_aux when compiled with '-shared -static' nn.dm55 at gmail dot com
@ 2011-07-22 4:16 ` nn.dm55 at gmail dot com
2011-07-23 22:19 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: nn.dm55 at gmail dot com @ 2011-07-22 4:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49811
--- Comment #1 from Nathan <nn.dm55 at gmail dot com> 2011-07-22 04:16:08 UTC ---
Created attachment 24807
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24807
GCC output when run with additional '-v -save-temps'
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/49811] Crash at __do_global_dtors_aux when compiled with '-shared -static'
2011-07-22 4:14 [Bug c++/49811] New: Crash at __do_global_dtors_aux when compiled with '-shared -static' nn.dm55 at gmail dot com
2011-07-22 4:16 ` [Bug c++/49811] " nn.dm55 at gmail dot com
@ 2011-07-23 22:19 ` pinskia at gcc dot gnu.org
2011-08-07 23:13 ` nn.dm55 at gmail dot com
2013-11-10 6:16 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-07-23 22:19 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49811
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-07-23 22:19:20 UTC ---
"-shared -static" does not make sense really. Are you trying to compile a
libary that contains all other libraries compiled staticly? If so then
"-shared -static" makes sense. It does not produce an application but rather a
shared library.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/49811] Crash at __do_global_dtors_aux when compiled with '-shared -static'
2011-07-22 4:14 [Bug c++/49811] New: Crash at __do_global_dtors_aux when compiled with '-shared -static' nn.dm55 at gmail dot com
2011-07-22 4:16 ` [Bug c++/49811] " nn.dm55 at gmail dot com
2011-07-23 22:19 ` pinskia at gcc dot gnu.org
@ 2011-08-07 23:13 ` nn.dm55 at gmail dot com
2013-11-10 6:16 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: nn.dm55 at gmail dot com @ 2011-08-07 23:13 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49811
--- Comment #3 from Nathan <nn.dm55 at gmail dot com> 2011-08-07 23:13:31 UTC ---
I was trying to make it prefer static libraries to shared libraries.
(In reply to comment #2)
> "-shared -static" does not make sense really. Are you trying to compile a
> libary that contains all other libraries compiled staticly? If so then
> "-shared -static" makes sense. It does not produce an application but rather a
> shared library.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/49811] Crash at __do_global_dtors_aux when compiled with '-shared -static'
2011-07-22 4:14 [Bug c++/49811] New: Crash at __do_global_dtors_aux when compiled with '-shared -static' nn.dm55 at gmail dot com
` (2 preceding siblings ...)
2011-08-07 23:13 ` nn.dm55 at gmail dot com
@ 2013-11-10 6:16 ` pinskia at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-11-10 6:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49811
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
-shared is forcing a creation of a shared library while -static is forcing the
libraries to be staticaly linked. So this only makes sense if you have forcing
static libc (etc.) for a shared library. If you force a static library use
-Wl,-Bstatic -lxyz -Wl,-Bdynamic .
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-11-10 6:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-22 4:14 [Bug c++/49811] New: Crash at __do_global_dtors_aux when compiled with '-shared -static' nn.dm55 at gmail dot com
2011-07-22 4:16 ` [Bug c++/49811] " nn.dm55 at gmail dot com
2011-07-23 22:19 ` pinskia at gcc dot gnu.org
2011-08-07 23:13 ` nn.dm55 at gmail dot com
2013-11-10 6:16 ` pinskia at gcc dot gnu.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).