does linux -fPIC/eh do so poorly?

Robert Lipe robertl@dgii.com
Wed Feb 18 02:42:00 GMT 1998


> > I'm trying to figure out if something is broken on other x86
> > elf/unix targets, or if it's unique to OpenServer.  I also can't
> > tell if I'm just the only one masochistic enough to make another
> > pass over all the testsuites with -fPIC or not.
>
> I used to do that myself, but when we got `make check', I started
> to use it, and it would not run tests with `-fPIC'.  Perhaps a nice

It will do it, but it takes some non-obvious voodoo.

> addition to egcs's makefiles would be a full-check, that would test
> all multilibs with and without -fPIC, if -fPIC makes a difference.

The magic syntax is:

make -k check \
  RUNTESTFLAGS="--outdir ${OUT} --target_board 'unix{-mcoff,-melf,-fPIC}'"

the --outdir is just so that I can keep a history of when things passed
or failed.   The --target_board stuff loops over each of the three sets
of flags.   Even though -melf is the default on my target, I explictly
call it out here so that the reports are more readable.

I imagine that it would be possible to wire the output of a 
	(robertl) rjlhome:/play/negcs/gcc
	$ ./xgcc -B./ --print-multi-lib /tmp/x.c
	.;
	coff;@mcoff
	pic;@fPIC
into the list of options to be passed into target_board.


> I just don't know how to test whether -fPIC makes a difference in a
> portable way, is there any way?

If there is, the testsuites need to be taught about it becuase one of my
multilibs (ELF) will do -fPIC and one (COFF) won't and the testsuites
that explictly pass -fPIC fail.


> >      make check-g++ RUNTESTFLAGS="--tool_opts -fPIC
> >      old-deja.exp=eh*"
>
> Done, all tests passed on i586-pc-linux-gnu, with egcs-980214,
> binutils-2.8.1.0.18, out-of-the-box RedHat 5.0.

Bummer.  This means I'll get less sympathy that it's broken.  :-(

Thanx for checking, Alexandre.

RJL



More information about the Gcc mailing list