Python distutils gcc 路径
我正在尝试交叉编译 pycrypto 包,而且我越来越接近,但是,我遇到了一个我无法弄清楚的问题。
我希望 distutils 使用交叉编译特定的 gcc,所以我设置了 CC 环境变量,它似乎尊重编译器第一次调用的设置,但仅此而已。
export CC="/opt/teeos/buildroot/output/host/usr/bin/i586-linux-gcc"
/opt/teeos/buildroot/output/host/usr/bin/i586-linux-gcc -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 --sysroot=/opt/teeos/buildroot/output/staging -I/opt/teeos/buildroot/output/staging/usr/include/python2.7 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -c src/_fastmath.c -o build/temp.linux-i686-2.7/src/_fastmath.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/src/_fastmath.o -lgmp -o build/lib.linux-i686-2.7/Crypto/PublicKey/_fastmath.so
unable to execute gcc: No such file or directory
我暂时移动了我的系统 gcc,所以找不到它。
如何让 distutils 在每次调用编译器时尊重 CC=/opt/buildroot...
选项/设置我想要 distutils 使用的 GCC / LD 的路径?
I'm trying to cross-compile the pycrypto package, and I'm getting closer and closer however, I've hit an issue I just can't figure out.
I want distutils to use the cross-compile specific gcc- so I set the CC env var and it seems to respect the setting for the first invocation of the compiler, but thats it.
export CC="/opt/teeos/buildroot/output/host/usr/bin/i586-linux-gcc"
/opt/teeos/buildroot/output/host/usr/bin/i586-linux-gcc -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 --sysroot=/opt/teeos/buildroot/output/staging -I/opt/teeos/buildroot/output/staging/usr/include/python2.7 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -c src/_fastmath.c -o build/temp.linux-i686-2.7/src/_fastmath.o
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/src/_fastmath.o -lgmp -o build/lib.linux-i686-2.7/Crypto/PublicKey/_fastmath.so
unable to execute gcc: No such file or directory
I temporarily moved my systems gcc so it can't be found.
How do I make distutils respect the CC=/opt/buildroot...
option for every invocation of the compiler / set the path to the GCC / LD I want distutils to use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这听起来类似于我最近给出的另一个答案 自定义distutils 编译器。您还需要定义
LDSHARED
,这是用于生成最终共享对象的命令。看看这是否有效:然后将
gcc
替换为您所需的编译器以及CC
和LDSHARED
环境变量中的选项:This sounds similar to another answer I recently gave for customizing the distutils compiler. You'll also need to define
LDSHARED
which is the command used to produce the final shared object. See if this works:Then replace
gcc
with your desired compiler and options in theCC
andLDSHARED
environment variables: