This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #54120] [PATCH] [metaconfig] Need more -fstack-protector
authorAndy Dougherty <doughera@lafayette.edu>
Tue, 13 May 2008 09:37:07 +0000 (02:37 -0700)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Sat, 17 May 2008 13:54:57 +0000 (13:54 +0000)
From: Andy Dougherty (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-9992-1210696625-331.54120-75-0@perl.org>

p4raw-id: //depot/metaconfig@33842

U/compline/ccflags.U
U/perl/dlsrc.U

index 16dfef5..9baa12e 100644 (file)
@@ -230,7 +230,7 @@ default|recommended)
        # as that way the compiler can do the right implementation dependant
        # thing. (NWC)
        case "$gccversion" in
-       ?*)     set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
+       ?*)     set stack-protector -fstack-protector
                eval $checkccflag
                ;;
        esac
@@ -377,6 +377,10 @@ case "$ldflags" in
        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
index d688493..b9b6b6d 100644 (file)
@@ -248,6 +248,16 @@ EOM
        ''|' ') dflt='none' ;;
        esac
 
+       case "$ldflags" in
+       *-fstack-protector*)
+           case "$dflt" in
+                       *-fstack-protector*) ;; # Don't add it again
+                       *) dflt="$dflt -fstack-protector" ;; 
+               esac
+               ;;
+       esac
+
+
     rp="Any special flags to pass to $ld to create a dynamically loaded library?"
     . ./myread
     case "$ans" in