
h.m.brand at xs4all
May 20, 2008, 8:32 AM
Post #3 of 3
(100 views)
Permalink
|
|
Re: Change 33843: [perl #54120] [PATCH] [metaconfig] Need more -fstack-protector
[In reply to]
|
|
On Tue, 20 May 2008 11:21:14 -0400 (EDT), Andy Dougherty <doughera[at]lafayette.edu> wrote: > On Tue, 20 May 2008, Nicholas Clark via RT wrote: > > [patch to fiddle with -fstack-protector] > > > : flags used in final linking phase > > case "$ldflags" in > > '') if ./venix; then > > dflt='-i -z' > > else > > dflt='' > > fi > > case "$ccflags" in > > *-posix*) dflt="$dflt -posix" ;; > > esac > > # See note above about -fstack-protector > > case "$ccflags" in > > *-fstack-protector*) dflt="$dflt -fstack-protector" ;; > > esac > > ;; > > *) dflt="$ldflags";; > > esac > > > > > > I find that as soon as I use -Aldflags, I don't get -fstack-protector added. > > Which is somewhat daft, at least as an "end user", as I was using *A* not *D*. > > Oops. That's not supposed to happen. Sorry about that! > > There are actually two separate things going on here: First, the -A is > supposed to happen after platform-specific hints are done. By the time > we've reached this code, platform-specific hints have long been finished, > so the -A should indeed have been applied. > > The troublesome bit of code I quoted above is there to allow a use to tell > Configure: "use this exact string for ldflags, don't mess with it at > all." The thinking pre-dates Configure's -A flag. That's not what you > wanted to do, however. > > > I don't understand the implementation of Configure enough to know when -A > > processing is done, but is it done early enough that ldflags is already set by > > the time that that code above is reached? > > Yes, that's exactly it. And further, we've also lost all memory of > whether it was a -A or a -D addition. > > Clearly, that's a problem. I'll need to think on it a bit to figure out > how to fix it. I think the short-term fix will be to add > -fstack-protector no matter what. Something like this (sorry no > metaconfig patch here, but it should apply with a (large) offset) Hunk #1 succeeded at 377 (offset -4884 lines). The regenerated Configure seems to be under just a bit more impact. Regenerated in #33887 > --- perl-current/Configure 2008-05-17 10:31:35.000000000 -0400 > +++ perl-andy/Configure 2008-05-20 11:11:41.000000000 -0400 > @@ -5261,13 +5261,18 @@ > case "$ccflags" in > *-posix*) dflt="$dflt -posix" ;; > esac > - # See note above about -fstack-protector > - case "$ccflags" in > - *-fstack-protector*) dflt="$dflt -fstack-protector" ;; > - esac > ;; > *) dflt="$ldflags";; > esac > +# See note above about -fstack-protector > +case "$ccflags" in > +*-fstack-protector*) > + case "$dflt" in > + *-fstack-protector*) ;; # Don't add it again > + *) dflt="$dflt -fstack-protector" ;; > + esac > + ;; > +esac > > : Try to guess additional flags to pick up local libraries. > for thislibdir in $libpth; do > -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/
|