compiler

Compiler From Hackepedia

A compiler is a program that parses a high level programming language into machine parsable assembly code. Usually the compiler hands the produced assembly instructions to an assembler which then turns the assembly instructions into binary machine code that is executable by the computer directly without any interpreting programs. A common compiler found is the GNU C compiler (gcc), others include Borland C Compiler, Watcom C, Sun C compiler, Intel C compiler and so on.

Cross platform compilers

GNU C Compiler is capable of cross compiling other platforms from a different architecture. For example you can produce PowerPC assembly instructions with an amd64/i386 machine. There is other compilers that can possibly do this.

Internal procedure of compiling a program with GCC

GCC takes the C programming language code (.c) and changes it internally to a (.a) output (you can set a flag to stop the compiling process here). GAS (GNU Assembler) is then called upon to produce the binary output files (.o). Finally to make the program work, it has to call upon ld (linker) to link any shared libraries or crt0's against the .o file. Most of this is done through pipes within GCC itself as it forks and executes these programs.


German - von hackepedia

Ein Compiler ist ein Programm das eine hohe Programmiersprache in Maschinen- sprache umwandelt. Meistens danach gibt der compiler diese maschinensprache dann einem assembler, was dann die maschinen sprache in den Binären code übersetzt, das kann der Rechner dann ausführen. Es ist kein Interpretierer notwendig, das programm läuft von selbst. Es gibt mehrere compiler, einer davon ist GNU C compiler (gcc), andere wie Borland C Compiler, Watcom C, Sun C compiler, Intel C compiler und so weiter, existieren auch.

Plattformübergreifende Compiler

Der GNU C compiler kann von einer Architektur zu einer anderen Architektur kompilieren. Zum beispiel kann PowerPC Maschienensprache erzeugt werden auf einer amd64/x86_64 Maschine. Es gibt bestimmt andere Kompilierer die das auch können.

Interne Prozedur um ein Programm zu kompilieren mit GCC

GCC nimmt die C programme (.c) und ändert sie intern zu einem assembly (.a) programm (mann kann hier den prozess abrechen lassen um den .a output zu lesen). GAS (GNU Assembler) wird dann aufgerufen um die Binären dateien (mit .o extension) zu schreiben. Zuletzt um das programm zum laufen zu bringen wird Ld (linker, (zusammenknüpfer)) aufgerufen um dynamische archive und crt0 mit den .o Dateien zu verknüpfen. Das meiste hier wird durch pipes innerhalb von GCC selbst gemacht als es diese programme forkt und executiert.

DeutschEnglish
Plattformübergreifendcross-platform