1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > GCC the GNU Compiler Collection - GNU 编译器套件

GCC the GNU Compiler Collection - GNU 编译器套件

时间:2021-12-31 23:23:01

相关推荐

GCC  the GNU Compiler Collection - GNU 编译器套件

GCC, the GNU Compiler Collection - GNU 编译器套件

/software/gcc/

The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Ada, Go, and D, as well as libraries for these languages (libstdc++,…). GCC was originally written as the compiler for the GNU operating system.The GNU system was developed to be 100% free software, free in the sense that it respects the user’s freedom.

GNU 编译器套件 (GNU Compiler Collection) 包括 C, C++, Objective-C, Fortran, Ada, Go, and D 语言的前端,也包括了这些语言的库 (libstdc++, …)。GCC 的初衷是为 GNU 操作系统专门编写的一款编译器。GNU 系统是彻底的自由软件。此处,自由的含义是它尊重用户的自由。

C++ Standard Library (libstdc++)

The GCC project includes an implementation of the C++ Standard Library calledlibstdc++, licensed under the GPLv3 License with an exception to link closed source application when sources are built with GCC.

GCC 项目在 GPLv3 的许可下实现了 C++ 标准库 (libstdc++)。

We strive to provide regular, high quality releases, which we want to work well on a variety of native and cross targets (including GNU/Linux), and encourage everyone to contribute changes or help testing GCC. Our sources are readily and freely available via Git and weekly snapshots.

Major decisions about GCC are made by the steering committee, guided by the mission statement.

in the sense:就 ... 意义而言freedom ['friːdəm]:n. 自由,自主,直率strive [straɪv]:vi. 努力,奋斗,抗争encourage [ɪn'kʌrɪdʒ]:vt. 鼓励,怂恿,激励,支持snapshot ['snæpʃɒt]:n. 快照,快相,急射,速射,简单印象 vt. 给 ... 拍快照 vi. 拍快照committee [kə'mɪtɪ]:n. 委员会steer [stɪə]:vt. 控制,引导,驾驶 vi. 驾驶,掌舵,行驶 n. 阉牛mission ['mɪʃ(ə)n]:n. 使命,任务,代表团,布道 vt. 派遣,向 ... 传教statement ['steɪtm(ə)nt]:n. 声明,陈述,叙述,报表,清单

Apache Subversion (SVN, after its command name svn) is a software versioning and revision control system distributed as open source under the Apache License.

The Concurrent Versions System (CVS), also known as the Concurrent Versioning System, is a free client-server revision control system in the field of software development.

1. History

The Free Software Foundation (FSF) distributes GCC as free software under the GNU General Public License (GNU GPL). GCC is a key component of the GNU toolchain and the standard compiler for most projects related to GNU and the Linux kernel. With roughly 15 million lines of code in , GCC is one of the biggest free programs in existence.

GCC 是 GNU 工具链的主要组成部份之一,现在由自由软体基金会负责维护工作。截至 年,GCC 大约有 1500 万行代码,是现存最大的自由程序之一。

When it was first released in 1987 by Richard Stallman, GCC 1.0 was named the GNU C Compiler since it only handled the C programming language.It was extended to compile C++ in December of that year. Front ends were later developed for Objective-C, Objective-C++, Fortran, Ada, D and Go, among others.[6] The OpenMP and OpenACC specifications are also supported in the C and C++ compilers.

原名为 GNU C 语言编译器 (GNU C Compiler),因为它原本只能处理 C 语言。同年 12 月,新的 GCC 编译器可以编译 C++ 语言。后来又为 Objective-C, Objective-C++, Fortran, Ada, D and Go 等其他语言开发了前端。C 和 C++ 编译器也支持 OpenMP 和 OpenACC 规范。

2. License

As well as being the official compiler of the GNU operating system, GCC has been adopted as the standard compiler by many other modern Unix-like computer operating systems, including most Linux distributions.Most BSD family operating systems also switched to GCC shortly after its release, although since then, FreeBSD, OpenBSD and Apple macOS have moved to the Clang compiler, largely due to licensing reasons.

GCC 不仅是 GNU 操作系统的官方编译器,还是许多类 UNIX 系统和 Linux 发行版的标准编译器。BSD 家族中的大部分操作系统也在 GCC 发布之后转用 GCC。不过 FreeBSD, OpenBSD and Apple macOS 已经转向了 Clang 编译器,主要是因为许可问题。

GCC is licensed under the GNU General Public License version 3.TheGCC runtime exceptionpermits compilation of proprietary programs (in addition to free software) with GCC. This does not impact the license terms of GCC source code.

3. Design

GCC’s external interface follows Unix conventions.Users invoke a language-specific driver program (gccfor C,g++for C++, etc.), which interprets command arguments, calls the actual compiler, runs the assembler on the output, and then optionally runs the linker to produce a complete executable binary.

GCC 的外部接口遵循 UNIX 使用惯例。用户输入特定语言的驱动程序码 (gccfor C,g++for C++, etc.),该程序解释命令语句,调用实际编译器,在输出界面上运行汇编器,然后选择性地运行链接器,产生一个完整的可执行二进制文件。

