
On Wed, May 19, 2021 at 12:45 PM Ronald Oussoren <ronaldoussoren@mac.com> wrote:
Do you mean “new C file” instead of “new C function”? Because all C compilers I’ve used so far default to including whose object files when a program uses at least one symbol from that object file. That’s why Py_FrozenMain() is currently the only missing symbol, the rest of the core has sufficiently large source code files to ensure all of them will be included. The issue could crop up for other symbols if, for example, functions that are included only for backward compatibility were to be moved to separate files.
Sorry, you're right: "new C file".
If no symbol of an object file (.o) is used, GCC ignores all symbols of the object file. If at least one symbol is used, all symbols of this object file are exported. It's weird, but it's the behavior that I saw in my manual tests. It's even more surprising because the issue goes away if no static library (libpython.a) is used. It really depends on how exactly C files are linked altogether.
Victor
Night gathers, and now my watch begins. It shall not end until my death.