This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: GCC compiler collection


Hi Yves,

Thanks for your information. My question is,

>>GCC is a compiler; that is, a program that takes source code
>>(C, C++, Objective C, ADA, and some others I forgot) and
>>turns it into machine language (i386, ARM, m68000 and a
>>bunch of others).

	GCC is capable of processing C/C++ language inputs, So GCC source code
should have the algorithm of processing two language inputs. Now, If I build
the GCC for only 'C' Language then some of the algorithm part will be build
and rest of them are not (sometimes). Thats fine I understand.

If I want to make only a 'C' compiler for new architecture (I mean porting
GCC to new platform). In that case, If I take all the source code of GCC
(which supports C/C++ etc languages), intern it increase my source code size
of my 'C' compiler for new architecture and makes the maintenance bit
complex. Is not it !!.

So, What I asked is, is there any procedure to segregate the source code of
GCC compiler collection specific to 'C' language support.

Cheers,
Mani

-----Original Message-----
From: crossgcc-owner@sources.redhat.com
[mailto:crossgcc-owner@sources.redhat.com]On Behalf Of Yves Rutschle
Sent: Wednesday, April 04, 2001 1:27 PM
To: 'Manikandan.V'; 'Crossgcc'
Subject: RE: GCC compiler collection



Hello,

> This question might be very small. Since, I am naive to
> the gcc I got a doubt. I am writing this up to my
> understanding. Please, correct it, if there is a mistake.

Well, you do sound confused, and I'm not sure I understand
all of your questions, but FWIW here are some hints:

> Gcc is a collection of source code which generates
> compiler for certain processor by configuring and building
> it.

GCC is a compiler; that is, a program that takes source code
(C, C++, Objective C, ADA, and some others I forgot) and
turns it into machine language (i386, ARM, m68000 and a
bunch of others).

I guess you can think of a compiler as 3 main modules:
- A parser, that understands what the source code does. That
  would be specific to the language you use.
- A machine language back-end. That one is able to "speak"
  the machine language you target.
- An operating system back-end. That one knows how to
  interface to OS-dependent calls. (This is different than
  the point above: obviously you cannot compile a program
  the same way for Windows NT and for Linux, even though
  both operating systems are running on the very same
  computer.)

Obviously there might be a bit of magic to intertwine all
those elements in an efficient way :-)

The interesting things about GCC is that it separates all
those elements in a very clear way, that you specify when
you configure before building GCC: arm-linux will compile
for arm and linux, i386-cygwin will compile for Cygwin on an
Intel chip, etc. (You can specify what language you want
your compiler to understand, but I think the default is to
understand all of them.) And because GCC is written in C,
you can choose a target that is different of the machine you
are compiling on (that's cross compiling).

So, when you configure GCC before building it, what you
really do is tell it what parts should be built in order to
compile for the target you specified.

> After the configuration and make, will the GCC collection,
> generates only the compiler exes of the configured
> processor, OR it also generates some source code specific
> to the compiler of configured processor.

The build of GCC will produce the executables for the
compiler, along with a bunch of specification files, default
linker scripts, and whatnot it might need. It should not
produce source code for the target. It might (most probably)
build some default libraries and object files such as start
code for example.

> How, can I get the files which are specific to the
> compiler processing.

Not sure what you mean here? GCC comes complete, you really
need only two other packages: binutils, and a most probably
a standard C library.

HTH,
Yves.

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to
crossgcc-unsubscribe@sourceware.cygnus.com


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]