David Millington 79 Posted January 23, 2019 (edited) We made some changes to the low-level method call ABI in 10.3, which affects both Delphi and C++. This is likely to be invisible to you unless you do something very low-level. It's more visible to you if you use C++, because now an entire class of bugs has been fixed in one go. IMO, whether you use C++ or not, it's very interesting! Info here: https://community.idera.com/developer-tools/b/blog/posts/abi-changes-in-rad-studio-10-3 Edited January 23, 2019 by David Millington 2 3 Share this post Link to post
Sherlock 663 Posted January 24, 2019 Thanks fo the view under the hood! Please, more!! Share this post Link to post
Der schöne Günther 316 Posted January 24, 2019 Absolutely. Interesting and entertaining to read. Please, more of those. Share this post Link to post
Rollo62 536 Posted January 24, 2019 @David Millington Thanks for the nice article. Does this change also affect/improve the compatibility with native VC libraries and Delphi ? Share this post Link to post
Stefan Glienke 2002 Posted January 24, 2019 (edited) Quote For Delphi, no visible effect - this is not something that is normally dug into by developers. If you have assembly code for Win64, you may want to check its handling of parameters between 4 and 8 bytes. Well, not quite - it's not a common case but I want to point that out: If you have any existing 64bit DLL that you compiled with a previous version and are now calling from a 10.3 compiled binary or vice versa that has any of the affected record types you are in trouble. You need to compile both with the same version. Also if I am not mistaken it is between 5 and 8 bytes, 4 bytes fit into a register on both and should not be affected. Edited January 24, 2019 by Stefan Glienke Share this post Link to post
David Millington 79 Posted January 24, 2019 4 bytes does fit into a register in both and is okay. It is params of 5, 6, 7, and 8 bytes in size that prompted this work: that is, params that may or may not fit into a register depending on if the register is 4 bytes or 8 bytes in size. I updated to make that clearer. Glad you find it interesting! For VC compatibility: for cdecl and stdcall, possibly. We had a very comprehensive review of all calling conventions on all platforms. Other compatibility areas with VC can be very different areas, things like object file format or RTL or... Share this post Link to post
Hallvard Vassbotn 3 Posted January 25, 2019 > However, if you need information (for example, perhaps you work on low-level code for profilers or debuggers, or have code for stack manipulation, inline assembly and naked functions, or similar) feel free to contact us. Inquiring minds want to know! 🙂 Share this post Link to post
Rudy Velthuis 91 Posted January 31, 2019 (edited) Actually, there is a difference: Win64 compiler will be slightly different. What is expected to be a 64 bit pass-by-value has become a pass-by-reference parameter now. Delphi will handle this transparently, but for assembler, there is a difference. Edited January 31, 2019 by Rudy Velthuis Typo Share this post Link to post
Rudy Velthuis 91 Posted February 2, 2019 (edited) On 1/24/2019 at 12:19 PM, Stefan Glienke said: If you have any existing 64bit DLL that you compiled with a previous version and are now calling from a 10.3 compiled binary or vice versa that has any of the affected record types you are in trouble. You need to compile both with the same version. I would recompile the DLL, indeed, but make any parameter with 5-8 bytes explicitly a reference parameter: either var, out or const [ref], and adopt my calling code accordingly (in all versions I compile for). Then the ABI change doesn't matter. Of course that doesn't help if you want to deploy the DLL to be used by different already deployed programs written with different versions. That is a big nuisance, IMO, and I wish they hadn't done this (I'd rather they had changed their C++ compilers). But if there is a chance of recompiling, I would certainly use explicit reference passing. Edited February 2, 2019 by Rudy Velthuis Share this post Link to post