Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Chris P. Ross
Tue, 21 Jul 1992 13:29
gcc bug?
Author: Chris P. Ross
Date: Tue, 21 Jul 1992 13:29
Date: Tue, 21 Jul 1992 13:29
37 lines
2563 bytes
2563 bytes
Hi. I have another situation that I am curious about. Perhaps I just
don't know how to get gcc to do what I want, but I thought it was worth
asking...
I'm trying to compile an X client program on a Sun Sparc (SunOS 4.1.1)
and I want it to be staticly linked to the X libraries, but dynamicly
linked to the C library.
The line that make produces is:
gcc -fpcc-struct-return -o chooser-static chooser.o -O2 -static -L../.././lib/Xaw -lXaw -L../.././lib/Xmu -lXmu -L../.././lib/Xt -lXt -L../.././extensions/lib -lXext -L../.././lib/X -lX11 ../.././lib/Xdmcp/libXdmcp.a -dynamic -ldl -L/usr/local/X11R5/lib
This is, of course, the line setup through imake. So, it has a -static
*and* a -dynamic. I'll get back to this.
The link line that I see by using gcc -v (other than that, it's the
same line as above) is:
/usr/local/gnu/lib/gcc-lib/sun3-sunos4.1/2.2.2/ld -e start -dc -dp -Bstatic -o chooser-static /lib/crt0.o /lib/Mcrt1.o -L../.././lib/Xaw -L../.././lib/Xmu -L../.././lib/Xt -L../.././extensions/lib -L../.././lib/X -L/usr/local/gnu/lib/gcc-lib/sun3-sunos4.1/2.2.2 -L/usr/local/gnu/lib chooser.o -lXaw -lXmu -lXt -lXext -lX11 ../.././lib/Xdmcp/libXdmcp.a -lgcc -lc -L/usr/lib/f68881 -lgcc
Now, this line will die, failing to find the routines _dlsym, _dlopen,
and _dlclose. These routines exist in a library for which there is no .a,
only a .so.*. So, the fix for that would be to have the above line read:
/usr/local/gnu/lib/gcc-lib/sun3-sunos4.1/2.2.2/ld -e start -dc -dp -Bstatic -o chooser-static /lib/cr
t0.o /lib/Mcrt1.o -L../.././lib/Xaw -L../.././lib/Xmu -L../.././lib/Xt -L../.././extensions/lib -L../
.././lib/X -L/usr/local/gnu/lib/gcc-lib/sun3-sunos4.1/2.2.2 -L/usr/local/gnu/lib chooser.o -lXaw -lXm
u -lXt -lXext -lX11 ../.././lib/Xdmcp/libXdmcp.a -lgcc -Bdynamic -lc -L/usr/lib/f68881 -lgcc
instead. The -Bdynamic before the -lc will create a dynamic link to the dl
library. I was assuming that -dynamic on the compile line would do this,
but it appears not to. Is there any way to get this behaviour, short of
hand-linking?
Thanks...
- Chris Ross
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads