
On 18.05.2021 13:36, Ronald Oussoren wrote:
On 18 May 2021, at 13:26, Marc-Andre Lemburg <mal@egenix.com <mailto:mal@egenix.com>> wrote:
On 18.05.2021 13:02, Ronald Oussoren wrote:
If you are embedding a Python with frozen modules, you will need to call the Py_FrozenMain() API from your application's main() (or other entry point within your application).
Removing the export will break such applications. Removing the API from the stable ABI makes it impossible to use the stable ABI from such applications.
Is that intended ? Perhaps I'm missing something.
The discussion is about having a Py_FrozenMain() ABI in a statically linked python executable. That executable cannot be used to create a frozen application because, as you say, those need a custom main function that calls Py_FrozenMain() and should therefore link to libpython (either dynamically or statically).
I lost you there :-)
My bad. I’ll try to be more clear ;-)
The issue that started this discussion thread is that a test that verifies that symbols in the stable ABI are present using ctypes fails when the python interpreter itself is statically linked. That’s because nothing in the interpreter itself references Py_FrozenMain() and hence the symbol doesn’t get included in a statically linked python interpreter.
That’s not really a problem because a frozen binary won’t use the statically linked interpreter anyway.
Ok, that I understand :-) Thanks for the explanation.
Linker optimizations can indeed get in the way. ld has an option --whole-archive which usually guards against such optimizations.
-- Marc-Andre Lemburg eGenix.com
Professional Python Services directly from the Experts (#1, May 18 2021)
Python Projects, Coaching and Support ... https://www.egenix.com/ Python Product Development ... https://consulting.egenix.com/
::: We implement business ideas - efficiently in both time and costs :::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 https://www.egenix.com/company/contact/ https://www.malemburg.com/