You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gcc -pthread -maix64 -bI:Modules/python.exp -Wl,-blibpath:/QOpenSys/pkgs/lib:/QOpenSys/usr/lib -lutil -Wl,-hlibpython3.13.so ...
ld: 0706-012 The -h flag is not recognized.
ld: 0706-006 Cannot find or open library file: -l ibpython3.13.so
ld:open(): No such file or directory
-h is not a valid linker flag on AIX. This seems to be a regression introduced in fa1d675309c6a08b0833cf25cffe476c6166aba3 as previously on AIX it would have gone in to the else leg and not used this flag.
Apparently AIX doesn't use the ELF format, so this argument (which is the same as -soname) isn't applicable on that platform. If everything worked without it before, then the simplest solution would be to omit that argument on AIX.
@Ganeshkumhar1 For our local builds, we just patched it to remove the -soname option entirely. Obviously, not an upstreamable change, but for our platform-specific builds it works for us:
I don't understand enough about the reason for removing the if check as part of the Android support PR to know what the proper fix is to support everybody.
The if check was removed because on Android the SONAME is the same as the filename (libpython3.13.so), so the library was previously buit with no SONAME at all, which caused problems when linking things against it (i.e. extension modules).
If we need to omit this argument on AIX, then the proper fix would be to simply do that with a platform check.
@encukou Thanks for notifying this.
Agree with @mhsmith , that the proper fix would be to do this under a platform check.
Let me work on a PR to fix this.
Yes, it would break Android because it would take the else branch and build libpython without an SONAME. This means extension modules linked against it would have no NEEDED entry for libpython, and would be unable to resolve their libpython symbols at runtime.
Activity
ned-deily commentedon Mar 20, 2024
@mhsmith
mhsmith commentedon Mar 20, 2024
Apparently AIX doesn't use the ELF format, so this argument (which is the same as
-soname) isn't applicable on that platform. If everything worked without it before, then the simplest solution would be to omit that argument on AIX.Ganeshkumhar1 commentedon Apr 7, 2025
Is there any fix available for this issue. ? I am hitting same while building 3.13.2 on AIX @mhsmith @kadler
do we need to revert the changes in fa1d675309c6a08b0833cf25cffe476c6166aba3
kadler commentedon Apr 7, 2025
@Ganeshkumhar1 For our local builds, we just patched it to remove the
-sonameoption entirely. Obviously, not an upstreamable change, but for our platform-specific builds it works for us:I don't understand enough about the reason for removing the if check as part of the Android support PR to know what the proper fix is to support everybody.
mhsmith commentedon Apr 8, 2025
The
ifcheck was removed because on Android the SONAME is the same as the filename (libpython3.13.so), so the library was previously buit with no SONAME at all, which caused problems when linking things against it (i.e. extension modules).If we need to omit this argument on AIX, then the proper fix would be to simply do that with a platform check.
encukou commentedon Apr 16, 2025
cc AIX experts: @edelsohn, @ayappanec
ayappanec commentedon Apr 16, 2025
@encukou Thanks for notifying this.
Agree with @mhsmith , that the proper fix would be to do this under a platform check.
Let me work on a PR to fix this.
pythongh-117088: Fix AIX build
serhiy-storchaka commentedon Apr 16, 2025
I suppose that the following patch also should fix issue on AIX:
@mhsmith, does it break Android build?
mhsmith commentedon Apr 16, 2025
Yes, it would break Android because it would take the
elsebranch and build libpython without an SONAME. This means extension modules linked against it would have no NEEDED entry for libpython, and would be unable to resolve their libpython symbols at runtime.gh-117088: Fix AIX build (GH-132595)
pythongh-117088: Fix AIX build (pythonGH-132595)
pythongh-117088: Fix AIX build (pythonGH-132595)
[3.13] gh-117088: Fix AIX build (GH-132595) (GH-133839)
[3.14] gh-117088: Fix AIX build (GH-132595) (GH-133838)
pythongh-117088: Fix AIX build (pythonGH-132595)
pythongh-117088: Fix AIX build (pythonGH-132595)