[Cryptography-dev] Cross compiling wrong ELF class: ELFCLASS32

Lars Alex Pedersen laa at kamstrup.com
Fri May 5 02:43:08 EDT 2017


Hope that someone can lead me in the right direction. Trying to cross
compile python3-cryptography for an ARM architecture on a x64 host and ends
up with:

ImportError:
/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8.
1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg/_cffi_backend.cpython-35m-arm-linux
-gnueabi.so: wrong ELF class: ELFCLASS32

Looks like _cffi_backend.cpython-35m-arm-linux-gnueabi.so if correct but
somehow used by a 64bit python during some step?

------------------------------------
target: python3-cryptography.compile
------------------------------------

Installed
/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8.
1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg
Searching for pycparser
Reading https://pypi.python.org/simple/pycparser/
Best match: pycparser 2.17
Downloading
https://pypi.python.org/packages/be/64/1bb257ffb17d01f4a38d7ce686809a736837a
d4371bcc5c42ba7a715c3ac/pycparser-2.17.tar.gz#md5=ca98dcb50bc1276f230118f6af
5a40c7
Processing pycparser-2.17.tar.gz
Writing /tmp/easy_install-3h983a01/pycparser-2.17/setup.cfg
Running pycparser-2.17/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-3h983a01/pycparser-2.17/egg-dist-tmp-g_kj1xdg
warning: no previously-included files matching 'yacctab.*' found under
directory 'tests'
warning: no previously-included files matching 'lextab.*' found under
directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under
directory 'examples'
warning: no previously-included files matching 'lextab.*' found under
directory 'examples'
zip_safe flag not set; analyzing archive contents...
pycparser.ply.__pycache__.yacc.cpython-35: module references __file__
pycparser.ply.__pycache__.yacc.cpython-35: module MAY be using
inspect.getsourcefile
pycparser.ply.__pycache__.yacc.cpython-35: module MAY be using inspect.stack
pycparser.ply.__pycache__.ygen.cpython-35: module references __file__
pycparser.ply.__pycache__.lex.cpython-35: module references __file__
pycparser.ply.__pycache__.lex.cpython-35: module MAY be using
inspect.getsourcefile
creating
/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8.
1/.eggs/pycparser-2.17-py3.5.egg
Extracting pycparser-2.17-py3.5.egg to
/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8.
1/.eggs

Installed
/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8.
1/.eggs/pycparser-2.17-py3.5.egg
Traceback (most recent call last):
  File "setup.py", line 335, in <module>
    **keywords_with_side_effects(sys.argv)
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/sysroot-host/lib/python3.5/di
stutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/sysroot-host/lib/python3.5/si
te-packages/setuptools/dist.py", line 272, in __init__
    _Distribution.__init__(self,attrs)
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/sysroot-host/lib/python3.5/di
stutils/dist.py", line 281, in __init__
    self.finalize_options()
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/sysroot-host/lib/python3.5/si
te-packages/setuptools/dist.py", line 327, in finalize_options
    ep.load()(self, ep.name, value)
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8
.1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg/cffi/setuptools_ext.py", line 188,
in cffi_modules
    add_cffi_module(dist, cffi_module)
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8
.1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg/cffi/setuptools_ext.py", line 49,
in add_cffi_module
    execfile(build_file_name, mod_vars)
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8
.1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg/cffi/setuptools_ext.py", line 25,
in execfile
    exec(code, glob, glob)
  File "src/_cffi_src/build_openssl.py", line 94, in <module>
    extra_link_args=extra_link_args(compiler_type()),
  File "src/_cffi_src/utils.py", line 61, in build_ffi_for_binding
    extra_link_args=extra_link_args,
  File "src/_cffi_src/utils.py", line 69, in build_ffi
    ffi = FFI()
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8
.1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg/cffi/api.py", line 46, in __init__
    import _cffi_backend as backend
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8
.1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg/_cffi_backend.py", line 7, in
<module>
    __bootstrap__()
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8
.1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg/_cffi_backend.py", line 6, in
__bootstrap__
    imp.load_dynamic(__name__,__file__)
  File
"/home/laa/git/penguin/ptxdist/platform-tqma28/sysroot-host/lib/python3.5/im
p.py", line 342, in load_dynamic
    return _load(spec)
ImportError:
/home/laa/git/penguin/ptxdist/platform-tqma28/build-target/cryptography-1.8.
1/.eggs/cffi-1.10.0-py3.5-linux2-arm.egg/_cffi_backend.cpython-35m-arm-linux
-gnueabi.so: wrong ELF class: ELFCLASS32
/usr/local/lib/ptxdist-2016.08.0/rules/post/ptxd_make_world_compile.make:21:
recipe for target
'/home/laa/git/penguin/ptxdist/platform-tqma28/state/python3-cryptography.co
mpile' failed
make: ***
[/home/laa/git/penguin/ptxdist/platform-tqma28/state/python3-cryptography.co
mpile] Error 1


Best regards
Lars Alex Pedersen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3545 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cryptography-dev/attachments/20170505/9046c97e/attachment.bin>


More information about the Cryptography-dev mailing list