X86 vs Sparc

If I had a basic program (written in C) running and compiled on a Sparc/Solaris platform and copied the executable to a Solaris/X86 platform, would it have a chance to execute successfully?
[196 byte] By [skydoylea] at [2007-11-27 9:55:44]
# 1
only if you cross compiled it on the SPARC machine. If not, then copy the source to the x86 box and recompile there.alan
alan.paea at 2007-7-13 0:25:46 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 2
Alan, thanks for your quick response.What do you mean by cross compile?
skydoylea at 2007-7-13 0:25:46 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 3
You can setup a compiler to compile for more than one platform. It's probably a lot more work than just moving the code and recompiling on the native platform.alan
alan.paea at 2007-7-13 0:25:46 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 4

Alan,

What how do you think the program executable would fail when trying to run it on the X86 chipset? When the compile happens on the Sparc hardware, is there some flag set that says it must run on a Sparc? Guess what I'm trying to say is why would the compiler care about the hardware? I'm assuming some instruction sets are different yet what if those instructions are not used?

Thanks again.

skydoylea at 2007-7-13 0:25:46 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 5

> some flag set that says it must run on a Sparc? Guess

> what I'm trying to say is why would the compiler care

> about the hardware? I'm assuming some instruction

It has no choice but to fail. SPARC is big endian, Intel etc... are little endian. One reads from the left the other from the right. How could it possibly work?

cross = cross compiler / cross platform compiler in this thread

alan

alan.paea at 2007-7-13 0:25:46 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 6

Alan,

So in our case we have IBM Blade Centers (HS21s) and VMWARE to virtualize multiple operating systems and support.

And your saying that if we had to move applications from a Sparc platform to this new platform, that all these applications would need to be recompiled?

Thanks again.

skydoylea at 2007-7-13 0:25:46 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 7
Try it out for yourself. Grab the Adobe Reader for Sparc and install it on an x86 box. Or try the flash player for Sparc on x86 which was a very recent thread on one of these forums.alan
alan.paea at 2007-7-13 0:25:46 > top of Java-index,Solaris Operating System,Solaris 10 Features...
# 8
Not to mention that the instruction sets are completely different :-) Both logically, AND in the binary... It's like trying to run a gas stove off of an electric line, ain't gonna happen :-)
DoxBriana at 2007-7-13 0:25:46 > top of Java-index,Solaris Operating System,Solaris 10 Features...