Compile failed with nnvm, lib.o file in wrong format

Hello,

I am trying to run the nnvm/tutorials/deploy_model_on_mali_gpu.py, the compilations fails with a linking error as if the target supplied was wrong:

Traceback (most recent call last):
  File "deploy_model_on_mali_gpu.py", line 226, in <module>
    rlib = remote.load_module('net.tar')
  File "/home/SERILOCAL/n.perto/Documents/tvm/python/tvm/rpc/client.py", line 148, in load_module
    return base._LoadRemoteModule(self._sess, path)
  File "/home/SERILOCAL/n.perto/Documents/tvm/python/tvm/_ffi/_ctypes/function.py", line 206, in __call__
    raise get_last_ffi_error()
tvm._ffi.base.TVMError: Traceback (most recent call last):
  [bt] (8) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x944fa8) [0x7f0815de4fa8]
  [bt] (7) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x944d08) [0x7f0815de4d08]
  [bt] (6) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x94b630) [0x7f0815deb630]
  [bt] (5) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x94ae51) [0x7f0815deae51]
  [bt] (4) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x949a45) [0x7f0815de9a45]
  [bt] (3) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x942fdf) [0x7f0815de2fdf]
  [bt] (2) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x949380) [0x7f0815de9380]
  [bt] (1) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x944049) [0x7f0815de4049]
  [bt] (0) /home/SERILOCAL/n.perto/Documents/tvm/build/libtvm.so(+0x913b7b) [0x7f0815db3b7b]
  File "/home/SERILOCAL/n.perto/Documents/tvm/python/tvm/_ffi/_ctypes/function.py", line 71, in cfun
    rv = local_pyfunc(*pyargs)
  File "/home/SERILOCAL/n.perto/Documents/tvm/python/tvm/rpc/server.py", line 66, in load_module
    m = _load_module(path)
  File "/home/SERILOCAL/n.perto/Documents/tvm/python/tvm/module.py", line 257, in load
    _cc.create_shared(path + ".so", files)
  File "/home/SERILOCAL/n.perto/Documents/tvm/python/tvm/contrib/cc.py", line 49, in create_shared
    _linux_shared(output, objects, options, cc)
  File "/home/SERILOCAL/n.perto/Documents/tvm/python/tvm/contrib/cc.py", line 106, in _linux_shared
    raise RuntimeError(msg)
TVMError: Except caught from RPC call: RuntimeError: Compilation error:
/usr/bin/ld: /tmp/tmp5uf1bcpv/lib.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/tmp5uf1bcpv/lib.o: Relocations in generic ELF (EM: 183)
/tmp/tmp5uf1bcpv/lib.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status

The device is android with arm64, and I have set in the script target_host = "llvm -target=aarch64-linux-android-gnu". I have also setTVM_NDK_CCtopath/to/aarch64-linux-android-g++`.
llvm-6.0 has been installed from ubuntu 16.04 repository.

Thank you for your help.

Why is there gnu on the end of the target?

Truth is I don’t know… I am not familiar to cross compilation and I may have seen it somewhere. Now the word ‘triple’ makes more sense to me in the documentation.