summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/distutils/unixccompiler.py10
-rw-r--r--Misc/NEWS.d/next/Library/2018-11-09-12-45-28.bpo-35198.EJ8keW.rst1
2 files changed, 10 insertions, 1 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index ab4d4de156..d10a78da31 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -188,7 +188,15 @@ class UnixCCompiler(CCompiler):
i = 1
while '=' in linker[i]:
i += 1
- linker[i] = self.compiler_cxx[i]
+
+ if os.path.basename(linker[i]) == 'ld_so_aix':
+ # AIX platforms prefix the compiler with the ld_so_aix
+ # script, so we need to adjust our linker index
+ offset = 1
+ else:
+ offset = 0
+
+ linker[i+offset] = self.compiler_cxx[i]
if sys.platform == 'darwin':
linker = _osx_support.compiler_fixup(linker, ld_args)
diff --git a/Misc/NEWS.d/next/Library/2018-11-09-12-45-28.bpo-35198.EJ8keW.rst b/Misc/NEWS.d/next/Library/2018-11-09-12-45-28.bpo-35198.EJ8keW.rst
new file mode 100644
index 0000000000..4ce7a7e342
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2018-11-09-12-45-28.bpo-35198.EJ8keW.rst
@@ -0,0 +1 @@
+Fix C++ extension compilation on AIX