1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Description: Support gcc < 4.9
When using GCC versions older than 4.9, automagically mangle
-fstack-protector-strong to -fstack-protector
FIXME: Still needed?
Forwarded: no
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -14,6 +14,7 @@
import re
import sys
import warnings
+import fnmatch
from functools import partial
@@ -228,6 +229,10 @@
cc = newcc
if 'CXX' in os.environ:
cxx = os.environ['CXX']
+ if fnmatch.filter([cc, cxx], '*-4.[0-8]'):
+ configure_cflags = configure_cflags.replace('-fstack-protector-strong', '-fstack-protector')
+ ldshared = ldshared.replace('-fstack-protector-strong', '-fstack-protector')
+ cflags = cflags.replace('-fstack-protector-strong', '-fstack-protector')
if 'LDSHARED' in os.environ:
ldshared = os.environ['LDSHARED']
if 'CPP' in os.environ:
|