This is the mail archive of the gcc@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]

Re: Bugs using -fPIC on linux (i86 RedHat 5.0)?


>>>>> "Jeffrey" == Jeffrey A Law <law@hurl.cygnus.com> writes:

  Jeffrey> What assembler are you using?  Do you have a testcase?

as -v yields:

GNU assembler version 970731 (i586-linux), using BFD version
linux-2.8.1.0.15

Unfortunately, I have not been able to make a test case for this error
yet. However, when trying I have come across another test that seem to
indicate that there is something wrong with PIC and iostream, like the
following example shows (which may or may not be related to the
problem I am experiencing in the applictation I am porting):

An example:

// test3.cpp
#include <iostream.h>

int testfunc ()
{
  cout << "Hi!\n";
  return 0;
}

g++ -c test3.cpp -o test3.o runs fine.

g++ -fPIC test3.cpp -o test3.o gives me:
test3.cpp: In function `int testfunc()':
test3.cpp:7: Internal compiler error.
test3.cpp:7: Please submit a full bug report to `egcs-bugs@cygnus.com'.

g++ -fPIC -O test3.cpp -o test3.o runs fine. Similar for O2 and O3.

I have finally been able to port on of the key libraries of my
application (which makes heavy use of STL and iostreams), and initial
testing seem to indicate that the code that is generated runs
fine. However, figuring out how to make it compile has been a guessing
game from time to time.

On a related note, while digging into the problem trying to find a
small testcase (and discovering the stuff I reported above with
test3.cpp), my original problem with the calls that the assembler
complained about goes away and compiles fine. But without turning on
optimization, it is still there (as originally described).

Thanks for helping out..

Marius



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