Hi Tom and community members,
>I don't really understand this, but (1) I didn't see any other
>commentary on it and (2) it seems to be AIX-specific.
>So, I think it is ok. I appreciate the comment in there.
>It's fine if you want to apply this to the gdb-18 branch as well.
>Approved-By: Tom Tromey <tom@tromey.com>
Thank you for the approval. I have pushed the same.
So, the problem is LINKFORSHARED in AIX also tries to search for Modules/python.exp file. This file tells the AIX linker all the symbols exported from the libpython3.12.a(libpython3.12.so) shared library for symbols
resolution. If we do not use this export file AIX Linker thinks nothing is exported from that library and then symbols are not found and python is not linked when GDB binary uses functions from python library.
In this case we do not have the python.exp file in “Modules” path. We have it in /opt/freeware/lib64/python3.12/config-3.12/
# ls -l /opt/freeware/lib64/python3.12/config-3.12/python.exp
-rw-r--r-- 1 root system 52887 Jun 30 01:43 /opt/freeware/lib64/python3.12/config-3.12/python.exp
bash-5.3# head -7 /opt/freeware/lib64/python3.12/config-3.12/python.exp
#!libpython3.12.a(libpython3.12.so)
PyAIter_Check
PyAST_Check
PyAST_mod2obj
PyAST_obj2mod
PyAnextAwaitable_New
PyArg_Parse
So we need to get GDB to understand where /opt/freeware/lib64/python3.12/config-3.12/python.exp
is which is done by LIBPL/python.exp and then GDB in AIX compiles with python.
Hope this helps.
Thanks and regards,
Aditya,