3

I have searched around for a way to run a program meant for ARM processors on an Intel computer, but I can only find ways to do the reverse, to compile Intel programs for ARM. Are there any open-source cross-compilers that will allow me to do so? Thanks for your help.

  • What are you trying to do, specifically? Most languages that compile for ARM will compile to x86 too. Your troubles are more likely to be with platform-specific stuff. (ie. you have an Android or iOS app and you're trying to compile for Windows, and they use very different GUI concepts.) – Mason Wheeler Jun 2 '13 at 16:29
  • 1
    Try an emulator? – James Jun 2 '13 at 18:17
5

Gcc can cross-compile programs for Intel targets from ARM hosts, but I'm not entirely sure that's what you meant to ask, because your terminology is off. Let me lay out some general principles, which should hopefully either answer your question or give you enough information to clarify your question.

There are several different things to consider about cross compiling:

  1. The host system. This is the system that the compiler itself is installed on.
  2. The target system. This is the system that the executable will run on. To fully specify it requires knowledge of a few different things:
    1. The architecture. ARM, x86, amd64, ppc, etc.
    2. The operating system. Android, iOS, Linux, OS X, Windows, etc.
    3. The libraries. Standard language libraries, GUI toolkits, etc. which also must be cross-compiled.

However, you also mention running a program designed for ARM on Intel, which isn't so much cross-compiling as porting. Those are two very different things. If you want to use your Intel machine to compile a program that will run on an Intel machine, that's porting, not cross-compiling.

Depending on how tightly the program is integrated with the operating system, architecture, and libraries, and how portable those were designed to be, this can be relatively easy or a complete nightmare. A C program that only uses standard in and out is relatively easy to port to another platform. Something tightly integrated with the platform, like Internet Explorer for example, is difficult enough to port that it's easier just to start from scratch.

If you clarify whether you actually meant cross-compiling or porting, and give more information on the operating systems and libraries involved, we might be able to help you in more depth.

  • My bad for my misuse of terminology. I meant porting, which may have been why I had troubles finding info on the Internet. I am trying to port a program written exclusively for ARM 6, and use the program on an x86 Windows computer. The source code is not open sourced, so I cannot find what libraries are involved. It runs on Debian – erdekhayser Jun 3 '13 at 1:29
  • Thank you, after clearing up cross-compiling and porting, a quick search was able to help find a working solution. Appreciate the help. – erdekhayser Jun 3 '13 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.