diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-07-02 07:55:33 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-07-02 07:56:10 -0400 |
commit | e2303f682b76c6c494c11083756ee687fe98eaa9 (patch) | |
tree | 7793eb014e1df6aecbcd3da83451710f580ba0cd /Configure | |
parent | 289e2b8e6dc026febcbfcc97e0ef86e4afbe4a1c (diff) | |
download | perl-e2303f682b76c6c494c11083756ee687fe98eaa9.tar.gz |
Enable _FORTIFY_SOURCE only if optimizing, as specified.
As noticed by Dave Mitchell.
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -22221,12 +22221,17 @@ fi : add -D_FORTIFY_SOURCE if feasible and not already there case "$gccversion" in -4.*) case "$ccflags$cppsymbols" in - *_FORTIFY_SOURCE=*) # Don't add it again. - echo "You seem to have -D_FORTIFY_SOURCE already..." >&4 +4.*) case "$optimize$ccflags" in + *-O*) case "$ccflags$cppsymbols" in + *_FORTIFY_SOURCE=*) # Don't add it again. + echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4 + ;; + *) echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4 + ccflags="$ccflags -D_FORTIFY_SOURCE=2" + ;; + esac ;; - *) ccflags="$ccflags -D_FORTIFY_SOURCE=2" - echo "Adding -D_FORTIFY_SOURCE=2 to ccflags..." >&4 + *) echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4 ;; esac ;; |