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.

Author Joshua.J.Cogliati
Recipients Alexander.Sulfrian, Joshua.J.Cogliati, Xuefer.x, dstufft, eric.araujo, jrincayc, ned.deily, ronaldoussoren, tarek
Date 2015-03-19.15:38:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426779515.57.0.41754411956.issue8027@psf.upfronthosting.co.za>
In-reply-to
Content
Looking at the patch (3078fdb7cf3d for Issue1488098) it has:
                 if target_lang == "c++" and self.compiler_cxx:
-                    linker[0] = self.compiler_cxx[0]

One possibility is that that the problem was:
 linker[0] = self.compiler_cxx[0]
which would also cause a compiler_cxx like:
export CXX="env BAR=FOO g++"
to fail.  Possibly the code:
 linker[i] = self.compiler_cxx[i]
managed to hit on an index value that worked better for the CXX that Ronald had on his system.

I think the root cause is the special casing of

if target_lang == "c++" and self.compiler_cxx:

and I think that few enough people use a c++ for extensions and of those, most use CXX="g++" or something similar where the complicated but incorrect version that is in Python works.

Basically, if you have something like CXX="g++" then both the version before 3078fdb7cf3d and after 3078fdb7cf3d work.
If you have something like CXX="env BAR=FOO g++"
then the version before 3078fdb7cf3d would not have worked.

I think it is likely that if 3078fdb7cf3d had completely eliminated:
-                if target_lang == "c++" and self.compiler_cxx:
-                    linker[0] = self.compiler_cxx[0]
instead of adding new code to try and work around the problem it also would have fixed the problem that Issue1488098 encountered.

I am guessing this problem really started with changeset 771b6f521b95 in 2002.  This codes purpose is:
 (UnixCCompiler.link): Included target_lang parameter, and made linker command use compiler_cxx, if target_lang is 'c++'. 
and that change is the one that added:
 linker[0] = self.compiler_cxx[0]
History
Date User Action Args
2015-03-19 15:38:35Joshua.J.Cogliatisetrecipients: + Joshua.J.Cogliati, ronaldoussoren, tarek, ned.deily, eric.araujo, jrincayc, Xuefer.x, Alexander.Sulfrian, dstufft
2015-03-19 15:38:35Joshua.J.Cogliatisetmessageid: <1426779515.57.0.41754411956.issue8027@psf.upfronthosting.co.za>
2015-03-19 15:38:35Joshua.J.Cogliatilinkissue8027 messages
2015-03-19 15:38:35Joshua.J.Cogliaticreate