构建 python 扩展时如何指定链接器?
我使用 macports gcc-4.6 安装了 python2.7。当我构建扩展模块(python setup.py build_ext)时,会调用正确的 gcc (/opt/local/bin/gcc),但会调用错误的链接器(它调用 /Developer/usr/bin/clang)。有没有办法覆盖 python 链接的调用?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以自定义与 LDSHARED 环境变量一起使用的链接器:
You can customize the linker used with LDSHARED environment variable: