This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Wrong linker command if CXX set to "ccache g++"
Type: behavior Stage: resolved
Components: Distutils Versions: Python 2.6
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: tarek Nosy List: akitada, perttikellomaki, schmir, steve.dower, tarek
Priority: normal Keywords: patch

Created on 2009-09-08 13:05 by perttikellomaki, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
linker_command.patch perttikellomaki, 2009-09-08 16:31 Patch to fix the problem.
Messages (5)
msg92414 - (view) Author: Pertti Kellomäki (perttikellomaki) Date: 2009-09-08 13:05
If the compiler command in CXX contains more than one word, e.g. "ccache
g++", line 256 in distutils/ only picks the first word
as the linker and discards the rest:

                    linker[i] = self.compiler_cxx[i]

On Ubuntu 9.04 the values of the variables are:

(Pdb) print linker
['gcc', '-pthread', '-shared', '-Wl,-O1', '-Wl,-Bsymbolic-functions']
(Pdb) print self.compiler_cxx
['ccache', 'g++']
msg92423 - (view) Author: Pertti Kellomäki (perttikellomaki) Date: 2009-09-08 16:31
This patch seems to solve the problem for me. I think it should also
work with the environment variable setting on OS X, but I haven't tested it.
msg92540 - (view) Author: Akira Kitada (akitada) * Date: 2009-09-12 11:57
Aren't CC and CXX variables just for compilers?

    Program for compiling C programs; default `cc'.
    Program for compiling C++ programs; default `g++'.
msg92543 - (view) Author: Pertti Kellomäki (perttikellomaki) Date: 2009-09-12 13:10
The linker is usually called via a compiler, which arranges for compiler
specific libraries to be included in the linking. See e.g. section 10.2
in the GNU Make manual:

Linking a single object file

n is made automatically from n.o by running the linker (usually called
ld) via the C compiler. The precise command used is `$(CC) $(LDFLAGS)
msg386451 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:37
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:56:52adminsetgithub: 51112
2021-02-03 18:37:45steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386451

resolution: out of date
stage: resolved
2011-03-16 23:50:15schmirsetnosy: + schmir
2010-02-09 16:55:32brian.curtinsetpriority: normal
type: crash -> behavior
2009-09-12 13:10:04perttikellomakisetmessages: + msg92543
2009-09-12 11:57:19akitadasetnosy: + akitada
messages: + msg92540
2009-09-08 16:31:59perttikellomakisetfiles: + linker_command.patch
keywords: + patch
messages: + msg92423
2009-09-08 13:05:37perttikellomakicreate