[Distutils] a patch for distutils + gcc + linux, that was never apply, yet will solve many problems.

Jorge Vargas jorge.vargas at gmail.com
Sat Jul 1 05:39:22 CEST 2006

Hello everyone

I did a package for gentoo (ebuild) a while ago and it has a C/C++
extension, to compile agains a gecko-compliant mozilla product.

Long story short our solution (build agains mozilla) seem to had nothing to
do with the real bug which someone posted today.

It seems there is a bug in distutils itself, because it is passing the wrong
arguments to g++, the most incredible part is that the bug is so simple to
fix yet there is no reply, maybe this got lost in the main python

here is the most important part of his post

/usr/lib/python2.4/distutils/unixccompiler.py to build.
** /usr/lib/python2.4/distutils/unixccompiler.py fills the 'CC' executable
variable by invoking /usr/lib/python2.4/distutils/sysconfig.py
** /usr/lib/python2.4/distutils/unixccompiler.py contains a condition that
        elif compiler[:3] == "gcc" or compiler[:3] == "g++":
            return "-Wl,-R" + dir
** /usr/lib/python2.4/distutils/sysconfig.py returns the 'CC' executable
variable by reading from /usr/lib/python2.4/config/Makefile
** If your system is like many others, it will return something like
'CC=i686-pc-linux-gnu-gcc -pthread', will never == "gcc" and so the correct
linker options will not be used.

if anyone could please verify it and maybe find out why it wasn't apply,
honestly I have very little knowlegde of C and it's integration with python
to be able to verify it.

his full post is at

the original disutil gentoo bug:

the patch at sourceforce:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/distutils-sig/attachments/20060630/e95bff97/attachment.htm 

More information about the Distutils-SIG mailing list