LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-08-2010, 03:04 PM   #1
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Rep: Reputation: 53
GCC : Clarity on difference between Build , Host and Target.


I doubt I understand the context at all but here is an example from this web page. http://gcc.gnu.org/onlinedocs/gccint...onfigure-Terms
Quote:
There are three system names that the build knows about: the machine you are building on (build), the machine that you are building for (host), and the machine that GCC will produce code for (target). When you configure GCC, you specify these with --build=, --host=, and --target=.
So the nonsensical question that this conjures is ," obviously I would want this code to run on the system that I'm compiling it for so what does TARGET mean? What is the difference between host and target?

Thanks in advance!

Last edited by theKbStockpiler; 12-08-2010 at 03:07 PM.
 
Old 12-08-2010, 03:45 PM   #2
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Crosscompiling:
A example from my system:
Host: x86_64-slackware-linux
Target: i686-mingw32-windows

Compiling FOR i686 windows system (TARGET) ON Slackware 64 bit (Host).

Here's a extream example:
build: i484-slackware-linux; I'm compiling on a old Slackware system
host: arm-slackware-linux; To run on ArmedSlack (ARM CPU)
target: i686-mingw32-windows; Compiling for Win32 system

Cross-compiling is pretty common thing to do and it is done in a lot of systems. Instead of using limited resources of a small system (Like your phone), They compile the code on their computers to run on the phone.
 
1 members found this post helpful.
Old 12-09-2010, 12:23 AM   #3
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Original Poster
Rep: Reputation: 53
Catch 22 of no installed compiler and no binary available.

I want to point out to anyone that is interested in this topic and can't find an explanation of the Relationships between Build , Host , Target or which each is defined by it's self. I found an explanation here http://books.google.com/books?id=wQ6...20host&f=false The mystery is caused by having a computer that does not have a compiler and a binary file to install one is not available. Hence you have to have what I would term a "Host" computer to compile the compiler for the computer that is absent a compiler. The compiled source code in a binary form would than be transferred to the compiler-less computer.


"Build" is the computer that compiles a compiler for another computer.

"Host" is the Computer that compiles the wanted application using the compiler that was compiled for it.

"Target" is the computer that the application (not the compiler) will execute on.

That's the best I could do. If any corrections are warranted please feel free to add a post.
 
1 members found this post helpful.
Old 12-10-2010, 10:27 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
There is no rigorous definition; these terms are used by convention within the compiler & toolchain builder community. Within that community, there is interest in creating tools that target and run on various combinations of hosts and host types. Most developers are accustomed to using compilers that are native to the target architecture: we build applications on the target architecture itself. However, it is also possible to build application binaries which are intended to run on other architectures. This we call cross-compiling, or more accurately, cross-building.
The matter is even deeper, however. Consider that someone has to build the cross-compiler that generates the binaries. Here, the jargonology becomes significant. For instance, one may wish to create a cross compiler that runs on a x86 host, but creates binaries for a PowerPC target. In this case, the 'host' is the X86 host, and the 'target' is the PowerPC. When the cross-compiler that runs on the x86 host was built, it was done on a 'build' host, which was potentially a third, completely different architecture than the 'host' or 'target' architectures.

For a view of the issues related to this subject, you could review the archives of the crosstool-ng mailing list.

--- rod.

Last edited by theNbomr; 12-10-2010 at 10:35 AM.
 
4 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
binutils 2.20/gcc-4.5.1 build pass 2 reverts to targeting the host system anakinwy Linux From Scratch 2 11-11-2010 03:21 PM
self build rpm fails with missing dependencies on build host zhjim Linux - Software 1 09-24-2009 08:47 AM
Explaining --build --host --target gnashley Slackware 2 12-14-2006 01:27 PM
Gcc Build error: target=Mips Kcghost Programming 2 05-18-2006 11:23 PM
what is the difference between "configure" host and target? linuxlah Programming 3 09-18-2004 06:47 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration