Thread overview
1.1.0 ABI change for classes inheriting from interfaces
Nov 21, 2016
Johan Engelen
Nov 21, 2016
Johan Engelen
Nov 21, 2016
ZombineDev
Nov 21, 2016
ZombineDev
Nov 21, 2016
Johan Engelen
November 21, 2016
Hi all,
 I just discovered an important ABI change from 1.0.0 to 1.1.0.

For this code
```
interface I {
    void foo();
}

class A : I {
    int field;

    void foo() {}
}
```

1.0.0 generates the type:
    %abi.A = type { %abi.A.__vtbl*, i8*, i32, [4 x i8], { %object.Interface*, void (%abi.A*)* }* }
whereas 1.1.0 generates the type:
    %abi.A = type { %abi.A.__vtbl*, i8*, { %object.Interface*, void (%abi.A*)* }*, i32 }

Note that the location of the interface vtbl ptr was moved!

1.1.0 behavior is according to spec: https://dlang.org/spec/abi.html

-Johan




November 21, 2016
On Monday, 21 November 2016 at 16:28:28 UTC, Johan Engelen wrote:
> Hi all,
>  I just discovered an important ABI change from 1.0.0 to 1.1.0.

Which turns out is a 2.070 -> 2.071 ABI change (DMD shows the same).
November 21, 2016
On Monday, 21 November 2016 at 16:31:15 UTC, Johan Engelen wrote:
> On Monday, 21 November 2016 at 16:28:28 UTC, Johan Engelen wrote:
>> Hi all,
>>  I just discovered an important ABI change from 1.0.0 to 1.1.0.
>
> Which turns out is a 2.070 -> 2.071 ABI change (DMD shows the same).

Yes, DMD's ABI behavior and the spec were changed between 2.070 and 2.071 by Walter. The goal, IIRC, was better extern(C++) ABI compatability, in addition to other stuff like DWARF exception handling.

Relevant PR: https://github.com/dlang/dlang.org/pull/1225
November 21, 2016
On Monday, 21 November 2016 at 16:38:33 UTC, ZombineDev wrote:
> On Monday, 21 November 2016 at 16:31:15 UTC, Johan Engelen wrote:
>> On Monday, 21 November 2016 at 16:28:28 UTC, Johan Engelen wrote:
>>> Hi all,
>>>  I just discovered an important ABI change from 1.0.0 to 1.1.0.
>>
>> Which turns out is a 2.070 -> 2.071 ABI change (DMD shows the same).
>
> Yes, DMD's ABI behavior and the spec were changed between 2.070 and 2.071 by Walter. The goal, IIRC, was better extern(C++) ABI compatability, in addition to other stuff like DWARF exception handling.
>
> Relevant PR: https://github.com/dlang/dlang.org/pull/1225

See also: https://github.com/dlang/dmd/pull/5361
November 21, 2016
On Monday, 21 November 2016 at 16:28:28 UTC, Johan Engelen wrote:
> Hi all,
>  I just discovered an important ABI change from 1.0.0 to 1.1.0.

If you know of other ABI changes, please add them to the 1.1.0 release notes.
(These are important for our industrial user Weka.io!)

thanks,
  Johan