It defines how an application interacts with itself, how an application interacts with the kernel, and how an application interacts with libraries. C++ 与ABI 把符号标准、变量内存布局、 函数调用 方式等跟可执行代码二进制兼容性相关的内容称为ABI (Application Binary Interface) 应用程序二进制接口,描述了应用程序和操作系统之间,一个应用和它的库之间,或者应用的组成部分之间的低接口。 大家都在诟病C++的二进制接口(ABI),其它语言是怎么解决的呢? C语言不受ABI的困扰,是因为操作系统是用C写的,其它任何语言都会遇到ABI的问题,但不像C++这样广为诟病,其它语言是怎么解决的呢? 显示全部 关注者 179 被浏览
Pin on actress
The common explanation for not fixing some issues with c++ is that it would break the abi and require recompilation, but on the other hand i encounter statements like this
An abi is a mapping from the execution model of the language to a particular machine/operating system/compiler combination
It makes no sense to define one in the language specification because that runs the risk of excluding c implementations on some architectures. ABI不是语言能定下来的,得看硬件答应不答应。 不同CPU寄存器数量都不一样,你规定前四个参数用寄存器传递,万一人家空闲的寄存器只有三个怎么办? 你规定64位以下的参数可以用寄存器传参,人家寄存器是32位的怎么办? 16位的呢?