Saturday, August 20, 2011

Compilers - 4

This is the last post on compilers. Today let's take a careful look on how GCC compiler works.

GCC Compiler :
Before I start, let us look back into how GCC came into existence. GCC stands for GNU C- compiler. It is a compiler, developed as part of the GNU project.

What is GNU ?

GNU stands for GNU is Not Unix. It is a project started by Richard Stallman, to create a Unix like operating system in 1985. In those days, the source of the Unix is proprietary, so they thought of making a Unix like operating system, with it's source code open. Before the creation of the OS itself, they envisioned how it might be and parallely started creating software for the same. One of the brain child of GNU project, that came into existence during that time is "GCC".

A GCC compiler has the following steps
1. Preprocessing is done - macro expansion
2. The expanded source program, is converted into an assembly language program for the underlying machine architecture
3. The assembly language is later converted into a machine language and stored in the form of an object file
4. Finally, the object file is linked with libraries to form the final executable.

Harry Potter and the Deathly Hallows - Part 1


Also, during any stage, you can stop the execution and see how the output of each stage looks like. For the detailed commands, you need to do so, follow this link

No comments:

Post a Comment