From: Matthias Klose Date: Sun, 28 Feb 2021 17:03:44 +0000 (+0000) Subject: mangle-fstack-protector X-Git-Tag: archive/raspbian/3.9.2-1+rpi1^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=b223ea10920d79ba88b894cf822bfb26eaec8624;p=python3.9.git mangle-fstack-protector # DP: When using GCC versions older than 4.9, automagically mangle # DP: -fstack-protector-strong to -fstack-protector # DP: When using GCC versions older than 4.9, automagically mangle # DP: -fstack-protector-strong to -fstack-protector Gbp-Pq: Name mangle-fstack-protector.diff --- diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py index 551fbe9..bbb2ae4 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -13,6 +13,7 @@ import _imp import os import re import sys +import fnmatch from .errors import DistutilsPlatformError @@ -220,6 +221,10 @@ def customize_compiler(compiler): 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: