This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problem using gcc to compile and ld to link on Sun Solaris 9


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?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]