Search code examples
solariscc

cross compilation from Solaris sparc to Solaris x86


May I know if I can cross compile the Solaris x86 library from Solaris sparc server?

The source code is mainly in C++ (some C). I need to use the Solaris C++ compiler CC to compile. I understand that some compile or link flags are different between sparc and x86. I have done a check to make sure that the flags I used are common.

Is it possible to simply copy the library compiled in sparc to x86? Or I need to apply specific flag during compiling and linking?

Thanks,


Solution

  • The Sun/Oracle Studio C++ compilers do not support cross-compilation. You would need to use another compiler that does, like a specially built gcc.

    Simply copying the library can't work - SPARC and x86 are very different instruction sets, with no binary compatibility between the two.