GCC 重整的变化会影响 ABI 兼容性吗?
-fabi-版本
说这个[这里仅部分]:
[...]
版本 11 首次出现在 G++ 7 中,纠正了 sizeof...表达式和运算符名称。对于多个实体 函数内具有相同的名称,但在不同的函数中声明 范围内,重整现在从第十二次出现开始发生变化。 它还意味着 -fnew-inheriting-ctors。版本 12 首次出现在 G++ 8 中,修正了调用 x86_64 目标上的空类和类的约定 仅删除了复制/移动构造函数。它无意中改变了 具有删除的复制构造函数和 简单的移动构造函数。
版本 13 首次出现在 G++ 8.2 中,修复了意外的问题 版本 12 中的更改。
版本 14 首次出现在 G++ 10 中,纠正了 nullptr 表达式。
版本 15 首次出现在 G++ 11 中,更改了 __alignof __ 与alignof 和相关运算符名称不同。
我的问题是这种混乱的变化(例如不是调用约定的变化,而是 Version14 和 Version15 中的变化)是否会影响 ABI 兼容性,或者在链接时链接器只选择一个,一切都会很棒?
注意:假设我正在使用这些东西,尽管我怀疑大多数人在 API 边界内使用这些东西。
Documentation for
-fabi-version
says this[only part here]:
[...]
Version 11, which first appeared in G++ 7, corrects the mangling of
sizeof... expressions and operator names. For multiple entities with
the same name within a function, that are declared in different
scopes, the mangling now changes starting with the twelfth occurrence.
It also implies -fnew-inheriting-ctors.Version 12, which first appeared in G++ 8, corrects the calling
conventions for empty classes on the x86_64 target and for classes
with only deleted copy/move constructors. It accidentally changes the
calling convention for classes with a deleted copy constructor and a
trivial move constructor.Version 13, which first appeared in G++ 8.2, fixes the accidental
change in version 12.Version 14, which first appeared in G++ 10, corrects the mangling of
the nullptr expression.Version 15, which first appeared in G++ 11, changes the mangling of
__ alignof __ to be distinct from that of alignof, and dependent operator names.
My question is do this mangling changes(so not for example calling conventions change, but changes in Version14 and Version15) affect ABI compatability, of will during link time linker just pick one and everything will be great?
note: presume I am using those things, although I doubt that most people use those in API boundaries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,每个 ABI 版本都是不兼容的,但大多数更改只影响极少数情况,希望像 12 这样的某些版本很少见,因为它们很快就得到了修复。进行此类更改的原因通常是某些事物会破坏相同名称,即使只有一个组件使用它而不需要两个组件不兼容,也会出现这种情况。
Yes, each ABI version is incompatible, but most of the changes affect only rare cases, and hopefully certain versions like 12 are rare because they were fixed quickly. The reason such changes are made at all is usually that certain things mangle to the same name, which breaks even if only one component uses it rather than needing two to be incompatible.