How do I compile on linux to share with all distributions?

后端 未结 3 789
無奈伤痛
無奈伤痛 2021-01-03 01:17

I compiled a PHP extension on Fedora Core 12, but when I send it to someone using CentOS they get the error: \"ELF file OS ABI invalid\"

I\'m not sure what causes th

3条回答
  •  隐瞒了意图╮
    2021-01-03 02:13

    It's most likely that your friend is not running a 64-bit system. ELF is the standard format for Linux executables, but 32-bit systems can't run 64-bit executables.

    Get the output for uname -a from your friend. If the output doesn't contain "x86_64", then he's on a 32-bit version of CentOS.

    If so, you either need to set up a cross-compiling environment, or a virtual machine for compiling 32-bit binaries on, or just provide your friend with the sources so that he can compile it himself.

提交回复
热议问题