[Bug c++/49811] New: Crash at __do_global_dtors_aux when compiled with '-shared -static'

2011-07-21 Thread nn.dm55 at gmail dot com
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: unassig...@gcc.gnu.org
ReportedBy: nn.d...@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/


[Bug c++/49811] Crash at __do_global_dtors_aux when compiled with '-shared -static'

2011-07-21 Thread nn.dm55 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49811

--- Comment #1 from Nathan  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'


[Bug c++/49811] Crash at __do_global_dtors_aux when compiled with '-shared -static'

2011-08-07 Thread nn.dm55 at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49811

--- Comment #3 from Nathan  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.