public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit
@ 2005-04-29  7:33 info at yourkit dot com
  2005-04-29  7:39 ` [Bug libstdc++/21277] " pinskia at gcc dot gnu dot org
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-04-29  7:33 UTC (permalink / raw)
  To: gcc-bugs

Summary: gcc 4.0 produces corrupted shared library if it is statically linked
with libstdc++ and etc. stuff


>g++ -v

Using built-in specs.
Target: sparc-sun-solaris2.9
Configured with: ../gcc-4.0.0/configure
--prefix=/home2/anton/opt/gcc-4.0.0-noshared --with-gnu-ld
--with-ld=/home2/anton/opt/bin/ld --with-gnu-as
--with-as=/home2/anton/opt/bin/as --disable-libgcj --enable-languages=c,c++
--disable-shared
Thread model: posix
gcc version 4.0.0

>uname -a

SunOS solaris 5.9 Generic_117171-07 sun4u sparc SUNW,Sun-Blade-100

Source code of shared library:

=== q.cpp start ===

#include <stdio.h>

extern "C" {
  void foo() {
    printf("sizeof(void*)=%d\n", sizeof(void*));
  }
}

=== q.cpp end ===

>g++ -m64 -fPIC q.cpp -shared -o libq.so
>file libq.so
libq.so:        ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically
linked, not stripped
>ldd -Ur libq.so
        libm.so.1 =>     /usr/lib/64/libm.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        /usr/platform/SUNW,Sun-Blade-100/lib/sparcv9/libc_psr.so.1

   unreferenced object=/usr/lib/64/libm.so.1; unused dependency of ./libq.so
   unused object=/usr/lib/64/libm.so.1; member of cyclic group [1]

Everything seems to be OK.

But when we load .so with the following simple program test.cpp, it prints error
message:

=== test.cpp start ===
#include <dlfcn.h>      /* defines dlopen(), etc.       */
#include <stdlib.h>
#include <stdio.h>

int main() {

  void* lib_handle = dlopen("/home2/anton/projects/frekenbok/libq.so", RTLD_LAZY);
  if (!lib_handle) {
      fprintf(stderr, "Error during dlopen(): %s\n", dlerror());
      exit(1);
  }

}
=== test.cpp end ===

>g++ -m64 test.cpp
>./a.out
Error during dlopen(): ld.so.1: a.out: fatal: relocation error: R_SPARC_WDISP30:
file /home2/anton/projects/frekenbok/libq.so: symbol strcpy: value 0x6053f9f7
does not fit


There is no problem if gcc is configured with shared enabled (i.e. without
"--disable-shared" flag), and .so is dynamically linked with libstdc++.so etc.
As well everything is fine in 32 bit mode (-m32), even statically linked.

So the problem appears _only_ in 64 bit mode and _only_ when resulting shared
library is statically linked.

-- 
           Summary: gcc 4.0 fails to statically link on Solaris SPARC 64 bit
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: info at yourkit dot com
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
  2005-04-29  7:39 ` [Bug libstdc++/21277] " pinskia at gcc dot gnu dot org
@ 2005-04-29  7:39 ` pinskia at gcc dot gnu dot org
  2005-04-29  7:39 ` info at yourkit dot com
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-29  7:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-29 07:39 -------
So you are not building with --with-pic?

-- 


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


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

