aterrel
aterrel

Reputation: 2082

How do I specify the linker when building python extensions?

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?

Upvotes: 6

Views: 2707

Answers (1)

tito
tito

Reputation: 13261

You can customize the linker used with LDSHARED environment variable:

LDSHARED=/usr/bin/ld python setup.py build_ext

Upvotes: 10

Related Questions