This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
problem using gcc to compile and ld to link on Sun Solaris 9
- From: Ceka <oocekaoo at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 5 Oct 2005 16:17:46 +0100
- Subject: problem using gcc to compile and ld to link on Sun Solaris 9
- Reply-to: Ceka <oocekaoo at gmail dot com>
Hi
i have some troubles using gcc to compile et ld to link on Sun Solaris 9.
I use to compile and link with gcc and everything was fine:
COMP= gcc -ansi -Wall -ansi -pedantic -g –c <my .cpp's>
LINK = gcc -G $(LINKER_OPTIONS) -o libnativesgw.so <my.o's>
But now i need to use Purify on that, and Purify does not support the
GNU linker, so i have to use the ld (the Solaris linker) instead of
gcc (which invoke collect2) to link the shared library.
I was also told to use the -fPIC options to produce position
independent code for a shared lib.
Here is how i compile and link now:
COMP= gcc -fPIC -ansi -Wall -ansi -pedantic -g –c <my .cpp's>
LINK = ld -G $(LINKER_OPTIONS) -o libnativesgw.so <my.o's>
But when i try to run the prog that hits the library, it just crashes
and give me a "core dumped"
So my question is: Have you ever encounter that? Do you know about any
gcc (or ld) options that could make them happy?