RFR: 8327049: Stop exporting debug.cpp functions on gcc [v2]
Magnus Ihse Bursie
ihse at openjdk.org
Fri Mar 1 13:39:51 UTC 2024
On Thu, 29 Feb 2024 13:55:56 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> This is a partial backout of [JDK-8326509](https://bugs.openjdk.org/browse/JDK-8326509). It turned out that starting to export the functions from debug.cpp could have unintended consequences in certain circumstances, so revert back to the original situation where these functions were only exported on Windows.
>
> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision:
>
> Use WINDOWS_ONLY instead
My takeaway from the problem we encountered was that contrary to the assumption in [JDK-8326509](https://bugs.openjdk.org/browse/JDK-8326509), it is better *not* to export these functions on all platforms, but only do so where it is required by the debugger, i.e. on Windows. In fact, since we are still exporting them on Windows, we can still run into the same kind on conflict -- we have just limited the exposure surface to Windows-only. But there seems to be no way around this due to limitations in the Visual Studio debugger. :-(
So this will restore the functionality that has been for a long time -- the debug functions are only exported on Windows. (Previously, this was achieved by marking the functions JNIEXPORT, but leaving them out from the symbol files, which made them non-exported on all compilers except visual studio).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18062#issuecomment-1973220653
More information about the hotspot-dev
mailing list