[C++-sig] [Python-Dev] GCC version compatibility

David Abrahams dave at boost-consulting.com
Sun Jul 10 15:38:35 CEST 2005

Christoph Ludwig <cludwig at cdc.informatik.tu-darmstadt.de> writes:

> --with-cxx=<compiler>: If you plan to use C++ extension modules, then on some
>         platform you need to compile python's main() function with the C++
>         compiler. With this option, make will use <compiler> to compile main()
>         *and* to link the python executable. It is likely that the resulting
>         executable depends on the C++ runtime library of <compiler>.
>         Note there are platforms that do not require you to build Python with
>         a C++ compiler in order to use C++ extension modules. E.g., x86 Linux
>         with ELF shared binaries and GCC 3.x, 4.x is such a platform. We
>         recommend that you configure Python --without-cxx on those platforms
>         to avoid unnecessary dependencies.

I don't think that's strong enough.  What happens is that dynamically
loaded Python extension modules built with other, ABI-compatible
versions of G++ may *crash*.

>         If you need to compile main() with <compiler>, but your platform does
>         not require that you also link the python executable with <compiler> 
>         (e.g., <example platform>), then set LINKCC='$(PURIFY) $(CC)' prior to
>         calling make. Then the python executable will not depend on the C++
>         runtime library of <compiler>.

Are we sure we have an actual use case for the above?  Doesn't
--without-cxx cover all the actual cases we know about?

> BTW, I'd also change the short explanation output by `configure --help'.
> Something like:
>   AC_HELP_STRING(--with-cxx=<compiler>, 
>                  use <compiler> to compile and link main())
> In Python 2.4.1, the help message says "enable C++ support". That made me use
> this option even though it turned out it is not necessary on my platform.

Your suggestion is simple and powerful; I like it!

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list