What is the official stance of IBM on the compatibility between the C++ runtime 17 and programs compiled with XL C/C++ 16?
The new runtime is meant to be generally load-compatible in keeping with the deployment model of having unversioned runtime installations (different compiler versions target the same runtime library).
If two modules (e.g. executable and a shared library) contain the same type information, the runtime loader won't coalesce those symbols at runtime.
Thank you for reaching out about this. We had become aware of this during the development cycle for Open XL 17.1.1, and this is resolved in the new runtime by performing value-based comparison for typeinfo objects.
------------------------------
Hubert Tong
C++ Standards
IBM XL Compilers
My postings on this site do not necessarily represent IBM's positions, strategies or opinions.
------------------------------
Original Message:
Sent: Mon September 12, 2022 11:17 AM
From: Philipp Wähnert
Subject: Exceptions violate calling convention
Thank you! We already opened a support case but found another problem much less subtle: If two modules (e.g. executable and a shared library) contain the same type information, the runtime loader won't coalesce those symbols at runtime. That's a problem if dynamic casts rely on the fact that type information must be identical and not only equal. Usually operating systems choose one side: Either they coalesce those symbols at runtime and compare type information by a pointer comparison (Windows, macOS) or they don't necessarily coalesce those symbol and rely on a slower but more stable string comparison of the actual type name (GNU/Linux).
Those issues let us wonder whether the C++ runtime 17 is compatible with the code generated by the XL C/C++ 16 and xlclang++. What is the official stance of IBM on the compatibility between the C++ runtime 17 and programs compiled with XL C/C++ 16?
------------------------------
Philipp Wähnert
------------------------------
Original Message:
Sent: Fri September 09, 2022 11:41 AM
From: Sean Perry
Subject: Exceptions violate calling convention
Good catch! Hats off to you for isolating the problem so well. We will fix the problem. If you depend on this I suggest opening a Support case so you can track the progress.
------------------------------
Sean Perry
Original Message:
Sent: Thu September 08, 2022 08:53 AM
From: Andrey Klyachkin
Subject: Exceptions violate calling convention
To make it even more interesting, I compiled the program using xlC (not xlclang++) and the value of the register is not changed.
# xlC -O3 -g -o test-xlC test.cpp
# dbx ./test-xlC
Type 'help' for help.
reading symbolic information ...
(dbx) stop in main
[1] stop in main
(dbx) run
[1] stopped in main at line 2
2 try {
(dbx) p $r14
0x00000001
(dbx) stop at 5
[3] stop at 5
(dbx) c
[3] stopped in main at line 5
5 return 0;
(dbx) p $r14
0x00000001
So it looks like the problem with clang frontend in xlC 16.
------------------------------
Andrey Klyachkin
https://www.power-devops.com
Original Message:
Sent: Thu September 08, 2022 08:48 AM
From: Andrey Klyachkin
Subject: Exceptions violate calling convention
Hi Philipp,
I tested it on AIX 7.2 TL5 SP2 and AIX 7.3 TL0 SP1 with both xlC 16.1.0.11 and Open xlC 17.1.0.1. Disregard of the AIX version, the register r14 is changed when the program is compiled using xlC 16.1.0.11 and is NOT changed when the program is compiled using Open xlC 17.1.0.1.
------------------------------
Andrey Klyachkin
https://www.power-devops.com