public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a
@ 2003-09-30 15:43 bs at okyz dot com
  2003-10-28 15:31 ` [Bug bootstrap/12462] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: bs at okyz dot com @ 2003-09-30 15:43 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: gcc-3.3.1 can't build shared library with libstdc++.a
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bs at okyz dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: hpux11

gcc -shared doesn't work 
i want to make a shared library, and i link with the static library libstdc++.a
ld answer me that libstdc++.a isn't position independant code (PIC).
I built gcc.3.3.1 passing with-pic and disable-shared to configure, but the HP
linker still doesn't want to link with libstdc++.a, which isn't a PIC library
for him. (try to compile with +Z)
i have installed the latest ld linker HP patch.


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
@ 2003-10-28 15:31 ` pinskia at gcc dot gnu dot org
  2003-11-08 21:15 ` dhazeghi at yahoo dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-28 15:31 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

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


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-28 15:27 -------
Are you sure that the right libstdc++.a is being picked up?


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
  2003-10-28 15:31 ` [Bug bootstrap/12462] " pinskia at gcc dot gnu dot org
@ 2003-11-08 21:15 ` dhazeghi at yahoo dot com
  2003-11-14 21:11 ` croze at nsisoftware dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-11-08 21:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dhazeghi at yahoo dot com  2003-11-08 21:15 -------
Exactly what options did you use to build gcc with? Is it possible to check your
build log and see what linker options were passed when linking libstdc++.a? Thanks.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dhazeghi at yahoo dot com
           Keywords|                            |build


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


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
  2003-10-28 15:31 ` [Bug bootstrap/12462] " pinskia at gcc dot gnu dot org
  2003-11-08 21:15 ` dhazeghi at yahoo dot com
@ 2003-11-14 21:11 ` croze at nsisoftware dot com
  2004-01-20 13:56 ` bangerth at dealii dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: croze at nsisoftware dot com @ 2003-11-14 21:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From croze at nsisoftware dot com  2003-11-14 21:11 -------
I have also seen this issue on RedHat 9.  Here is the build output:

g++ -v -g -fPIC -shared -static-libgcc -L../../Common/lib/Linux/debug \
-o lib/Linux/debug/libRSResource.so \
src/obj/Linux/debug/ComputerSystemInfo.o src/obj/Linux/debug/RSResource.o
src/obj/Linux/debug/OemNone.o \
-Wl,-static -lpthread -ldl -lCommon
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
 /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/collect2 --eh-frame-hdr -m elf_i386
-shared -o lib/Linux/debug/libRSResource.so
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crti.o
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/crtbeginS.o
-L../../../Common_3party/ObjectSpace.Solaris/lib/Linux
-L../../Common/lib/Linux/debug -L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2
-L/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../..
src/obj/Linux/debug/ComputerSystemInfo.o src/obj/Linux/debug/RSResource.o
src/obj/Linux/debug/OemNone.o -static -lpthread -ldl -lospace -lCommon
-lstdc++ -lm -lgcc -lgcc_eh -lc -lgcc -lgcc_eh
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/crtendS.o
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../crtn.o
/usr/bin/ld: lib/Linux/debug/libRSResource.so: undefined versioned symbol name
std::time_put_w@@GLIBCPP_3.2
/usr/bin/ld: failed to set dynamic section sizes: Bad value

(In reply to comment #0)
> gcc -shared doesn't work 
> i want to make a shared library, and i link with the static library libstdc++.a
> ld answer me that libstdc++.a isn't position independant code (PIC).
> I built gcc.3.3.1 passing with-pic and disable-shared to configure, but the HP
> linker still doesn't want to link with libstdc++.a, which isn't a PIC library
> for him. (try to compile with +Z)
> i have installed the latest ld linker HP patch.



-- 


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


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
                   ` (2 preceding siblings ...)
  2003-11-14 21:11 ` croze at nsisoftware dot com
@ 2004-01-20 13:56 ` bangerth at dealii dot org
  2004-01-28 17:37 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2004-01-20 13:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-01-20 13:56 -------
If you want to link libstdc++ into a shared library, you shouldn't 
use the static version. I think that's only a reasonable requirement 
the linker is enforcing. 
 
Why exactly are you doing this? 
 
W. 

-- 


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


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
                   ` (3 preceding siblings ...)
  2004-01-20 13:56 ` bangerth at dealii dot org
@ 2004-01-28 17:37 ` pinskia at gcc dot gnu dot org
  2004-10-06 11:30 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-28 17:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-28 17:37 -------
You just cannot do it but this has been fixed for 3.4.0 anyways.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4.0


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


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
                   ` (4 preceding siblings ...)
  2004-01-28 17:37 ` pinskia at gcc dot gnu dot org
@ 2004-10-06 11:30 ` pinskia at gcc dot gnu dot org
  2004-10-06 11:53 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-06 11:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-06 11:30 -------
*** Bug 17859 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |info at yourkit dot com


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


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
                   ` (5 preceding siblings ...)
  2004-10-06 11:30 ` pinskia at gcc dot gnu dot org
@ 2004-10-06 11:53 ` pinskia at gcc dot gnu dot org
  2004-10-06 12:05 ` info at yourkit dot com
  2004-10-06 12:43 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-06 11:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-06 11:53 -------
*** Bug 17859 has been marked as a duplicate of this bug. ***

-- 


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


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
                   ` (6 preceding siblings ...)
  2004-10-06 11:53 ` pinskia at gcc dot gnu dot org
@ 2004-10-06 12:05 ` info at yourkit dot com
  2004-10-06 12:43 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: info at yourkit dot com @ 2004-10-06 12:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From info at yourkit dot com  2004-10-06 12:04 -------
But the problem is that I need to create shared library without references to
other shared libraries. To achieve this I'm statically linking necessary code
from libstdc++.a. It's possible to do and linker also allows this. Moreover
everything is working (compiling and linking) until I use <iostream>

For example, I can compile the following code:

#include <vector>

extern "C" {
  void Java_com_yourkit_hello_sayHello(){
     std::vector<int> v;
  }
}

and cannot compile

#include <vector>
#include <iostream> // the only difference

extern "C" {
  void Java_com_yourkit_hello_sayHello(){
     std::vector<int> v;
  }
}

It's strange, because I'm using nothing from <iostream>



-- 


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


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

* [Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a
  2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
                   ` (7 preceding siblings ...)
  2004-10-06 12:05 ` info at yourkit dot com
@ 2004-10-06 12:43 ` pinskia at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-06 12:43 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-06 12:43 -------
*** Bug 17859 has been marked as a duplicate of this bug. ***

-- 


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


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

end of thread, other threads:[~2004-10-06 12:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-30 15:43 [Bug bootstrap/12462] New: gcc-3.3.1 can't build shared library with libstdc++.a bs at okyz dot com
2003-10-28 15:31 ` [Bug bootstrap/12462] " pinskia at gcc dot gnu dot org
2003-11-08 21:15 ` dhazeghi at yahoo dot com
2003-11-14 21:11 ` croze at nsisoftware dot com
2004-01-20 13:56 ` bangerth at dealii dot org
2004-01-28 17:37 ` pinskia at gcc dot gnu dot org
2004-10-06 11:30 ` pinskia at gcc dot gnu dot org
2004-10-06 11:53 ` pinskia at gcc dot gnu dot org
2004-10-06 12:05 ` info at yourkit dot com
2004-10-06 12:43 ` pinskia 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).