* RE: statically linked shared object
@ 2004-06-11 10:45 Herrmann Achim (GS-EC/ESI8) *
0 siblings, 0 replies; 3+ messages in thread
From: Herrmann Achim (GS-EC/ESI8) * @ 2004-06-11 10:45 UTC (permalink / raw)
To: gcc-help
Fine :)
Replacing -static with -Wl,-Bstatic worked. shared object is statically linked, app was running and gprof, the original reason for statically linking, was profiling successful.
Thx again
Achim
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: statically linked shared object
@ 2004-06-10 20:33 lrtaylor
0 siblings, 0 replies; 3+ messages in thread
From: lrtaylor @ 2004-06-10 20:33 UTC (permalink / raw)
To: Achim-Herrmann, gcc-help
What about if you replace -static with "-Wl,-Bstatic"? That explicitly
tells the linker to link statically (so long as it's GNU ld). -static
is probably supposed to get translated to something like -Bstatic for
the linker, but maybe that doesn't happen in this case for some reason.
Thanks,
Lyle
-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Achim-Herrmann@t-online.de
Sent: Thursday, June 10, 2004 1:54 PM
To: gcc-help@gcc.gnu.org
Subject: statically linked shared object
Hello,
I've problem creating a statically linked shared object. I'm using g++
(GCC) 3.3 20030226.
First object vidflat.o is created:
g++ -fPIC -pg -ggdb -c -o vidflat.o
../../../../../../../../source/app/lib/dynamics/plugins/vidflat/vidflat.
cc
Then vidflat.so is created using keyword -static:
g++ vidflat.o -static -shared -frtti -o vidflat.so -L../../../../lib
-l3d -ldl -lm -L/usr/lib -lglut -lGLU -lGL -L/usr/X11R6/lib -lXt -lXi
-lXmu -lXext -lX11 -lpthread -pg
But ldd proves that this .so isn't linked statically at all:
ldd ./vidflat.so
libdl.so.2 => /lib/libdl.so.2 (0x4002c000)
libglut.so.3 => /usr/lib/libglut.so.3 (0x40030000)
libGLU.so.1 => /usr/lib/libGLU.so.1 (0x40067000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x40101000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x4015d000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x401b1000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x401b9000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x401d0000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x401df000)
libpthread.so.0 => /lib/libpthread.so.0 (0x402ad000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x402fd000)
libm.so.6 => /lib/libm.so.6 (0x403b5000)
libc.so.6 => /lib/libc.so.6 (0x403d7000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x4050e000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40517000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4052e000)
libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0x40536000)
Using -static worked fine for statically linked application but not for
shared object.
Which parameters do I have to pass to g++ to create statically linked
shared object?
Thanks in advance
Achim
^ permalink raw reply [flat|nested] 3+ messages in thread
* statically linked shared object
@ 2004-06-10 19:54 Achim-Herrmann
0 siblings, 0 replies; 3+ messages in thread
From: Achim-Herrmann @ 2004-06-10 19:54 UTC (permalink / raw)
To: gcc-help
Hello,
I've problem creating a statically linked shared object. I'm using g++
(GCC) 3.3 20030226.
First object vidflat.o is created:
g++ -fPIC -pg -ggdb -c -o vidflat.o
../../../../../../../../source/app/lib/dynamics/plugins/vidflat/vidflat.cc
Then vidflat.so is created using keyword -static:
g++ vidflat.o -static -shared -frtti -o vidflat.so -L../../../../lib
-l3d -ldl -lm -L/usr/lib -lglut -lGLU -lGL -L/usr/X11R6/lib -lXt -lXi
-lXmu -lXext -lX11 -lpthread -pg
But ldd proves that this .so isn't linked statically at all:
ldd ./vidflat.so
libdl.so.2 => /lib/libdl.so.2 (0x4002c000)
libglut.so.3 => /usr/lib/libglut.so.3 (0x40030000)
libGLU.so.1 => /usr/lib/libGLU.so.1 (0x40067000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x40101000)
libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x4015d000)
libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x401b1000)
libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x401b9000)
libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x401d0000)
libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x401df000)
libpthread.so.0 => /lib/libpthread.so.0 (0x402ad000)
libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x402fd000)
libm.so.6 => /lib/libm.so.6 (0x403b5000)
libc.so.6 => /lib/libc.so.6 (0x403d7000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x4050e000)
libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40517000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4052e000)
libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0x40536000)
Using -static worked fine for statically linked application but not for
shared object.
Which parameters do I have to pass to g++ to create statically linked
shared object?
Thanks in advance
Achim
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-06-11 10:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-11 10:45 statically linked shared object Herrmann Achim (GS-EC/ESI8) *
-- strict thread matches above, loose matches on Subject: below --
2004-06-10 20:33 lrtaylor
2004-06-10 19:54 Achim-Herrmann
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).