Porting of SPARC application to x86
Hi All -
I have SPARC working application code, which needs to be ported to solaris 10 x86. I added -D__386 to the compile flags. Compiled fine, but have problems in running. If I compile with -D_BIG_ENDIAN, seems like the application processes go further in execution than it was before. I am running out of options for trying different things. You help will be greatly appreciated
Regards
[409 byte] By [
ledzepa] at [2007-11-27 0:51:44]

# 1
> Hi All -
>
> I have SPARC working application code, which needs to
> be ported to solaris 10 x86. I added -D__386 to the
> compile flags. Compiled fine, but have problems in
On which machine, the Sparc or x86?
We have no idea what steps you did on which machine.
alan
# 2
Hello
The "-D_BIG_ENDIAN" shows you that the code is endian-dependent. This means that the program cannot be ported 1:1 because x86 is little endian while Sparc is big-endian.
I would first try to use "-D_LITTLE_ENDIAN" (or what flag ever I can find in the source codes) and to compile for x86.
Because of the "-D_BIG_ENDIAN" different source code is used for both machines. Maybe the little-endian source code is wrong:
#ifdef _BIG_ENDIAN
// correct source code for Sparc
#else
// INCORRECT source code for x86
#endif
Martin