gpt4 book ai didi

c++ - GCC mangling 的变化会影响 ABI 兼容性吗?

转载 作者:行者123 更新时间:2023-12-05 04:33:53 24 4
gpt4 key购买 nike

Documentation对于

-fabi-version

这样说[这里只有一部分]:

[...]
Version 11, which first appeared in G++ 7, corrects the mangling ofsizeof... expressions and operator names. For multiple entities withthe same name within a function, that are declared in differentscopes, 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 callingconventions for empty classes on the x86_64 target and for classeswith only deleted copy/move constructors. It accidentally changes thecalling convention for classes with a deleted copy constructor and atrivial move constructor.

Version 13, which first appeared in G++ 8.2, fixes the accidentalchange in version 12.

Version 14, which first appeared in G++ 10, corrects the mangling ofthe 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 兼容性,链接器是否会在链接时只选择一个,一切都会很好?

注意:假设我正在使用这些东西,尽管我怀疑大多数人在 API 边界内使用它们。

最佳答案

是的,每个 ABI 版本都是不兼容的,但大多数更改只影响极少数情况,希望像 12 这样的某些版本很少见,因为它们很快就被修复了。进行此类更改的原因通常是某些东西会破坏为相同名称,即使只有一个组件使用它而不是需要两个不兼容,它也会中断。

关于c++ - GCC mangling 的变化会影响 ABI 兼容性吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71297640/

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