难道没有GCC g ++的工作? [英] Does g++ work without gcc?
问题描述
请问G ++编译不GCC或G ++只是翻译//包括旧G ++版本。
当我试图从源代码,我看到文件安装G ++
gcc.c
块引用>/ *默认prefixes附加到命令的名字。 * /的#ifndef STANDARD_EXEC_ preFIX
#定义STANDARD_EXEC_ preFIX在/ usr / local / lib目录/ gcc-
#ENDIF / *!定义STANDARD_EXEC_ preFIX * /这是G ++ 1.4 // *
嗯,我知道C ++是带类的C我只是想知道,如果G ++可以编译C ++不GCC。
解决方案随着近期的 GCC ,
GCC
(实际上CC1
这是由运行gcc
)和G ++
(实际上cc1plus
其他GCC编译器,如) - 和等gfortran
甚至GDC
....-分享了很多(源)code一起组成:中间末端(其中,最优化发生)和后端。所不同的是仅将编译器(特定的唯一的层存在源语言),它是编译器的小于30%的前端层您可以定制GCC编译器与插件或 MELT 。您的扩展将工作海合会内部重新presentations(GIMPLE-S)和编译C,C ++,Ada语言,Fortran语言等时会工作......记住的 GCC 的手段的 GNU编译器集合的今天
其实,
GCC
程序能够编译C ++源$ C $ C(同样地G ++
可以编译C或Fortran的code)。然而,它们不连接的相同的库通过
-v
标志的GCC
或G ++
命令,了解他们正在运行的。下面是两个(矿)[CC-BY-SA]图片-explaing GCC和放大器;熔融说明这一点。
的三个层次 - 前年底,中端,编译器的背端值:
与你的插件,或 MELT 元插件
与简化:
CC1
或cc1plus
正在生成汇编文件,然后由<翻译code>为按GCC启动
或G ++
和
的内部的另一个视图
CC1
或cc1plus
,这产生了一些汇编code
Does G++ compile without GCC or G++ is just translator // Including old g++ version.
when i was trying to install g++ from source i saw file
gcc.c
/* Default prefixes to attach to command names. */ #ifndef STANDARD_EXEC_PREFIX #define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-" #endif /* !defined STANDARD_EXEC_PREFIX */
//from g++1.4*
Well i know that c++ is c with classes i just wanted to know if the g++ can compile c++ without gcc .
解决方案With a recent GCC,
gcc
(actuallycc1
which is run bygcc
) andg++
(actuallycc1plus
) -and so on for other GCC compilers, e.g.gfortran
or evengdc
....- share a lot of (source) code together: the middle-end (where most optimizations happen) and the back-end. The difference is only the front-end layer of the compiler (the only layer being source language specific) which is less than 30% of the compiler.You could customize the GCC compiler with plugins or with MELT. Your extensions would work on GCC internal representations (Gimple-s) and would work when compiling C, C++, Ada, Fortran, etc... Remember that GCC means Gnu Compiler Collection today
Actually the
gcc
program is able to compile C++ source code (and likewiseg++
can compile C or Fortran code). However, they are not linking the same libraries.Pass the
-v
flag to thegcc
org++
command to understand what they are running.
Here are two (mine) [CC-BY-SA] pictures -explaing GCC & MELT- illustrating this.
The three layers -front-end, middle-end, back-end- of the compiler:
with your plugin, or the MELT meta-plugin
with a simplification:
cc1
orcc1plus
are generating assembler files, which is then translated byas
started bygcc
org++
and
another view of the internals of
cc1
orcc1plus
,which generates some assembler code
这篇关于难道没有GCC g ++的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!