Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross Compiling host target and build [duplicate]

Possible Duplicate:
What’s the difference of `./configure` option `--build`, `--host` and `--target`?

This is related to What's the difference of `./configure` option `--build`, `--host` and `--target`?. I haven't understood the difference between host and target. So am asking this with an example.
I am trying to build some code on my PC. I am guessing it will be i686-pc-linux. I want to run the code on a mipsel based platform. I have the toolchain for that platform (mipsel-linux-gcc etc) What should I be giving as values to host, build and target.

Please don't close as duplicate unless it is of a question which explains this with an example :-)
I have already read the GCC documentation and am still puzzled to be honest

like image 384
bobby Avatar asked Mar 15 '12 09:03

bobby


People also ask

What is host cross-compile?

A cross compiler is useful to compile code for multiple platforms from one development host. Direct compilation on the target platform might be infeasible, for example on embedded systems with limited computing resources. Cross compilers are distinct from source-to-source compilers.

How does cross compiling work?

To cross-compile is to build on one platform a binary that will run on another platform. When speaking of cross-compilation, it is important to distinguish between the build platform on which the compilation is performed, and the host platform on which the resulting executable is expected to run.

Why is cross compiling so hard?

"building a cross-compiler is significantly harder than building a compiler that targets the platform it runs on." The problem exists due to the way libraries are built and accessed. In the normal situation all the libraries are located in a specific spot, and are used by all apps on that system.

What is difference between host and target?

Host refers to attributes of the system where GDB runs. Target refers to the system where the program being debugged executes. In most cases they are the same machine, in which case a third type of Native attributes come into play.


1 Answers

And I found an answer after posting this question.. Still posting it here incase it helps someone else in the future.
http://jingfenghanmax.blogspot.in/2010/09/configure-with-host-target-and-build.html
As per this blog in my case
build will be i686-pc-linux-gnu ( My PC)
host will be mipsel-linux ( The platform I am going to run my code on)
target will be used if I am building a cross-compiling toolchain.
Since I am not building a toolchain, I didnt have to specify target.

like image 164
bobby Avatar answered Oct 05 '22 22:10

bobby