brx
brx

Reputation: 119

Is there any way to recompile binaries from x86 to ARM on linux?

I'd like to collect some ideas about the solution of following problem. I've got a TOF camera, and its driver for linux x86/64. It works fine. But in fact the camera would be used on an ARM based embedded device if that's possible.

Questions:

ps: the pure source is very expensive, so I don't like to purchase it anyway :)

Upvotes: 11

Views: 14197

Answers (4)

Dmitry Grigoryev
Dmitry Grigoryev

Reputation: 3204

If your driver is a kernel object, there is no emulator (to my knowledge) capable of running x86 kernel code inside ARM kernel. If your "driver" is in fact a userspace library hacked on top of a generic driver (v4l2, etc.), you may have luck with QEMU or Exagear mentioned here. As a side note, you will probably end up with an x86 application software, too, as calling an x86 library from ARM code is not supported by QEMU or Exagear out of the box.

Upvotes: 0

Scott Rice
Scott Rice

Reputation: 2450

Recently created Eltechs ExaGear Server, available on ARM as A Service, runs x86 applications on ARM devices.

It is new and proprietary, but it does exist.

Upvotes: 0

m0skit0
m0skit0

Reputation: 25863

  1. AFAIK, as of today, there's no such decompiler that will generate compilable code from machine code. You will have to manually fix (usually a LOT of fixes) the generated code. You can check this question for Linux decompilers.
  2. Check QEmu. Underlying architecture is not relevant as long as you can execute it ;)
  3. There's not much besides what you've stated.

What you're attempting is (in part) reverse engineering. RE is a complex process and requires great knowledge in the thing you're attempting to reverse; in your case camera drivers. If you have knowledge in this area, go ahead. If you don't, I wouldn't waste my time on it (or get the knowledge first ;))

Upvotes: 4

Scott Wisniewski
Scott Wisniewski

Reputation: 25031

See the following answer for details. It lists some of the problems you could encounter attempting to automate such a translation:

Convert object file to another architecture

Upvotes: 0

Related Questions