Link libpython for AIX target (#4073)

This commit is contained in:
messense 2024-04-13 15:43:06 +08:00 committed by GitHub
parent ee5216f406
commit 30348b4d3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1 @@
fixes undefined symbol errors when building extension module on AIX by linking `libpython`

View File

@ -775,6 +775,8 @@ pub fn is_linking_libpython() -> bool {
/// Must be called from a PyO3 crate build script.
fn is_linking_libpython_for_target(target: &Triple) -> bool {
target.operating_system == OperatingSystem::Windows
// See https://github.com/PyO3/pyo3/issues/4068#issuecomment-2051159852
|| target.operating_system == OperatingSystem::Aix
|| target.environment == Environment::Android
|| target.environment == Environment::Androideabi
|| !is_extension_module()