问题
I have python2.7 installed using macports gcc-4.6. When I build an extension module (python setup.py build_ext) the correct gcc (/opt/local/bin/gcc) gets called but the wrong linker (it call /Developer/usr/bin/clang). Is there a way to override the call that python is linking with?
回答1:
You can customize the linker used with LDSHARED environment variable:
LDSHARED=/usr/bin/ld python setup.py build_ext
来源:https://stackoverflow.com/questions/9369827/how-do-i-specify-the-linker-when-building-python-extensions