C object code compatiblity with UNIX and Linux

Is it possible to use an object code compiled on Unix- sun Os sparc on Redhat linux OS. In our new application we have to create object file on Unix os and then use the object code on Linux OS to compile pro*c code but when we are trying to achieve this we get error: file in wrong format. how can we achieve this functionality? Is it possible to use object code from unix on Linux?

A Guess:
ELF format is a standard, but I think you may have a problem with endianess. For example Red Hat LINUX 7 for IBM Power8 servers has 2 builds:

IBM Knowledge Center Error

Solaris is on SPARC is big endian. Only.

Exactly what systems do you have?

1 Like

X86 has different endianness and opcodes, compared to Sparc.
Even Linux on Sparc and Solaris Sparc are different because they use different libraries.
And so are Solaris x86 and standard Linux.

If you use a cross compiler then you can take your source code and produce an object file for both SunOS and RHEL machines...