Forum Stats

  • 3,851,381 Users
  • 2,263,969 Discussions
  • 7,904,691 Comments

Discussions

CC on Sparc, Run on x86

807575
807575 Member Posts: 16,875
Is there a flag/option that I can set to
compile c code on a Sparc, generating an
executable that I can run on a PC that is
running Solaris 7?

Or do I need to copy all of the source code
from the Sparc to the PC, and then compile
using a x86 version of Workshop?

Thanks!!!

Comments

  • 807575
    807575 Member Posts: 16,875
    The SPARC and x86 platforms are NOT binary compatible. You cannot run SPARC executables on an x86 system, and you cannot run x86 executables on a SPARC system.

    For eg: 1) file /usr/bin/ls
    /usr/bin/ls: ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped
    2) file /usr/bin/ls
    /usr/bin/ls: ELF 32-bit LSB executable 80386 Version 1, dynamically linked, stripped

    Any binaries you execute must be compiled on the platform where they will run.

    So, you may need to copy all the source code from Sparc to PC and
    then compile.
This discussion has been closed.