On Thu, 22 Feb 2024 15:26:34 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:
>> I see, seems like it's an unfortunate situation where a fix is hard or even >> impossible. If we file a gcc bug for it now, it'll get fixed in some >> insanely new gcc version (such as gcc 15 or 16) and we'd have to jump to >> that version, which I'm sure no one is going to like :( >> >> Nevertheless, since there are so many instances of it, I suggest #pragma GCC >> visibility push(hidden) instead of adding a new macro to this file, in my >> opinion it's somewhat cleaner and also makes the change smaller. >> >> #pragma GCC visibility push(hidden) >> // Junk that needs hidden visibility to work properly >> #pragma GCC visibility pop >> >> Also, why TARGET_COMPILER_gcc instead of __GNUC__? Does this have to work >> with Apple Clang on macOS as well? > > This is not an issue with clang, only gcc. > > My understanding was that the proper way to test for compiler in Hotspot code > was by using `TARGET_COMPILER_gcc`. > > I can try using the `#pragma` route instead; if it works I agree it is > slightly better than to sprinkle `HIDDEN` all over the place. Drat, I thought the pragma would work. Sorry. I would file a bug for gcc, but I have no idea what to even describe it as ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/17955#discussion_r1500624847