2

I have an embedded system on a portable ARM device, and it runs a customized Linux. How can I build a native compiler for that Linux distro?

For example, I am now using machine A, and on A, I have both native compiler, and a cross-compiler for machine B. How can I build a compiler that can run directly on B?

I searched a bit, but only to find some tutorials of how to build cross compiler for B, but did not find how to build a native compiler through a cross compiler.

2
  • gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html Commented Apr 27, 2012 at 14:30
  • Just so everyone's on the same page, you want a compiler that runs on your ARM and compiles for the same ARM, built on your (presumably) faster and less-portable machine, correct? Commented Apr 27, 2012 at 15:38

2 Answers 2

2

I'm not sure the marked answer is correct. I'm working on a project that mirrors the one in the original question and according to the link that n.m. posted, the original asker is attempting is called one of three things: a host-x-host, crossed native, or cross-built native...NOT a Canadian-Cross.

Unfortunately there does not seem to be any tutorials on this subject...at least none that I could find.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes that answer is not quite correct, but the link he gave is kinda useful... Right now I am not trying to use native compiler because it is too much work to build. So I am just using a cross compiler now. But thanks for the information :)
Gotcha...makes sense. Out of curiosity, what's the make/model of the portable device?
1

As I understand your question, you have fast non-ARM host and slow ARM. You want to build a compiler on your fast host; and compiler will be used on ARM system to compile code to ARM machine.

This setup is almost classic Canadian Cross:

Given three machines A, B, and C, one uses machine A (e.g. running Windows XP on an IA-32 processor) to build a cross compiler that runs on machine B (e.g. running Mac OS X on an x86-64 processor) to create executables for machine C (e.g. running Android on an ARM processor).

You have B=C and can use Canadian Cross build systems.

Unfortunately, this type of cross compilers are the hardest one. There are some manual to build such Cross: http://airs.com/ian/configure/configure_6.html ... or try to google "canadian cross gcc".

There are also some scripts to build embedded systems based on Linux. Will try to search some and add them here:

1 Comment

Although did not show exactly how to do, the link is a good place to start!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.