-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
bpo-35198 Fix C++ extension compilation on AIX #10437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
This PR fixed the issue which we are facing with building of pandas-0.23.4. |
@vstinner I've greatly simplified the fix and it should only affect AIX platforms now. Let me know if you have further thoughts/concerns. I can squash the commits, if desired. |
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>
GH-12162 is a backport of this pull request to the 3.7 branch. |
Even if I don't know anything about AIX, I trust @kadler to have tested his change. Since the new version of his change doesn't affect other platforms, I'm now fine with it. |
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>
Yes, I tested on both an AIX and a Linux environment to verify the new change worked and did not affect other platforms. |
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.
https://bugs.python.org/issue35198