[Python-Dev] Linux Python linking with G++?

"Martin v. Löwis" martin at v.loewis.de
Sat Jul 9 00:29:05 CEST 2005


David Abrahams wrote:
>>If there is some library with such objects that happens to get
>>wrapped and dynamically linked into a Python interpreter 
> 
> 
> Whoa there.  How would that ever happen under ordinary circumstances?
> Doesn't Python's makefile control what gets linked to Python?

Not entirely. By extending Modules/Setup (e.g. in the way freeze works),
it is well possible to have additional extension modules linked into the
Python interpreter, extension modules which are not part of the
standard Python distribution.

In fact, before Python supported dynamic loading of extension modules,
this was the *only* way to use non-standard extension modules. You
always had to build your own version of the Python interpreter. I
believe ccpython.cc dates back to these times.

> If there's someone around here who is responsible for this change and
> knows its real rationale, can (s)he please tell me what it is?  If
> not, can we please change things back so Python doesn't get linked to
> the C++ runtime by default?

ccpython.cc and --with-cxx was first published in Python 1.6, and
hasn't changed much since. So for some of you, it has "always"
been there. It was contributed by Geoff Furnish.

What *has* changed now is that the configure test suddenly determines
that you need to link with g++ on Linux if main was compiled with g++.
This was not the case before, but now is (since g++ 3.2 or something).

Regards,
Martin


More information about the Python-Dev mailing list