binary conversion

Why would a binary which was compiled on a Solaris-10 not be runnable in a SunOS 5.10? (they are supposed to be precisely equivalent).

When I run the file command on it, it says:

ELF 32-bit LSB executable 80386 Version 1, dynamically linked, not stripped, no debugging information available

The only difference is that it is built on an x86 machine as can be seen above and the target machine which it fails to run in is a SPARC, why should that make a difference, if there are NO system calls? (OS is same!!)

Is there anyway on the source mahcine I can make it in such a way as to be able to run on the SPARC machine? (NOte: I cannot build it on target machine, long story - previous post).

Thanks.

The machine code and architecture of the cpus differ. The presence or absence of system calls is irrelevant.

Regards,
Alister

Build a SPARC toolchain on the x86 machine. It's a pain in the butt, and i've never done it on solaris, but they use gcc nowadays right?

Sparc toolchain? never heard of it although it sounds interesting...can you send me details/sites where/how I can do this? otherwise I am going to start wasting time on the Net to find out the long way, thx.

Here is a link:
How to Cross-Compile GCC for SPARC Solaris

Good luck if you go that route ...

1 Like

Yikes thanks dude. I'll give it a read then a shot.

just to confirm, this thing is dynamic right? in the sense that it can have source/target from any machine to any machine and dynamically set as it appears by env variables? forinstance I can set it to go from x86 to a SPARC sunos 5.10 ?

Yes, or at least that's the theory. You mileage may vary.

i love theories - i'm going to give the gcc install a try first though before this secondary solution (my other post)

A SPARC is not a 386, it's completely alien in comparison. They don't even read numbers in the same order.

It's difficult to imagine a program that has no system calls at all, too; I suspect it makes at least a few.

I said "TARGET" machine is a sparc !!! Source machine is x86. Please read the statement carefully.

Your statement is pretty unambigious. You didn't ask why it built a 386 executable for a SPARC target -- you asked why the 386 executable wouldn't run on a SPARC target. That's why.