[Distutils] Improving compiler (GCC) detection?

Aleksandr Mezin mezin.alexander at gmail.com
Tue Nov 1 11:40:57 EDT 2016

I have problems with distutils not detecting when compiler is GCC. It
passes "-R" option on command line, which isn't supported by GCC
without "-Wl,".

In my build environment (I build Python from source), "CC" environment
variable is set to "/usr/bin/cc", which actually points to GCC. But
distutils simply checks executable name. Also I'd like to use

So, I think, distutils should somehow check __GNUC__ definition
instead. Are there any reasons why such detection can't/shouldn't be
implemented? I'd like to work on the patch, but at first I'd like to
know if it's possible/will be accepted.

Also, clang on linux doesn't accept "-R" too:
warning: unknown remark option '-R/usr/lib'; did you mean '-Rpass'?

More information about the Distutils-SIG mailing list