Created attachment 379806 [details]
Long story short, /usr/bin/libtool uses whatever random CC/CXX was used when libtool was last installed. So, using system-wide libtool means mixing CC/CXX used when building the package with CC/CXX used when building libtool, with the latter likely no longer installed.
Solution: only possible I know is to use autotools macros to have proper local libtool suited for currently used CC/CXX. Or not use libtool at all.
Sorry, I put this with other queue of bugs. This one is distutils' fault, actually. It requires the environment to have proper CC/CXX/LDSHARED/LDCXXSHARED set.
@Python: what do we want to do? Provide function which every non-distutils-r1 ebuild building distutils modules is ought to call? Or just export the four unconditionally in python_setup?
Oh, another possibility is to consider this an upstream issue and expect people who run distutils from within autotools to set proper LDSHARED/LDCXXSHARED.