GCC (GNU Compiler Collection)

 GCC

What is GCC?

In simple words we can say a collection of compilers and development tools for Linux, Windows, multiple BSDs, and a plethora of other operating systems is offered by the GNU Compiler Collection, or GCC. Along with support for Objective-C, Ada, Go, Fortran, and D, it primarily supports C and C++. GCC was created by the Free Software Foundation (FSF) and made available as totally free (as in libre) software.

How does it work?

The GCC toolchain assembles the executable once the code has been compiled, linked with the required libraries, and translated into an assembler. It adheres to the traditional UNIX design principle of using simple tools that perform specific tasks effectively. These proprietary tools are used to compile software using the GCC development suite. GCC uses a preprocessor to add header files and remove comments before executing source code files. The code is then tokenized, macros expanded, compile-time errors detected, and ready to compile. They are then passed to the compiler, which uses them to generate assembly code and create a syntax tree for the program's objects and control flow. From this code, the assembler creates a system executable binary format.

Some Features of GCC:

  • The gcc driver includes a complete DSL for driving compilation called SPEC. 
  • Using the optimise property or #pragma optimise, a function can have specific optimization options. 
  • modifications to the language to support vector as types for SIMD operations. 
  • the -Q command-line switch. For instance, the command line option gcc -Q —help=warnings produces a list of warnings that are by default enabled or disabled, as well as the default level for each warning. 
  • Various optimization settings are controlled using the command-line option —param. 
  • Sanitizers are a relatively new addition to GCC, but they are helpful. For instance, instrumenting the binary with -fsanitize=undefined enables runtime detection of undefined behaviour in code. 
  • Ibgccjit, a more recent feature to GCC that enables the use of "gcc as a library,"

Comments

Popular posts from this blog

ifunc function

Lab2 - 6502 Assembly Language Lab(Calculation)

Lab1 - 2 Open Sources Packages