SPO-Project concepts and tools.(Part 1)

Through the next couple of days, I will publish a series of blogs about different tools and concepts that will be useful for me to implement the final project of my SPO600 course. In this blog I will talk about GCC and how does it work.

GCC Compiler:

GCC stands for GNU Compiler Collection which is an optimizing compiler and it is a product of GNU project. It supports various programming languages, hardware architectures and operating systems. It is a key component in the GNU toolchain. Most of the projects related to GNU and the Linux kernel uses GCC as their compiler. This has been made available as a free software.

 

GCC working pr­inciple:

GCC is a toolchain which compiles and links code with any of the library dependencies and then converts that code to assembly language. After that it prepares executable files from it. GCC follows the standard UNIX design mechanism which uses simple tools to perform individual tasks well. When we run GCC with a source code file, at first it uses a preprocessor to add a header files and discard comments. After that is tokenizes the code, expands macros and detects any compile time issues. Then it prepares the code for compilation which then converted into an assembly code. The assembler then convert this code to a format which the system understands which is called binary executable format. The final product is appeared as an executable format for the respective system.

 

GCC features:

1. Strong focus was given on portability while GCC was written in C. Besides it can compile itself. Therefore it can be adapted to any new systems.

2. Having a modular design, GCC allows support for new languages and architectures that are need to be added.

3. GCC uses the recent feature libgccjit which enables the use of “GCC as a library”.

4. It can control various optimization settings using the command line option –param

5. As GCC is a free software, everyone has the freedom of using and modifying it according to their work.

Comments

Popular posts from this blog

SPO600-Lab2 (Experimenting with 6502 emulator)

SPO600- Math and strings Lab(Lab 3)

Naziur Rahman khan Fall 2022 SPO600 Project (Algorithm-part2)