gpt4 book ai didi

c++ - 如何使用语言支持等进行 "light"构建的 GCC 修剪?

转载 作者:IT老高 更新时间:2023-10-28 11:11:58 27 4
gpt4 key购买 nike

基本上,我想制作一个仅支持 C/C++ 的轻型 GCC。这可以轻松完成还是需要手动修改源代码?

最佳答案

这在 Installing GCC 中有介绍和 Configuration

--enable-languages=lang1,lang2,...
Specify that only a particular subset of compilers and their runtime libraries should be built. For a list of valid values for langN you can issue the following command in the gcc directory of your GCC source tree:

         grep language= */config-lang.in

Currently, you can use any of the following: all, ada, c, c++, fortran, go, java, objc, obj-c++. Building the Ada compiler has special requirements, see below. If you do not pass this flag, or specify the option all, then all default languages available in the gcc sub-tree will be configured. Ada, Go and Objective-C++ are not default languages; the rest are.

因此,对于您的情况,使用:

../gcc/configure --enable-languages=c,c++

应该足够了,当然除了其他需要的选项。

另见 Building

Please note, that re-defining LANGUAGES when calling `make' does not work anymore!

关于c++ - 如何使用语言支持等进行 "light"构建的 GCC 修剪?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14728652/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com