I am having problem with version 2.3.1 of gcc when I try to compile position independent code. I recently obtained a copy of gcc 2.3.1 for the SUN SPARCstation IPX platform running SunOS 4.1.3, I'm working on because it did not exist and the cc compiler is terrible. After careful reading of the installation instructions I proceeded to compile it. The configureation options I used were :-
After an hour or more of compilation and recompilation it had installed gcc without any error being produced. I produced a stage 3 compiler to check against the stage 2 compiler with :-
make compare
and this found no differences.
As I planned to use gcc mostly in ANSI mode I also ran the header file fixing script :-
make install-fixincludes
This produced a fair number of include files in the /usr2/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.1/include directory.
After setting the appropriate path /usr2/local/bin in my system path variable I proceeded to use the compiler and found it worked OK on several progr
ams. I then had cause to use it to compile a program (which is included at the end in gcc -E format) that would be a dynamically linked function. The program just consists of one function (no main).
The program is for use with Precision Visuals PV-WAVE graphics package and the function WaveParams is called from PV-WAVE. The sources with PV-WAVE also provided several build files for this example, the Sun one is below :-
After checking the gcc manual for a 'pic' equivalent I found -fpic or -fPIC. I simply then hand compiled the program as:-
gcc -c -fpic example.c
expecting it to work fine. Instead the following error message was generated :-
muffin% gcc -c -fpic example.c
gcc: Internal compiler error: program cc1 got fatal signal 6
muffin%
I repeated the proceedure with -fPIC but the same error was generated.
I have subsequently recompiled gcc from the begining and the new copy of gcc still produced this error. I have scanned through all the gcc info files for any anomilies about a SPARC and position independent code but could find no more than the comment abount the maximum offset of table of 8K for a SPARC chip.
Can you help? I have tried to include as much information as possible in order to make your life easier.