Fedora 26 dumpversion 上的 gcc 7.1.1 现在默认只包含主要版本 [英] gcc 7.1.1 on Fedora 26 dumpversion now only includes major version by default

查看:30
本文介绍了Fedora 26 dumpversion 上的 gcc 7.1.1 现在默认只包含主要版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 Fedora 25 升级到 26 后,默认的 gcc 版本现在是 7.1.1 版,gcc -dumpversion 的输出已从 Major.minor.patch 更改为主要.

After upgrading from Fedora 25 to 26 the default gcc version is now version 7.1.1 and the output of gcc -dumpversion has changed from major.minor.patch to just major.

新输出:

$ gcc -dumpversion
7

手册说明

-转储版本

打印编译器版本(例如,3.0、6.3.0 或 7)——不要这样做还要别的吗.这是文件系统路径中使用的编译器版本,规格,可能取决于编译器的配置方式单个数字(大版本),两个数字用点分隔(大版本和大版本)次要版本)或由点分隔的三个数字(主要、次要和补丁级别版本).

Print the compiler version (for example, 3.0, 6.3.0 or 7)—and don’t do anything else. This is the compiler version used in filesystem paths, specs, can be depending on how the compiler has been configured just a single number (major version), two numbers separated by dot (major and minor version) or three numbers separated by dots (major, minor and patchlevel version).

我还没有找到在哪里更改此编译器配置以包含用点配置的三个数字.我发现的最接近的是仅主要版本的配置:

I have not found where to change this compiler configuration to include the three numbers configured with dots. The closest I have found is the major version only configuration:

--with-gcc-major-version-only 指定 GCC 应该在文件系统路径中只使用主编号而不是major.minor.patchlevel.

--with-gcc-major-version-only Specifies that GCC should use only the major number rather than major.minor.patchlevel in filesystem paths.

推荐答案

所以经过一些研究我发现配置版本是一个编译时选项(如果你从源代码编译编译器).

So after some research I found the configure the version is a compile time option (if you compile the compiler from source).

我还发现有一个新的 gcc -dumpfullversion 选项将提供完整的版本号,即 7.1.1,这是我们的构建系统所期望的.需要注意的是,旧版本的 gcc 不支持 -dumpfullversion.

I also found that there is a new gcc -dumpfullversion option that will provide the full version number, ie 7.1.1 which is what our build system expects. Small caveat is that -dumpfullversion is not supported on older versions of gcc.

所以我们不得不更改构建系统以通过 gcc -dumpversion 获取版本并检查它是否是一个数字,如果是,则替换 -dumpfullversion 以获取完整的major.minor.patch gcc 版本.

So we had to change the build system to get the version via gcc -dumpversion and check if its a single digit and if so then substitute -dumpfullversion to get the full major.minor.patch gcc version.

这篇关于Fedora 26 dumpversion 上的 gcc 7.1.1 现在默认只包含主要版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