0

I have a third party library file compiled for Linux, when I tried to execute using terminal I get the error:
cannot execute binary file:

File details are as follows:

ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), 
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for 
GNU/Linux 3.2.0, BuildID[sha1]=820d7e089c6c3cdc19fa3e759ccae22fbc672652, 
with debug_info, not stripped

I tried installing Rosetta, tried running with the command with a prefix arch -x86_64
but it resulted in the same error.

If I try to execute them on the terminal application directly, it shows the error:
zsh: exec format error:

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
harish
  • 61
  • 1
  • 3
  • You know Linux is a different OS than MacOS, right? Any reason to expect MacOS to run Linux ELF executables? (MacOS use MachO64 executables, that's why you get `exec format error` instead of some other error.) – Peter Cordes Feb 15 '22 at 05:52
  • Yes, I am aware that both are different, I have only macbook air with me no Linux X86 machine. Hence wanted to try it. Also I tried UTM linux images but no success. Let me know if there is any solution . – harish Feb 15 '22 at 06:21
  • I would like to run Linux ELF on Mac M1 and I am facing a similar issue. I hope that there might exist programs/tools that allow us to run Linux ELF on Mac M1, but I am not aware of any. In case someone finds a solution to this, please let me know. I would be grateful for any help. – ubaid shaikh Mar 14 '23 at 15:42

0 Answers0