[Cryptography-dev] Cross compile for OpenWRT/MIPS?

sam at samkronick.com sam at samkronick.com
Mon Jul 28 17:00:13 CEST 2014


Hi all,
I’m trying to get a python library (mitmproxy/libmproxy) running on OpenWRT (https://openwrt.org/) on a router with a MIPS CPU. mitmproxy depends on cryptography, and I’m getting stuck trying to cross-compile cryptography for MIPS using the OpenWRT SDK.

I have the cross compiler set up and have cross compiled a few python libraries with c code so I know that works (following http://whatschrisdoing.com/blog/2009/10/16/cross-compiling-python-extensions/). The issue I’m having seems to be with cffi— it’s cross-compiling the c code from cryptography, but then it tries to load that and execute it on the build machine which throws a cffi.ffiplatform.VerificationError complaining “wrong ELF class: ELFCLASS32” Of course it can’t run the code that was compiled for another architecture, but is there any way around this? There is no native compiler available for OpenWRT, so cross-compiling seems necessary.

Any ideas?

Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20140728/ae60dd0c/attachment.html>


More information about the Cryptography-dev mailing list