Overview of GCC's extended compilation pipeline, including specialized programs like the preprocessor, assembler and linker (预处理器、汇编器和链接器).

Each of the language compilers is a separate program that reads source code and outputs machine code. All have a common internal structure. A per-language front end parses the source code in that language and produces an abstract syntax tree (treefor short).

每种语言的编译器都是一个独立的程序,可读取源代码并输出机器码。所有语言的编译器都拥有共通的中介架构:各语言前端解析符合此语言的原始码,并产生一抽象语法树。

GCC follows the 3-stage architecture typical of multi-language and multi-CPU compilers.All program trees are converted to a common abstract representation at themiddle end, allowing code optimization and binary code generation facilities to be shared by all languages.

GCC 遵循多语言和多 CPU 编译器的典型三段架构。所有程序树都在middle end转换为通用代码,允许所有语言共享代码优化工具和二进制码生成工具。

3.1. Front ends

Each front end uses a parser to produce the abstract syntax tree of a given source file. Due to the syntax tree abstraction, source files of any of the different supported languages can be processed by the same back end.GCC started out using LALR parsers generated with Bison, but gradually switched to hand-written recursive-descent parsers for C++ in ,[56] and for C and Objective-C in . As of all front ends use hand-written recursive-descent parsers.

每个前端都使用一个分析器来产生给定的源代码的一个抽象语法树。由于语法树的抽象性,不同语言的源代码都可以被同一个后端处理。GCC 一开始使用Bison 生成的 LALR 语法分析器,但在 年逐渐转向用于 C++ 的 hand-written recursive-descent parsers。 年开始,所有前端都使用 hand-written recursive-descent parsers。

Front ends consist of preprocessing, lexical analysis, syntactic analysis (parsing) and semantic analysis.The goals of compiler front ends are to either accept or reject candidate programs according to the language grammar and semantics, identify errors and handle valid program representations to later compiler stages. This example shows the lexer and parser steps performed for a simple program written in C.

前端包括预处理、词法分析、语法分析 (解析) 和句意分析。编译器前端的目标是根据编程语言语法和语义接受或拒绝输入程序,识别错误并将有效的程序表述传递给编译器后端。这个例子展示了编译器前端对一个用 C 语言编写的简单程序进行词法分析和语法分析的步骤。

3.2. Middle end

GENERIC and GIMPLE

GENERIC is an intermediate representation language used as amiddle endwhile compiling source code into executable binaries. A subset, called GIMPLE, is targeted by all the front ends of GCC.

GENERIC 是一种中间表示语言,在将源代码编译成可执行二进制文件时用作middle end。GCC 的所有前端都指向 GENERIC 的子集 GIMPLE。

The middle stage of GCC does all of the code analysis and optimization, working independently of both the compiled language and the target architecture, starting from the GENERIC representation and expanding it to register transfer language (RTL).The GENERIC representation contains only the subset of the imperative programming constructs optimized by the middle end.

GCC 的中间阶段进行所有的独立于编译语言和目标架构的代码分析和优化,从 GENERIC 表示法开始将其转译为暂存器传递语言 (RTL)。GENERIC 表示只包含中端优化后的指令式编程结构的子集。

Optimizatio

Optimization can occur during any phase of compilation; however, the bulk of optimizations are performed after the syntax and semantic analysis of thefront endand before the code generation of theback end; thus a common, even though somewhat contradictory, name for this part of the compiler is themiddle end.

3.3. Back end

In the final phase, the machine code is built by calling a small snippet of code, associated with each pattern, to generate the real instructions from the target’s instruction set, using the final registers, offsets, and addresses chosen during the reload phase.

后端在最后通过调用与每个模式相关联的一小段代码来构建机器代码,以使用在重载时选择的最终寄存器、偏移量和地址从目标指令集中生成真正的指令。

4. GCC Releases

/releases.html

4.1. GCC 12 Release Series

/software/gcc/gcc-12/

12.2 manuals

/onlinedocs/12.2.0/

GCC 12.2 Manual (also in PDF or PostScript or an HTML tarball)

Using the GNU Compiler Collection - For gcc version 12.2.0

/onlinedocs/gcc-12.2.0/gcc.pdf

4.2. GCC 5 Release Series

/gcc-5/

5.5 manuals

/onlinedocs/5.5.0/

GCC 5.5 Manual (also in PDF or PostScript or an HTML tarball)

Using the GNU Compiler Collection - For GCC version 5.5.0

/onlinedocs/gcc-5.5.0/gcc.pdf

5. GCC online documentation

/onlinedocs/

5.1. Using the GNU Compiler Collection (GCC)

/onlinedocs/gcc/index.html

This file documents the use of the GNU compilers.

5.2. GCC 12.2 Manual

/onlinedocs/gcc-12.2.0/gcc/

5.3. GCC 5.5 Manual

/onlinedocs/gcc-5.5.0/gcc/

postscript ['pəʊs(t)skrɪpt]:n. 附言,又及

References

https://yongqiang./

/wiki/GNU_Compiler_Collection

/

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。