Skip to content

[3.7] bpo-35198 Fix C++ extension compilation on AIX (GH-10437)#12162

Merged
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-800d5cd-3.7
Mar 4, 2019
Merged

[3.7] bpo-35198 Fix C++ extension compilation on AIX (GH-10437)#12162
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-800d5cd-3.7

Conversation

@miss-islington

@miss-islington miss-islington commented Mar 4, 2019

Copy link
Copy Markdown
Contributor

For C++ extensions, distutils tries to replace the C compiler with the
C++ compiler, but it assumes that C compiler is the first element after
any environment variables set. On AIX, linking goes through ld_so_aix,
so it is the first element and the compiler is the next element. Thus
the replacement is faulty:

ld_so_aix gcc ... -> g++ gcc ...

Also, it assumed that self.compiler_cxx had only 1 element or that
there were the same number of elements as the linker has and in the
same order. This might not be the case, so instead concatenate
everything together.
(cherry picked from commit 800d5cd)

Co-authored-by: Kevin Adler kadler@us.ibm.com

https://bugs.python.org/issue35198

For C++ extensions, distutils tries to replace the C compiler with the
C++ compiler, but it assumes that C compiler is the first element after
any environment variables set. On AIX, linking goes through ld_so_aix,
so it is the first element and the compiler is the next element. Thus
the replacement is faulty:

ld_so_aix gcc ... -> g++ gcc ...

Also, it assumed that self.compiler_cxx had only 1 element or that
there were the same number of elements as the linker has and in the
same order. This might not be the case, so instead concatenate
everything together.
(cherry picked from commit 800d5cd)

Co-authored-by: Kevin Adler <kadler@us.ibm.com>

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good bot.

@miss-islington

Copy link
Copy Markdown
Contributor Author

@kadler and @vstinner: Status check is done, and it's a success ✅ .

@miss-islington
miss-islington merged commit 06e9953 into python:3.7 Mar 4, 2019
@miss-islington
miss-islington deleted the backport-800d5cd-3.7 branch March 4, 2019 15:06
@miss-islington

Copy link
Copy Markdown
Contributor Author

@kadler and @vstinner: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants