[Bug bootstrap/12462] gcc-3.3.1 can't build shared library with libstdc++.a

croze at nsisoftware dot com gcc-bugzilla@gcc.gnu.org
Fri Nov 14 21:11:00 GMT 2003


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



More information about the Gcc-bugs mailing list