GCC mangling 的变化会影响 ABI 兼容性吗?
Do changes in GCC mangling affect ABI compatability?
-fabi-version
这样说[这里只有一部分]:
[...]
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.
我的问题是这种修改更改(例如不是调用约定更改,而是 Version14 和 Version15 中的更改)会影响 ABI 兼容性,当然会在 link 时间 linker 中选择一个一切都会好起来的?
注意:假设我正在使用这些东西,尽管我怀疑大多数人在 API 范围内使用它们。
是的,每个 ABI 版本都是不兼容的,但是大多数更改只影响极少数情况,希望像 12 这样的某些版本很少见,因为它们很快就被修复了。进行此类更改的原因通常是某些东西会破坏 相同的 名称,即使只有一个组件使用它而不是需要两个不兼容,它也会中断。
-fabi-version
这样说[这里只有一部分]:
[...]
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.
我的问题是这种修改更改(例如不是调用约定更改,而是 Version14 和 Version15 中的更改)会影响 ABI 兼容性,当然会在 link 时间 linker 中选择一个一切都会好起来的?
注意:假设我正在使用这些东西,尽管我怀疑大多数人在 API 范围内使用它们。
是的,每个 ABI 版本都是不兼容的,但是大多数更改只影响极少数情况,希望像 12 这样的某些版本很少见,因为它们很快就被修复了。进行此类更改的原因通常是某些东西会破坏 相同的 名称,即使只有一个组件使用它而不是需要两个不兼容,它也会中断。