From: Matthias Klose Date: Sun, 1 Dec 2024 12:12:57 +0000 (+0200) Subject: mangle-fstack-protector X-Git-Tag: archive/raspbian/3.9.2-1+rpi1+deb11u2^2~42 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=65c8c90a5a764a08e0bd5233b21d473f1a39dffa;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: