question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cross-Compilation error: error adding symbols: File in wrong format

See original GitHub issue

Env.

  • remote device: fireflyRK3399, ARM A72, built runtime previously
  • local machine: i7-3630, built tvm previously

config.mk

  • remote device
DEBUG = 1
USE_OPENCL = 1 # installed opencl previousl
USE_RPC = 1
USE_BLAS = openblas
  • local machine
DEBUG = 1
USE_OPENCL = 1 # installed opencl previously
LLVM_CONFIG = llvm-config
USE_BLAS = openblas

Remote Device (ARM A72)

yuanshuai@firefly:~$ python -m tvm.exec.rpc_server --host 0.0.0.0 --port=9090
Loading runtime library /home/yuanshuai/code/tvm/lib/libtvm_runtime.so... exec only
INFO:root:RPCServer: bind to 0.0.0.0:9090
INFO:root:RPCServer: connection from ('192.168.1.110', 60482)
INFO:root:Connection from ('192.168.1.110', 60482)
[01:34:55] src/runtime/rpc/rpc_server_env.cc:23: Upload /tmp/tmp0gxCni/mylib.o... nbytes=4280
INFO:root:Create shared library based on /tmp/tmp0gxCni/mylib.o

Local Machine

yuens@Spark:~/Software/tvm/tutorials/python$ python cross_compilation_and_rpc.py                                                                                                                                                                                                                                         [2/30]
Traceback (most recent call last):
  File "cross_compilation_and_rpc.py", line 189, in <module>
    f = remote.load_module('mylib.o')
  File "/home/yuens/Software/tvm/python/tvm/contrib/rpc.py", line 299, in load_module
    return _LoadRemoteModule(self._sess, path)
  File "/home/yuens/Software/tvm/python/tvm/_ffi/function.py", line 255, in my_api_func
    return flocal(*args)
  File "/home/yuens/Software/tvm/python/tvm/_ffi/_ctypes/function.py", line 183, in __call__
    ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
  File "/home/yuens/Software/tvm/python/tvm/_ffi/base.py", line 62, in check_call
    raise TVMError(py_str(_LIB.TVMGetLastError()))
tvm._ffi.base.TVMError: Except caught from RPC call: TVMCall CFunc Error:
Traceback (most recent call last):
  File "/home/yuanshuai/code/tvm/python/tvm/_ffi/_ctypes/function.py", line 54, in cfun
    rv = local_pyfunc(*pyargs)
  File "/home/yuanshuai/code/tvm/python/tvm/contrib/rpc.py", line 42, in load_module
    cc.create_shared(path + '.so', path)
  File "/home/yuanshuai/code/tvm/python/tvm/contrib/cc.py", line 52, in create_shared
    raise RuntimeError(msg)
RuntimeError: Compilation error:
/usr/bin/ld: /tmp/tmp0gxCni/mylib.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: /tmp/tmp0gxCni/mylib.o: Relocations in generic ELF (EM: 62)
/tmp/tmp0gxCni/mylib.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tqchencommented, Aug 24, 2017

try to do gcc -v on the board to see the target triple you have

1reaction
tqchencommented, Aug 24, 2017

Also note that if you want to do CPU testing, it might make sense to add detailed target options, for example

-mattr=+neon

to enable neon support

Read more comments on GitHub >

github_iconTop Results From Across the Web

cross compile: error adding symbols: File in wrong format
I have add these two statements "SET(CMAKE_C_COMPILER "mips-linux-uclibc-gnu-gcc") SET(CMAKE_CXX_COMPILER "mips-linux-uclibc-gnu-g++") " and ...
Read more >
Cross compiling fails with "error adding symbols: File in wrong ...
I am building rocket version 0.4.2 with up-to-date rust nightly on Ubuntu 16.04 (amd64). Cross compiling failes, even with the hello world example...
Read more >
(SOLVED)libcudart.so: error adding symbols: File in wrong ...
I try to do the cross-compile for DPX2 following the README.md. ... (SOLVED)libcudart.so: error adding symbols: File in wrong format.
Read more >
How to resolve 'Gcc: error adding symbol: file in wrong format ...
The question is far to broad and impossible to answer. If you're compiling with gcc, the error could be anything from missing libraries,...
Read more >
How to Cross-Compile ArmNN on x86_64 for arm64
When building armNN: /usr/local/lib/libboost_log.a: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status CMakeFiles/armnn.dir/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found