summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorstratakis <cstratak@redhat.com>2018-12-19 17:19:01 (GMT)
committerVictor Stinner <vstinner@redhat.com>2018-12-19 17:19:01 (GMT)
commitcf10a750f4b50b6775719cfb17bee00bc3a9c60b (patch)
treeb01cd3a429404cf2a2d58d8cfb35676c8969f5f6 /Lib
parent55cc34500e5abbfedb89adc95e3f94d53c544933 (diff)
downloadcpython-cf10a750f4b50b6775719cfb17bee00bc3a9c60b.zip
cpython-cf10a750f4b50b6775719cfb17bee00bc3a9c60b.tar.gz
cpython-cf10a750f4b50b6775719cfb17bee00bc3a9c60b.tar.bz2
bpo-35257: Avoid leaking LTO linker flags into distutils (GH-10900)
When compiling 3rd party C extensions, the linker flags used by the compiler for the interpreter and the stdlib modules, will get leaked into distutils. In order to avoid that, the PY_CORE_LDFLAGS and PY_LDFLAGS_NODIST are introduced to keep those flags separated.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/_osx_support.py2
-rw-r--r--Lib/test/pythoninfo.py3
-rw-r--r--Lib/test/test__osx_support.py2
3 files changed, 5 insertions, 2 deletions
diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py
index e37852e..db6674e 100644
--- a/Lib/_osx_support.py
+++ b/Lib/_osx_support.py
@@ -17,7 +17,7 @@ __all__ = [
_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
- 'PY_CORE_CFLAGS')
+ 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS')
# configuration variables that may contain compiler calls
_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 81fca10..26bcf5f 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -411,7 +411,10 @@ def collect_sysconfig(info_add):
'OPT',
'PY_CFLAGS',
'PY_CFLAGS_NODIST',
+ 'PY_CORE_LDFLAGS',
'PY_LDFLAGS',
+ 'PY_LDFLAGS_NODIST',
+ 'PY_STDMODULE_CFLAGS',
'Py_DEBUG',
'Py_ENABLE_SHARED',
'SHELL',
diff --git a/Lib/test/test__osx_support.py b/Lib/test/test__osx_support.py
index bcba8ca..388a2b1 100644
--- a/Lib/test/test__osx_support.py
+++ b/Lib/test/test__osx_support.py
@@ -24,7 +24,7 @@ class Test_OSXSupport(unittest.TestCase):
for cv in ('CFLAGS', 'LDFLAGS', 'CPPFLAGS',
'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'CC',
'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
- 'PY_CORE_CFLAGS'):
+ 'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS'):
if cv in self.env:
self.env.unset(cv)