1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cannot run linux application on FreeBSD amd64

Discussion in 'Installation and Maintenance of Ports or Packages' started by fcaccava, Jan 30, 2012.

  1. fcaccava

    fcaccava New Member

    Messages:
    9
    Thanks Received:
    0
    I have installed the linux_base-f10 port and it says support for 32 bit and amd64. However, when I try to run a linux application on my FreeBSD amd64 machine I get error:
    Code:
    eng55419# ./standalone
    ELF binary type "3" not known.
    ./standalone: Exec format error. Binary file not executable.
    eng55419# brandelf -l
    known ELF types are: FreeBSD(9) Linux(3) Solaris(6) SVR4(0)
    eng55419#
    

    When I do a readelf -e on my executable, the OS/ABI is UNIX-Linux, so I believe the application has the correct branding.

    Is it possible to run Linux applications on FreeBSD AMD64?

    Thanks.
     
  2. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,721
    Thanks Received:
    2,137
  3. yks

    yks New Member

    Messages:
    49
    Thanks Received:
    0
    Have you enabled linux emulation in the kernel? You need to load the linux.ko module
    # kldload linux.ko
    or compile it into your kernel. There is also an option linux_enable in rc.conf.
     
  4. adamk

    adamk New Member

    Messages:
    1,624
    Thanks Received:
    265
    Yes, if the applications are 32-bit. The linux compat layer does not support 64-bit apps yet. What is the output of file ./standalone

    Adam
     
  5. fcaccava

    fcaccava New Member

    Messages:
    9
    Thanks Received:
    0
    Code:
    eng55419# file ./standalone
    ./standalone: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.4, not stripped
    eng55419#
    
     
  6. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,515
    Thanks Received:
    2,351
    You can't run 64 bit linux executables, only 32 bit.