* [Bug c++/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
  2005-04-29  7:39 ` [Bug libstdc++/21277] " pinskia at gcc dot gnu dot org
  2005-04-29  7:39 ` [Bug c++/21277] " pinskia at gcc dot gnu dot org
@ 2005-04-29  7:39 ` info at yourkit dot com
  2005-04-29  7:55 ` [Bug libstdc++/21277] " pcarlini at suse dot de
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-04-29  7:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-04-29 07:38 -------
Forgot to say: binutils 2.15

-- 


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


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

* [Bug libstdc++/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
@ 2005-04-29  7:39 ` pinskia at gcc dot gnu dot org
  2005-04-29  7:39 ` [Bug c++/21277] " pinskia at gcc dot gnu dot org
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-29  7:39 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |libstdc++


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


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

* [Bug libstdc++/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (2 preceding siblings ...)
  2005-04-29  7:39 ` info at yourkit dot com
@ 2005-04-29  7:55 ` pcarlini at suse dot de
  2005-04-29  8:27 ` [Bug c++/21277] " info at yourkit dot com
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pcarlini at suse dot de @ 2005-04-29  7:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2005-04-29 07:54 -------
Also, please have a look to http://gcc.gnu.org/install/specific.html: it states
that stock binutils 2.15 is *broken* on this target and provides a pointer to
a patch (we received already lots of complaints from people using stock binutils
2.15, e.g., http://gcc.gnu.org/ml/libstdc++/2005-04/msg00237.html)

-- 


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


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

* [Bug c++/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (3 preceding siblings ...)
  2005-04-29  7:55 ` [Bug libstdc++/21277] " pcarlini at suse dot de
@ 2005-04-29  8:27 ` info at yourkit dot com
  2005-04-29 12:40 ` [Bug target/21277] " pinskia at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-04-29  8:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-04-29 08:27 -------
> So you are not building with --with-pic?

I'm sorry, where and when should I specify this option? gcc's configure --help
does not return this flag among possible options.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|libstdc++                   |c++


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


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

* [Bug target/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (4 preceding siblings ...)
  2005-04-29  8:27 ` [Bug c++/21277] " info at yourkit dot com
@ 2005-04-29 12:40 ` pinskia at gcc dot gnu dot org
  2005-04-29 15:25 ` [Bug c++/21277] " info at yourkit dot com
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-29 12:40 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |target


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


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

* [Bug c++/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (5 preceding siblings ...)
  2005-04-29 12:40 ` [Bug target/21277] " pinskia at gcc dot gnu dot org
@ 2005-04-29 15:25 ` info at yourkit dot com
  2005-04-29 19:19 ` pinskia at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-04-29 15:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-04-29 15:25 -------
I have re-installed the recommended at http://gcc.gnu.org/install/specific.html
binutils (branch binutils-2_15-branch from CVS) AND even re-compiled gcc after that.

It doesn't help - the problem remains.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|target                      |c++


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


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

* [Bug c++/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (6 preceding siblings ...)
  2005-04-29 15:25 ` [Bug c++/21277] " info at yourkit dot com
@ 2005-04-29 19:19 ` pinskia at gcc dot gnu dot org
  2005-04-29 19:20 ` pinskia at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-29 19:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-29 19:19 -------
libstdc++'s configure contains the docs for --with-pic:
  --with-pic              try to use only PIC/non-PIC objects default=use both
I think this is a standard libtool based option.

-- 


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


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

* [Bug c++/21277] gcc 4.0 fails to statically link on Solaris SPARC 64 bit
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (7 preceding siblings ...)
  2005-04-29 19:19 ` pinskia at gcc dot gnu dot org
@ 2005-04-29 19:20 ` pinskia at gcc dot gnu dot org
  2005-04-30 20:46 ` [Bug target/21277] Runtime error with C++ shared library and --disable-shared ebotcazou at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-29 19:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-29 19:20 -------
So does recompiling gcc with --with-pic fix the problem?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (8 preceding siblings ...)
  2005-04-29 19:20 ` pinskia at gcc dot gnu dot org
@ 2005-04-30 20:46 ` ebotcazou at gcc dot gnu dot org
  2005-05-02  6:59 ` info at yourkit dot com
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-04-30 20:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-04-30 20:46 -------
Andrew is right, this error usually means that a shared library contains code
that has not been compiled with -fPIC.  The Solaris 64-bit runtime linker
doesn't seem to be able to cope with this (unlike the 32-bit one).

Does it change anything if you build libq.so with -mimpure-text?


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
           Severity|critical                    |normal
          Component|c++                         |target
  GCC build triplet|                            |sparc64-sun-solaris2.*
   GCC host triplet|                            |sparc64-sun-solaris2.*
 GCC target triplet|                            |sparc64-sun-solaris2.*
           Priority|P3                          |P2
            Summary|gcc 4.0 fails to statically |Runtime error with C++
                   |link on Solaris SPARC 64 bit|shared library and --
                   |                            |disable-shared


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (9 preceding siblings ...)
  2005-04-30 20:46 ` [Bug target/21277] Runtime error with C++ shared library and --disable-shared ebotcazou at gcc dot gnu dot org
@ 2005-05-02  6:59 ` info at yourkit dot com
  2005-05-02  7:16 ` ebotcazou at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-05-02  6:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-05-02 06:59 -------
First of all, thank you all for the suggestions.

> libstdc++'s configure contains the docs for --with-pic:

I'm sorry, I'm not a gcc configuration guru :), and all that I was doing was
building gcc via its configure + make, according to the published instructions.
Could you please give me a hint. On what stage of gcc build process can I pass
this option? Isn't the process of libstdc++ build a part of the entire gcc build? 
Should I pass --with-pic to gcc configure's command line? 

> Does it change anything if you build libq.so with -mimpure-text?

I'd be happy to try if you'd tell me where to switch this option



-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (10 preceding siblings ...)
  2005-05-02  6:59 ` info at yourkit dot com
@ 2005-05-02  7:16 ` ebotcazou at gcc dot gnu dot org
  2005-05-02  7:19 ` info at yourkit dot com
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-05-02  7:16 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-02 07:15 -------
> I'd be happy to try if you'd tell me where to switch this option

g++ -m64 -fPIC q.cpp -shared -mimpure-text -o libq.so


-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (11 preceding siblings ...)
  2005-05-02  7:16 ` ebotcazou at gcc dot gnu dot org
@ 2005-05-02  7:19 ` info at yourkit dot com
  2005-05-02  7:23 ` info at yourkit dot com
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-05-02  7:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-05-02 07:19 -------
> > I'd be happy to try if you'd tell me where to switch this option

> g++ -m64 -fPIC q.cpp -shared -mimpure-text -o libq.so

It doesn't help -- the same problem

-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (12 preceding siblings ...)
  2005-05-02  7:19 ` info at yourkit dot com
@ 2005-05-02  7:23 ` info at yourkit dot com
  2005-05-02  7:27 ` ebotcazou at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-05-02  7:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-05-02 07:23 -------
Eric, maybe you can tell me more how/where to apply this --with-pic option? 
I was googling myself, but found nothing about this option.

-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (13 preceding siblings ...)
  2005-05-02  7:23 ` info at yourkit dot com
@ 2005-05-02  7:27 ` ebotcazou at gcc dot gnu dot org
  2005-05-02  7:33 ` info at yourkit dot com
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-05-02  7:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-02 07:27 -------
> It doesn't help -- the same problem

OK.  To further confirm the diagnostic, you could run readelf -r on libq.so and
find out where this R_SPARC_WDISP30 relocation comes from.

-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (14 preceding siblings ...)
  2005-05-02  7:27 ` ebotcazou at gcc dot gnu dot org
@ 2005-05-02  7:33 ` info at yourkit dot com
  2005-05-02  7:57 ` ebotcazou at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-05-02  7:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-05-02 07:33 -------
readelf -r libq.so  | grep R_SPARC_WDISP30    gives the following:

00000000a73c  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000a764  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000a890  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000ab70  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000b234  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000b244  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000cd04  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000cd48  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000cd6c  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000cde4  004f00000007 R_SPARC_WDISP30   0000000000000000 abort + 0
00000000a754  008500000007 R_SPARC_WDISP30   0000000000012a20 _Unwind_GetTextRelBase + 0
00000000a76c  003600000007 R_SPARC_WDISP30   0000000000012a30 _Unwind_GetRegionStart + 0
00000000aa38  003600000007 R_SPARC_WDISP30   0000000000012a30 _Unwind_GetRegionStart + 0
00000000a774  00ad00000007 R_SPARC_WDISP30   0000000000012a28 _Unwind_GetDataRelBase + 0
00000000acc8  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000acec  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000b1f4  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000b204  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000b23c  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000b3cc  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000b438  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000cd5c  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000cd74  008a00000007 R_SPARC_WDISP30   000000000000b720 __cxa_begin_catch + 0
00000000ace4  008c00000007 R_SPARC_WDISP30   000000000000b284 _ZN10__cxxabiv112__une + 
0
00000000b2b4  008c00000007 R_SPARC_WDISP30   000000000000b284 _ZN10__cxxabiv112__une + 
0
00000000acf4  007a00000007 R_SPARC_WDISP30   000000000000ba68 __cxa_get_globals_fast + 0
00000000b7d4  007a00000007 R_SPARC_WDISP30   000000000000ba68 __cxa_get_globals_fast + 0
00000000ad6c  009200000007 R_SPARC_WDISP30   000000000000b580 __cxa_allocate_excepti + 0
00000000ada8  007500000007 R_SPARC_WDISP30   000000000000b340 __cxa_throw + 0
00000000adb0  005000000007 R_SPARC_WDISP30   000000000000b7d0 __cxa_end_catch + 0
00000000adb8  005000000007 R_SPARC_WDISP30   000000000000b7d0 __cxa_end_catch + 0
00000000b214  005000000007 R_SPARC_WDISP30   000000000000b7d0 __cxa_end_catch + 0
00000000b24c  005000000007 R_SPARC_WDISP30   000000000000b7d0 __cxa_end_catch + 0
00000000cd64  005000000007 R_SPARC_WDISP30   000000000000b7d0 __cxa_end_catch + 0
00000000cddc  005000000007 R_SPARC_WDISP30   000000000000b7d0 __cxa_end_catch + 0
00000000cdec  005000000007 R_SPARC_WDISP30   000000000000b7d0 __cxa_end_catch + 0
00000000adc0  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000b21c  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000b254  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000b56c  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000b70c  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000b7bc  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000badc  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000bc88  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000cdf4  005f00000007 R_SPARC_WDISP30   0000000000014828 _Unwind_Resume + 0
00000000adc8  009d00000007 R_SPARC_WDISP30   000000000000b228 _ZN10__cxxabiv111__ter + 0
00000000b1fc  009d00000007 R_SPARC_WDISP30   000000000000b228 _ZN10__cxxabiv111__ter + 0
00000000b278  009d00000007 R_SPARC_WDISP30   000000000000b228 _ZN10__cxxabiv111__ter + 0
00000000b334  009d00000007 R_SPARC_WDISP30   000000000000b228 _ZN10__cxxabiv111__ter + 0
00000000add0  002600000007 R_SPARC_WDISP30   000000000000b3e0 __cxa_rethrow + 0
00000000cca0  002600000007 R_SPARC_WDISP30   000000000000b3e0 __cxa_rethrow + 0
00000000ccc0  002600000007 R_SPARC_WDISP30   000000000000b3e0 __cxa_rethrow + 0
00000000ae78  009c00000007 R_SPARC_WDISP30   0000000000012d74 _Unwind_SetGR + 0
00000000ae8c  009c00000007 R_SPARC_WDISP30   0000000000012d74 _Unwind_SetGR + 0
00000000ae9c  007600000007 R_SPARC_WDISP30   0000000000012dd0 _Unwind_SetIP + 0
00000000af14  008900000007 R_SPARC_WDISP30   0000000000012dd8 _Unwind_GetLanguageSpe + 
0
00000000af58  002800000007 R_SPARC_WDISP30   0000000000012dc8 _Unwind_GetIP + 0
00000000b1e4  002200000007 R_SPARC_WDISP30   000000000000b29c _ZSt10unexpectedv + 0
00000000b1ec  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000b20c  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000b290  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000b3d4  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000b440  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000b6f8  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000b7a8  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000b870  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000bc74  005300000007 R_SPARC_WDISP30   000000000000b260 _ZSt9terminatev + 0
00000000b32c  002000000007 R_SPARC_WDISP30   000000000000b478 __cxa_free_exception + 0
00000000b3c4  006f00000007 R_SPARC_WDISP30   00000000000148c0 _Unwind_RaiseException + 0
00000000b3e4  00a200000007 R_SPARC_WDISP30   000000000000bbb0 __cxa_get_globals + 0
00000000b5f8  00a200000007 R_SPARC_WDISP30   000000000000bbb0 __cxa_get_globals + 0
00000000b724  00a200000007 R_SPARC_WDISP30   000000000000bbb0 __cxa_get_globals + 0
00000000b880  00a200000007 R_SPARC_WDISP30   000000000000bbb0 __cxa_get_globals + 0
000000012660  00a200000007 R_SPARC_WDISP30   000000000000bbb0 __cxa_get_globals + 0
00000000b430  003200000007 R_SPARC_WDISP30   00000000000149ec _Unwind_Resume_or_Reth + 
0
00000000b510  00b500000007 R_SPARC_WDISP30   0000000000000000 free + 0
00000000b9f8  00b500000007 R_SPARC_WDISP30   0000000000000000 free + 0
00000000ccb8  00b500000007 R_SPARC_WDISP30   0000000000000000 free + 0
00000000f4dc  00b500000007 R_SPARC_WDISP30   0000000000000000 free + 0
00000000f5bc  00b500000007 R_SPARC_WDISP30   0000000000000000 free + 0
0000000125b0  00b500000007 R_SPARC_WDISP30   0000000000000000 free + 0
0000000125ec  00b500000007 R_SPARC_WDISP30   0000000000000000 free + 0
00000001264c  00b500000007 R_SPARC_WDISP30   0000000000000000 free + 0
00000000b52c  008000000007 R_SPARC_WDISP30   0000000000000000 pthread_mutex_unlock + 0
00000000b69c  008000000007 R_SPARC_WDISP30   0000000000000000 pthread_mutex_unlock + 0
00000000b550  009900000007 R_SPARC_WDISP30   0000000000000000 pthread_mutex_lock + 0
00000000b6c0  009900000007 R_SPARC_WDISP30   0000000000000000 pthread_mutex_lock + 0
00000000b574  003b00000007 R_SPARC_WDISP30   000000000000acc0 __cxa_call_unexpected + 0
00000000b714  003b00000007 R_SPARC_WDISP30   000000000000acc0 __cxa_call_unexpected + 0
00000000b7c4  003b00000007 R_SPARC_WDISP30   000000000000acc0 __cxa_call_unexpected + 0
00000000bae4  003b00000007 R_SPARC_WDISP30   000000000000acc0 __cxa_call_unexpected + 0
00000000bc90  003b00000007 R_SPARC_WDISP30   000000000000acc0 __cxa_call_unexpected + 0
00000000b588  004300000007 R_SPARC_WDISP30   0000000000000000 malloc + 0
00000000bc3c  004300000007 R_SPARC_WDISP30   0000000000000000 malloc + 0
0000000123e0  004300000007 R_SPARC_WDISP30   0000000000000000 malloc + 0
0000000124c4  004300000007 R_SPARC_WDISP30   0000000000000000 malloc + 0
00000000b614  007800000007 R_SPARC_WDISP30   0000000000000000 memset + 0
00000000b810  006000000007 R_SPARC_WDISP30   0000000000012fa4 _Unwind_DeleteExceptio + 0
00000000b848  006000000007 R_SPARC_WDISP30   0000000000012fa4 _Unwind_DeleteExceptio + 0
00000000b9e8  006000000007 R_SPARC_WDISP30   0000000000012fa4 _Unwind_DeleteExceptio + 0
00000000b900  004c00000007 R_SPARC_WDISP30   0000000000012640 _ZdlPv + 0
00000000b98c  004c00000007 R_SPARC_WDISP30   0000000000012640 _ZdlPv + 0
00000000bd28  004c00000007 R_SPARC_WDISP30   0000000000012640 _ZdlPv + 0
00000000bdb4  004c00000007 R_SPARC_WDISP30   0000000000012640 _ZdlPv + 0
00000000be40  004c00000007 R_SPARC_WDISP30   0000000000012640 _ZdlPv + 0
00000000beb8  004c00000007 R_SPARC_WDISP30   0000000000012640 _ZdlPv + 0
00000000bf44  004c00000007 R_SPARC_WDISP30   0000000000012640 _ZdlPv + 0
00000000bfd0  004c00000007 R_SPARC_WDISP30   0000000000012640 _ZdlPv + 0
00000000b92c  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000b958  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000b984  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000bd54  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000bd80  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000bdac  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000bde0  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000be0c  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000be38  003100000007 R_SPARC_WDISP30   000000000000b8a0 _ZNSt9exceptionD2Ev + 0
00000000ba38  006300000007 R_SPARC_WDISP30   0000000000000000 pthread_key_create + 0
00000000bac0  002f00000007 R_SPARC_WDISP30   0000000000000000 pthread_getspecific + 0
00000000bbf0  002f00000007 R_SPARC_WDISP30   0000000000000000 pthread_getspecific + 0
00000000bb3c  005d00000007 R_SPARC_WDISP30   0000000000000000 pthread_once + 0
00000000bc50  00b400000007 R_SPARC_WDISP30   0000000000000000 pthread_setspecific + 0
00000000bcdc  006900000007 R_SPARC_WDISP30   000000000000bc9c _ZNSt9type_infoD2Ev + 0
00000000be84  006900000007 R_SPARC_WDISP30   000000000000bc9c _ZNSt9type_infoD2Ev + 0
00000000beb0  006900000007 R_SPARC_WDISP30   000000000000bc9c _ZNSt9type_infoD2Ev + 0
00000000bee4  008b00000007 R_SPARC_WDISP30   000000000000bcbc _ZN10__cxxabiv117__cla + 0
00000000bf10  008b00000007 R_SPARC_WDISP30   000000000000bcbc _ZN10__cxxabiv117__cla + 0
00000000bf3c  008b00000007 R_SPARC_WDISP30   000000000000bcbc _ZN10__cxxabiv117__cla + 0
00000000bf70  008b00000007 R_SPARC_WDISP30   000000000000bcbc _ZN10__cxxabiv117__cla + 0
00000000bf9c  008b00000007 R_SPARC_WDISP30   000000000000bcbc _ZN10__cxxabiv117__cla + 0
00000000bfc8  008b00000007 R_SPARC_WDISP30   000000000000bcbc _ZN10__cxxabiv117__cla + 0
00000000c154  004b00000007 R_SPARC_WDISP30   000000000000c108 _ZNK10__cxxabiv117__cl + 0
00000000c270  004b00000007 R_SPARC_WDISP30   000000000000c108 _ZNK10__cxxabiv117__cl + 0
00000000cbd4  00a900000007 R_SPARC_WDISP30   000000000001265c __cxa_current_exceptio + 0
00000000cbf8  002500000007 R_SPARC_WDISP30   000000000001254c __cxa_demangle + 0
00000000cc38  009300000007 R_SPARC_WDISP30   0000000000000000 fwrite + 0
00000000cc88  009300000007 R_SPARC_WDISP30   0000000000000000 fwrite + 0
00000000ccfc  009300000007 R_SPARC_WDISP30   0000000000000000 fwrite + 0
00000000cd40  009300000007 R_SPARC_WDISP30   0000000000000000 fwrite + 0
00000000cdbc  009300000007 R_SPARC_WDISP30   0000000000000000 fwrite + 0
00000000cc54  00ac00000007 R_SPARC_WDISP30   0000000000000000 fputs + 0
00000000cca8  00ac00000007 R_SPARC_WDISP30   0000000000000000 fputs + 0
00000000cdc8  00ac00000007 R_SPARC_WDISP30   0000000000000000 fputs + 0
00000000cdd4  008800000007 R_SPARC_WDISP30   0000000000000000 fputc + 0
00000000dd9c  006d00000007 R_SPARC_WDISP30   0000000000000000 memcmp + 0
00000000f20c  007f00000007 R_SPARC_WDISP30   0000000000000000 strcmp + 0
00000000f4b8  006b00000007 R_SPARC_WDISP30   0000000000000000 realloc + 0
00000000f59c  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000fa50  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000faa8  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000fb40  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000fc24  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000fc6c  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000fcb4  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000fe48  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000fe90  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000fed8  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000ff20  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000000ff68  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000010048  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000010174  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000010374  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
0000000103bc  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
0000000106c8  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000010720  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000010ef4  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000011220  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000011f04  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000011f60  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000011fd8  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000001220c  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
0000000124f8  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
00000001252c  003f00000007 R_SPARC_WDISP30   0000000000000000 memcpy + 0
000000012238  00a400000007 R_SPARC_WDISP30   0000000000000000 strlen + 0
00000001258c  00a400000007 R_SPARC_WDISP30   0000000000000000 strlen + 0
000000012270  006800000007 R_SPARC_WDISP30   0000000000000000 strncmp + 0
000000012504  005b00000007 R_SPARC_WDISP30   0000000000000000 strcat + 0
0000000125a4  002300000007 R_SPARC_WDISP30   0000000000000000 strcpy + 0



-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (15 preceding siblings ...)
  2005-05-02  7:33 ` info at yourkit dot com
@ 2005-05-02  7:57 ` ebotcazou at gcc dot gnu dot org
  2005-05-02  8:15 ` info at yourkit dot com
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-05-02  7:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-02 07:57 -------
> readelf -r libq.so  | grep R_SPARC_WDISP30    gives the following:

OK, the fundamental problem is that you're trying to build shared libraries with
a compiler configured with --disable-shared.  That's not really intended (and
might cause problems for exception propagation in C++).

The fix is indeed to recompile every GCC library with -fPIC.  Try to configure
at toplevel --with-pic, but I'm not sure the option is valid there.  Otherwise
you'll need to specifically configure libstdc++-v3 --with-pic.


-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (16 preceding siblings ...)
  2005-05-02  7:57 ` ebotcazou at gcc dot gnu dot org
@ 2005-05-02  8:15 ` info at yourkit dot com
  2005-05-02  9:05 ` ebotcazou at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-05-02  8:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-05-02 08:15 -------
> OK, the fundamental problem is that you're trying to build shared libraries with
a compiler configured with --disable-shared.  That's not really intended (and
might cause problems for exception propagation in C++).

We must link our .so statically with all the gcc stuff to make sure it runs on
every Solaris. Shipping libstd++.so with our shared library is not very suitable
for us, because it makes product download size bigger.

Without --disable-shared we had other problems linking 64 bit code statically.

Anyway, option --disable-shared exists, and is documented. So it should either
properly work (for platforms it is supported for), or be dropped (for platforms
where it is not supported). While there's nothing said it is not supported for
Solaris, all its improper work is a bug, and nothing but a bug. Isn't it? :)

> The fix is indeed to recompile every GCC library with -fPIC.  Try to configure
at toplevel --with-pic, but I'm not sure the option is valid there.  Otherwise
you'll need to specifically configure libstdc++-v3 --with-pic.

Thank you for the suggestion. I'll try it now, and will let you know whether it
helps.


-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (17 preceding siblings ...)
  2005-05-02  8:15 ` info at yourkit dot com
@ 2005-05-02  9:05 ` ebotcazou at gcc dot gnu dot org
  2005-05-02  9:25 ` info at yourkit dot com
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-05-02  9:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-02 09:05 -------
> We must link our .so statically with all the gcc stuff to make sure it runs on
> every Solaris. Shipping libstd++.so with our shared library is not very
> suitable for us, because it makes product download size bigger.

5 MB uncompressed for 32-bit, 6 MB uncompressed for 64-bit!

> Anyway, option --disable-shared exists, and is documented. So it should either
> properly work (for platforms it is supported for), or be dropped (forplatforms
> where it is not supported). While there's nothing said it is not supported for
> Solaris, all its improper work is a bug, and nothing but a bug. Isn't it? :)

There is nothing wrong in the current behavior of --disable-shared: it builds
static libraries the way static libraries should be built.  Your practice of
building shared libraries with a compiler configured with --disable-shared looks
far more questionable to me; if I were to change something, I'd simply reject
-shared in that case.  Note for example that a shared libgcc is required on
Solaris for exception propagation accross shared libraries.


-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (18 preceding siblings ...)
  2005-05-02  9:05 ` ebotcazou at gcc dot gnu dot org
@ 2005-05-02  9:25 ` info at yourkit dot com
  2005-05-02  9:47 ` info at yourkit dot com
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-05-02  9:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-05-02 09:25 -------
> 5 MB uncompressed for 32-bit, 6 MB uncompressed for 64-bit!

Of course it's not a show stopper, but given 2-3M total packed size of the
distribution, we'd prefer not to double it. Furthermore, the approach always
worked for 32 bit.

> There is nothing wrong in the current behavior of --disable-shared: it builds
static libraries the way static libraries should be built.  Your practice of
building shared libraries with a compiler configured with --disable-shared looks
far more questionable to me; if I were to change something, I'd simply reject
-shared in that case.  Note for example that a shared libgcc is required on
Solaris for exception propagation accross shared libraries.

Actually, instead of --disable-shared we were successfully using gcc compiled
without this flag, specifing appropriate *.a on linking stage. --disable-shared
only makes compile [command line] more straightforward, not letting compiler
using .so's instead.

There's absolutely nothing illegal in static linking with a shared library other
libraries that it uses. The intention is to make resulting shared library
loadable on every target machine with no regard to availablity of shared
libraries, and make the library as small as possible.

The approach works fine for 32 bit on Solaris. And it is definetely a bug that
it doesn't do so for 64 bit.


-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (19 preceding siblings ...)
  2005-05-02  9:25 ` info at yourkit dot com
@ 2005-05-02  9:47 ` info at yourkit dot com
  2005-05-02  9:54 ` ebotcazou at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-05-02  9:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-05-02 09:46 -------
Adding --with-pic to the command line of gcc's configure helped.

Thanks a lot, Eric!

-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (20 preceding siblings ...)
  2005-05-02  9:47 ` info at yourkit dot com
@ 2005-05-02  9:54 ` ebotcazou at gcc dot gnu dot org
  2005-05-02  9:58 ` ebotcazou at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-05-02  9:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-02 09:54 -------
> There's absolutely nothing illegal in static linking with a shared library
> other libraries that it uses. The intention is to make resulting shared 
> library loadable on every target machine with no regard to availablity of 
> shared libraries, and make the library as small as possible.

Indeed, except that if the static libraries are not compiled with -fPIC, your
shared library is only shared on disk, not in memory.

> The approach works fine for 32 bit on Solaris. And it is definetely a bug that
> it doesn't do so for 64 bit.

It works only by accident in 32-bit mode; it would fail if the R_SPARC_WDISP30
relocation was slightly different.  And, again, not using a shared libgcc on
Solaris means that exceptions cannot be propagated across shared libraries;
that's why g++ automatically passes -shared-libgcc on Solaris.

-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (21 preceding siblings ...)
  2005-05-02  9:54 ` ebotcazou at gcc dot gnu dot org
@ 2005-05-02  9:58 ` ebotcazou at gcc dot gnu dot org
  2005-05-02 11:10 ` info at yourkit dot com
  2005-05-02 15:54 ` ebotcazou at gcc dot gnu dot org
  24 siblings, 0 replies; 26+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-05-02  9:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-02 09:58 -------
> Adding --with-pic to the command line of gcc's configure helped.

Great, but now you know my position on this mess. :-)

> Thanks a lot, Eric!

Andrew deserves them too.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |WONTFIX


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (22 preceding siblings ...)
  2005-05-02  9:58 ` ebotcazou at gcc dot gnu dot org
@ 2005-05-02 11:10 ` info at yourkit dot com
  2005-05-02 15:54 ` ebotcazou at gcc dot gnu dot org
  24 siblings, 0 replies; 26+ messages in thread
From: info at yourkit dot com @ 2005-05-02 11:10 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2005-05-02 11:10 -------
> > Thanks a lot, Eric!

> Andrew deserves them too.

No doubt :) I'm sorry.

> And, again, not using a shared libgcc on
Solaris means that exceptions cannot be propagated across shared libraries;
that's why g++ automatically passes -shared-libgcc on Solaris.

Just curious: where can I get more information about this issue? We were linking
 our shared library statically with libgcc_eh.a in the past with no problems,
and many people on different machines successfully used it. Should there be any
problems?  By the way, all these tricks were found googling reports of other
people who wanted to link statically.



-- 


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


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

* [Bug target/21277] Runtime error with C++ shared library and --disable-shared
  2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
                   ` (23 preceding siblings ...)
  2005-05-02 11:10 ` info at yourkit dot com
@ 2005-05-02 15:54 ` ebotcazou at gcc dot gnu dot org
  24 siblings, 0 replies; 26+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2005-05-02 15:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-05-02 15:53 -------
> Just curious: where can I get more information about this issue? We were
> linking our shared library statically with libgcc_eh.a in the past with no
> problems, and many people on different machines successfully used it. Should
> there be any problems?

Theoritically there should be exactly one EH machinery linked in the executable,
hence the need for one shared libgcc when there are other shared libraries
involved.  In practice, if only one shared library has its private EH machinery
and if others don't, that may still work.

See in the manual the section about -shared-libgcc/-static-libgcc.

> By the way, all these tricks were found googling reports of other people who
> wanted to link statically.

We should probably add links to Google in the manual. :-)


-- 


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


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

end of thread, other threads:[~2005-05-02 15:54 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-29  7:33 [Bug c++/21277] New: gcc 4.0 fails to statically link on Solaris SPARC 64 bit info at yourkit dot com
2005-04-29  7:39 ` [Bug libstdc++/21277] " pinskia at gcc dot gnu dot org
2005-04-29  7:39 ` [Bug c++/21277] " pinskia at gcc dot gnu dot org
2005-04-29  7:39 ` info at yourkit dot com
2005-04-29  7:55 ` [Bug libstdc++/21277] " pcarlini at suse dot de
2005-04-29  8:27 ` [Bug c++/21277] " info at yourkit dot com
2005-04-29 12:40 ` [Bug target/21277] " pinskia at gcc dot gnu dot org
2005-04-29 15:25 ` [Bug c++/21277] " info at yourkit dot com
2005-04-29 19:19 ` pinskia at gcc dot gnu dot org
2005-04-29 19:20 ` pinskia at gcc dot gnu dot org
2005-04-30 20:46 ` [Bug target/21277] Runtime error with C++ shared library and --disable-shared ebotcazou at gcc dot gnu dot org
2005-05-02  6:59 ` info at yourkit dot com
2005-05-02  7:16 ` ebotcazou at gcc dot gnu dot org
2005-05-02  7:19 ` info at yourkit dot com
2005-05-02  7:23 ` info at yourkit dot com
2005-05-02  7:27 ` ebotcazou at gcc dot gnu dot org
2005-05-02  7:33 ` info at yourkit dot com
2005-05-02  7:57 ` ebotcazou at gcc dot gnu dot org
2005-05-02  8:15 ` info at yourkit dot com
2005-05-02  9:05 ` ebotcazou at gcc dot gnu dot org
2005-05-02  9:25 ` info at yourkit dot com
2005-05-02  9:47 ` info at yourkit dot com
2005-05-02  9:54 ` ebotcazou at gcc dot gnu dot org
2005-05-02  9:58 ` ebotcazou at gcc dot gnu dot org
2005-05-02 11:10 ` info at yourkit dot com
2005-05-02 15:54 ` ebotcazou 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).