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
Compiled object files don't usually transfer well between different linux distributions. Different Distributions often have different policies regarding libraries, where they're stored, how they're loaded.
There's so many differences between them (yes, even in Fedora & RedHat/CentOS). They're likely to supply their own patches to componenets at every level (kernel, PHP, library location). If they're using the distribution PHP package, the distribution might have patched it better intergrate into their system.
The major issue you'll likely run into is that the distribution have used a different libraries/compiler settings. Check to see what verision gcc is on his computer and compare it to what's on yours. (Fedora 12 has quite a few newer libraries than CentOS). That's where your issue might be.
Another possible issue is that your binary is fine, but its incompatible with all the libraries it uses. I'm not sure if there's a good way to get around this one without compiling on the target-distribution (or a varient). You can see what libraries each shared object/executable uses by using the lld
command.
Also, was there any output before the error ELF file OS ABI invalid
? Most places I see it being referenced there's more information than that.