On Fri, Sep 11, 2015 at 11:08:03AM +0200, Rainer Orth wrote: > While starting to develop the patch for Solaris PIE support, > the gcc.dg/pie-link.c test succeeded at a point when it shouldn't have, > i.e. before I had PIC crt files. In its current form, the test doesn't > test what it's supposed to test, namely successfully linking position > independent executables, because it compiles with -fpie, but links as a > regular executable. The test was added here > > 2007-06-01 Geoffrey Keating <geo...@apple.com> > > * gcc.dg/pie-link.c: New test. > > https://gcc.gnu.org/ml/gcc-patches/2007-06/msg00070.html > > -pie doesn't make a difference on Darwin, but very much so on Linux and > Solaris, where it is necessary for PIE creation. > > Fixed thus, tested on x86_64-unknown-linux-gnu and *-*-solaris2.12 with > my upcoming PIE patch. > > Ok for mainline and gcc-5 branch? > > Rainer > > > 2015-02-10 Rainer Orth <r...@cebitec.uni-bielefeld.de> > > * gcc.dg/pie-link.c: Add -pie to dg-options.
Ok (if it doesn't work on Darwin, it can be conditionalized on !darwin). > --- a/gcc/testsuite/gcc.dg/pie-link.c > +++ b/gcc/testsuite/gcc.dg/pie-link.c > @@ -1,5 +1,5 @@ > /* { dg-do link { target pie } } */ > -/* { dg-options "-fpie" } */ > +/* { dg-options "-fpie -pie" } */ > > int main(void) > { Jakub