[Patch] ld testsuite: Fix some FAILs caused by missing -fpic.

David Daney david.daney@cavium.com
Tue Dec 6 17:12:00 GMT 2011


On 12/06/2011 02:33 AM, nick clifton wrote:
> Hi David,
>
>> Since the beginning of time (or at least CVS), there has been special
>> code in the ld testsuite to omit -fpic from the flags used for building
>> shared libraries on MIPS. This worked for very old versions of GCC where
>> the generated code was always PIC by default.
>
> How old is "very old" ?

GCC-4.2 and earlier.

>
>> I propose that we remove this special handling and pass -fpic, just as
>> we do for almost all other targets. Doing this fixes about twenty FAILs.
>
> If "very old" actually includes any of the 4.x versions of gcc then I
> would be inclined to say that a better fix would be to check the gcc
> version number and only omit "-fpic" if it is not needed.

That is too much work.  Although I haven't tested it, supplying -fpic 
will not break anything in any GCC version I know about.  I think 
GCC-2.95 and later should be fine with this, certainly any GCC-4.x and 
later compiler can handle -fpic.

David Daney




More information about the Binutils mailing list